forked from ivmai/bdwgc
-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (153 loc) · 5.35 KB
/
zig-cross-compile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# This workflow uses Zig and its excellent cross-compilation support to test
# compiling for multiple platforms. No tests are actually run since it would
# require emulation.
name: zig cross-compile
on: [ push, pull_request ]
jobs:
build:
name: ${{ matrix.ttriple }} cpp:${{ matrix.enable_cplusplus }} thr:${{ matrix.enable_threads }} dll:${{ matrix.shared_libs }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zig_version: [ "0.12.0" ]
# Some of the triples are commented out just to speedup this workflow.
ttriple: [
aarch64-linux-gnu,
#aarch64-linux-musl,
aarch64-macos-none,
aarch64-windows-gnu,
#aarch64_be-linux-gnu,
aarch64_be-linux-musl,
#arm-linux-gnueabi,
arm-linux-gnueabihf,
arm-linux-musleabi,
#arm-linux-musleabihf,
armeb-linux-gnueabi,
#armeb-linux-gnueabihf,
#armeb-linux-musleabi,
armeb-linux-musleabihf,
#mips-linux-gnueabi,
#mips-linux-gnueabihf,
mips-linux-musl,
mips64-linux-gnuabi64,
#mips64-linux-gnuabin32,
mips64-linux-musl,
#mips64el-linux-gnuabi64,
mips64el-linux-gnuabin32,
mips64el-linux-musl,
mipsel-linux-gnueabi,
#mipsel-linux-gnueabihf,
mipsel-linux-musl,
#powerpc-linux-gnueabi,
powerpc-linux-gnueabihf,
#powerpc-linux-musl,
powerpc64-linux-gnu,
#powerpc64-linux-musl,
#powerpc64le-linux-gnu,
powerpc64le-linux-musl,
riscv64-linux-musl,
sparc64-linux-gnu,
thumb-linux-gnueabi,
#thumb-linux-gnueabihf,
#thumb-linux-musleabi,
thumb-linux-musleabihf,
wasm32-wasi-musl,
#x86-linux-gnu,
x86-linux-musl,
x86-windows-gnu,
x86_64-linux-gnu.2.27, # with a glibc version
x86_64-linux-gnux32,
#x86_64-linux-musl,
x86_64-macos-none,
x86_64-windows-gnu,
]
enable_cplusplus: [ false, true ]
enable_threads: [ false, true ]
shared_libs: [ false, true ]
exclude:
- enable_threads: true
ttriple: wasm32-wasi-musl
- enable_cplusplus: false # excluded to speedup this workflow
shared_libs: false
# The following ones have "exceeds the max lock-free size" warning.
- enable_threads: true
ttriple: arm-linux-gnueabi
- enable_threads: true
ttriple: arm-linux-musleabi
- enable_threads: true
ttriple: armeb-linux-gnueabi
- enable_threads: true
ttriple: thumb-linux-gnueabi
- enable_threads: true
ttriple: thumb-linux-musleabi
- enable_threads: true
ttriple: thumb-linux-musleabihf
# The following ones have some zig link issue.
- shared_libs: true
ttriple: aarch64_be-linux-gnu
- shared_libs: true
ttriple: aarch64_be-linux-musl
- shared_libs: true
ttriple: armeb-linux-gnueabi
- shared_libs: true
ttriple: armeb-linux-gnueabihf
- shared_libs: true
ttriple: armeb-linux-musleabi
- shared_libs: true
ttriple: armeb-linux-musleabihf
- shared_libs: true
ttriple: mips64-linux-gnuabin32
- shared_libs: true
ttriple: mips64el-linux-gnuabin32
- shared_libs: true
ttriple: powerpc-linux-gnueabi
- shared_libs: true
ttriple: powerpc-linux-gnueabihf
- shared_libs: true
ttriple: sparc64-linux-gnu # FIXME: recompile with -fPIC
- shared_libs: true
ttriple: thumb-linux-gnueabi
- shared_libs: true
ttriple: thumb-linux-gnueabihf
- shared_libs: true # FIXME: creating shared libs is not yet stable
ttriple: wasm32-wasi-musl
- shared_libs: true # FIXME: recompile with -fPIC
ttriple: x86_64-linux-gnux32
- enable_cplusplus: true
shared_libs: true # FIXME: relocation R_MIPS_32 against local symbol
ttriple: mips-linux-musl
- enable_cplusplus: true
shared_libs: true
ttriple: mips64-linux-gnuabi64
- enable_cplusplus: true
shared_libs: true
ttriple: mips64-linux-musl
- enable_cplusplus: true
shared_libs: true
ttriple: mips64el-linux-musl
- enable_cplusplus: true
shared_libs: true
ttriple: mipsel-linux-gnueabi
- enable_cplusplus: true
shared_libs: true
ttriple: mipsel-linux-musl
- enable_cplusplus: true
shared_libs: true # FIXME: relocation refers to a discarded section
ttriple: powerpc64-linux-gnu
- enable_cplusplus: true
shared_libs: true
ttriple: powerpc64le-linux-musl
steps:
- uses: actions/checkout@v4
- uses: korandoru/setup-zig@v1
with:
zig-version: ${{ matrix.zig_version }}
- name: Build
run: >
zig build -Dtarget=${{ matrix.ttriple }}
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }}
-DCFLAGS_EXTRA="${{ matrix.cflags_extra }}"
-Denable_cplusplus=${{ matrix.enable_cplusplus }}
-Denable_threads=${{ matrix.enable_threads }}
-Denable_werror