Skip to content

Commit 82f40ba

Browse files
committed
Initial steps to switch to LLVM
* Linux and macOS build script added * workflow YAML changed * LLVM 13.x submodule added The build is not likely to succeed yet (dependencies), but it's a start
1 parent 7761867 commit 82f40ba

File tree

7 files changed

+138
-278
lines changed

7 files changed

+138
-278
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22
env:
3-
BINUTILS_VERSION: 2.37
3+
BUILD_DIR: xa-build
44

55
on:
66
push:
@@ -12,21 +12,21 @@ on:
1212

1313
jobs:
1414
build_linux:
15-
runs-on: ubuntu-18.04
15+
runs-on: ubuntu-20.04
1616
steps:
1717
- uses: actions/checkout@v2
1818

1919
- name: Install build dependencies
2020
run: |
2121
sudo apt-get update
22-
sudo apt-get -f -u install mingw-w64 autoconf gettext texinfo dwz xz-utils zlib1g-dev
22+
sudo apt-get -f -u build-dep llvm-10
2323
24-
- name: build Linux and Windows
25-
run: ./build.sh ${BINUTILS_VERSION}
24+
- name: build Linux
25+
run: ./build.sh
2626

2727
- name: package config and build logs
2828
if: ${{ always() }}
29-
run: find build -name 'config.*' | zip -9 linux-build-logs.zip -@
29+
run: find ${BUILD_DIR} -name 'config.*' | zip -9 linux-build-logs.zip -@
3030

3131
- name: upload config and build logs
3232
if: ${{ always() }}
@@ -38,10 +38,10 @@ jobs:
3838
- name: package artifacts
3939
run: tar cjf linux-artifacts.tar.bz2 artifacts
4040

41-
- name: upload Linux and Windows artifacts
41+
- name: upload Linux artifacts
4242
uses: actions/upload-artifact@v2
4343
with:
44-
name: linux-windows
44+
name: linux
4545
path: linux-artifacts.tar.bz2
4646

4747
build_macos:
@@ -52,14 +52,14 @@ jobs:
5252
- name: Install build dependencies
5353
run: |
5454
brew update
55-
brew install make autoconf gettext xz
55+
brew install cmake ninja
5656
5757
- name: build macOS
58-
run: bash -x ./build.sh ${BINUTILS_VERSION}
58+
run: bash -x ./build.sh
5959

6060
- name: package config and build logs
6161
if: ${{ always() }}
62-
run: find build -name 'config.*' | zip -9 macos-build-logs.zip -@
62+
run: find ${BUILD_DIR} -name 'config.*' | zip -9 macos-build-logs.zip -@
6363

6464
- name: upload config and build logs
6565
if: ${{ always() }}
@@ -78,13 +78,13 @@ jobs:
7878
path: macos-artifacts.tar.bz2
7979

8080
package_binaries:
81-
runs-on: ubuntu-18.04
81+
runs-on: ubuntu-20.04
8282
needs: [build_linux, build_macos]
8383
steps:
84-
- name: Download Linux and Windows artifacts
84+
- name: Download Linux artifacts
8585
uses: actions/download-artifact@v2
8686
with:
87-
name: linux-windows
87+
name: linux
8888

8989
- name: Download macOS artifacts
9090
uses: actions/download-artifact@v2
@@ -100,10 +100,10 @@ jobs:
100100
tar xf macos-artifacts.tar.bz2
101101
102102
- name: Pack Linux, macOS and Windows artifacts
103-
run: tar cjf xamarin-android-binutils.tar.bz2 artifacts
103+
run: tar cjf xamarin-android-llvm.tar.bz2 artifacts
104104

105-
- name: upload Xamarin.Android Binutils
105+
- name: upload Xamarin.Android LLVM Utilities
106106
uses: actions/upload-artifact@v2
107107
with:
108108
name: Xamarin.Android
109-
path: xamarin-android-binutils.tar.bz2
109+
path: xamarin-android-llvm.tar.bz2

.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[submodule "external/llvm"]
2+
path = external/llvm
3+
url = https://github.com/llvm/llvm-project.git
4+
shallow = true
5+
branch = release/13.x

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
[![CI](https://github.com/xamarin/xamarin-android-binutils/actions/workflows/ci.yml/badge.svg)](https://github.com/xamarin/xamarin-android-binutils/actions/workflows/ci.yml)
22

3-
# GNU Binutils for Xamarin.Android
3+
# LLVM binary utilities for Xamarin.Android
44

5-
This repository hosts builds of [GNU Binutils](https://sourceware.org/binutils) for Xamarin.Android.
5+
This repository hosts builds of select
6+
[LLVM](https://sourceware.org/binutils) utilities for Xamarin.Android.
67

7-
Xamarin.Android uses a handful of utilities from Binutils (`as`, `ld`
8+
Xamarin.Android uses a handful of utilities from LLVM (`llvm-mc`, `lld`
89
and `strip`) in its application build process, parts of which entail
910
generation of native assembly for `ARM`, `ARM64`, `x86` and `x86_64`
10-
devices. Until NDK release 22 these utilities were part of its
11-
distribution, but with release 23 almost all of them (except for `as`)
12-
are going to be removed. Thus the need to build our own copies.
11+
devices.
1312

14-
The Binutils sources are built in this repository without any changes.
15-
After the build is done, we create a tarball with the binaries for
16-
Linux, macOS and Windows. The tarball is then used by Xamarin.Android
17-
to package the utilities for Xamarin.Android distribution.
18-
19-
# How to build and publish new version of GNU Binutils
13+
# How to build and publish new version of LLVM utilities
2014

2115
1. Edit `.github/workflows/ci.yml`
2216
2. Set the `BINUTILS_VERSION` variable to the new version number of

build.cmd

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake -G "Visual Studio 16 2019" -A x64 ^
2+
-DCMAKE_BUILD_TYPE=Release ^
3+
-DBUILD_SHARED_LIBS=OFF ^
4+
-DLLVM_ENABLE_PROJECTS="lld" ^
5+
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" ^
6+
-DLLVM_BUILD_BENCHMARKS=OFF ^
7+
-DLLVM_INCLUDE_BENCHMARKS=OFF ^
8+
-DLLVM_BUILD_DOCS=OFF ^
9+
-DLLVM_BUILD_EXAMPLES=OFF ^
10+
-DLLVM_INCLUDE_EXAMPLES=OFF ^
11+
-DLLVM_BUILD_TESTS=OFF ^
12+
-DLLVM_INCLUDE_TESTS=OFF ^
13+
-DLLVM_BUILD_TOOLS=OFF ^
14+
-DLLVM_INCLUDE_TOOLS=ON ^
15+
-DLLVM_ENABLE_BINDINGS=OFF ^
16+
-DLLVM_ENABLE_FFI=OFF ^
17+
-DLLVM_ENABLE_IDE=ON ^
18+
-DLLVM_ENABLE_ZLIB=OFF ^
19+
-DLLVM_ENABLE_LIBXML2=OFF ^
20+
-DLLVM_STATIC_LINK_CXX_STDLIB=ON ^
21+
-DLLVM_ENABLE_TERMINFO=OFF ^
22+
-DLLVM_ENABLE_LIBEDIT=OFF ^
23+
-DLLVM_ENABLE_LIBPFM=OFF ^
24+
-DLLVM_ENABLE_ASSERTIONS=OFF ^
25+
-DLLVM_BUILD_RUNTIMES=OFF ^
26+
-DLLVM_OPTIMIZED_TABLEGEN=ON ^
27+
-DLLVM_ENABLE_THREADS=OFF ^
28+
-DLLVM_USE_CRT_RELEASE=MT ^
29+
-DLLVM_USE_CRT_MINSIZEREL=MT ^
30+
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ^
31+
../llvm/

0 commit comments

Comments
 (0)