@@ -55,7 +55,7 @@ __AlpinePackages+=" gettext-dev"
55
55
__AlpinePackages+=" icu-dev"
56
56
__AlpinePackages+=" libunwind-dev"
57
57
__AlpinePackages+=" lttng-ust-dev"
58
- __AlpinePackages+=" compiler-rt-static "
58
+ __AlpinePackages+=" compiler-rt"
59
59
__AlpinePackages+=" numactl-dev"
60
60
61
61
# runtime libraries' dependencies
@@ -150,7 +150,6 @@ while :; do
150
150
__BuildArch=riscv64
151
151
__AlpineArch=riscv64
152
152
__AlpinePackages=" ${__AlpinePackages// lldb-dev/ } "
153
- __AlpinePackages=" ${__AlpinePackages// compiler-rt-static/ } "
154
153
__QEMUArch=riscv64
155
154
__UbuntuArch=riscv64
156
155
__UbuntuRepo=" http://deb.debian.org/debian-ports"
@@ -160,10 +159,6 @@ while :; do
160
159
if [[ -e " /usr/share/keyrings/debian-ports-archive-keyring.gpg" ]]; then
161
160
__Keyring=" --keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --include=debian-ports-archive-keyring"
162
161
fi
163
-
164
- if [[ " $version " != " edge" && ( -z " $__AlpineVersion " || -z " $__AlpineMajorVersion " )]]; then
165
- __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive)
166
- fi
167
162
;;
168
163
ppc64le)
169
164
__BuildArch=ppc64le
@@ -175,10 +170,6 @@ while :; do
175
170
__UbuntuPackages=" ${__UbuntuPackages// libomp-dev/ } "
176
171
__UbuntuPackages=" ${__UbuntuPackages// libomp5/ } "
177
172
unset __LLDB_Package
178
-
179
- if [[ " $version " != " edge" && ( -z " $__AlpineVersion " || -z " $__AlpineMajorVersion " )]]; then
180
- __AlpineVersion=3.15 # minimum version that supports compiler-rt
181
- fi
182
173
;;
183
174
s390x)
184
175
__BuildArch=s390x
@@ -190,10 +181,6 @@ while :; do
190
181
__UbuntuPackages=" ${__UbuntuPackages// libomp-dev/ } "
191
182
__UbuntuPackages=" ${__UbuntuPackages// libomp5/ } "
192
183
unset __LLDB_Package
193
-
194
- if [[ " $version " != " edge" && ( -z " $__AlpineVersion " || -z " $__AlpineMajorVersion " )]]; then
195
- __AlpineVersion=3.15 # minimum version that supports compiler-rt
196
- fi
197
184
;;
198
185
x64)
199
186
__BuildArch=x64
@@ -206,6 +193,7 @@ while :; do
206
193
x86)
207
194
__BuildArch=x86
208
195
__UbuntuArch=i386
196
+ __AlpineArch=x86
209
197
__UbuntuRepo=" http://archive.ubuntu.com/ubuntu/"
210
198
;;
211
199
lldb* )
@@ -260,25 +248,40 @@ while :; do
260
248
;;
261
249
jessie) # Debian 8
262
250
__CodeName=jessie
263
- __UbuntuRepo=" http://ftp.debian.org/debian/"
251
+
252
+ if [[ -z " $__UbuntuRepo " ]]; then
253
+ __UbuntuRepo=" http://ftp.debian.org/debian/"
254
+ fi
264
255
;;
265
256
stretch) # Debian 9
266
257
__CodeName=stretch
267
- __UbuntuRepo=" http://ftp.debian.org/debian/"
268
258
__LLDB_Package=" liblldb-6.0-dev"
259
+
260
+ if [[ -z " $__UbuntuRepo " ]]; then
261
+ __UbuntuRepo=" http://ftp.debian.org/debian/"
262
+ fi
269
263
;;
270
264
buster) # Debian 10
271
265
__CodeName=buster
272
- __UbuntuRepo=" http://ftp.debian.org/debian/"
273
266
__LLDB_Package=" liblldb-6.0-dev"
267
+
268
+ if [[ -z " $__UbuntuRepo " ]]; then
269
+ __UbuntuRepo=" http://ftp.debian.org/debian/"
270
+ fi
274
271
;;
275
272
bullseye) # Debian 11
276
273
__CodeName=bullseye
277
- __UbuntuRepo=" http://ftp.debian.org/debian/"
274
+
275
+ if [[ -z " $__UbuntuRepo " ]]; then
276
+ __UbuntuRepo=" http://ftp.debian.org/debian/"
277
+ fi
278
278
;;
279
279
sid) # Debian sid
280
280
__CodeName=sid
281
- __UbuntuRepo=" http://ftp.debian.org/debian/"
281
+
282
+ if [[ -z " $__UbuntuRepo " ]]; then
283
+ __UbuntuRepo=" http://ftp.debian.org/debian/"
284
+ fi
282
285
;;
283
286
tizen)
284
287
__CodeName=
@@ -296,29 +299,8 @@ while :; do
296
299
parts=(${version// ./ } )
297
300
__AlpineMajorVersion=" ${parts[0]} "
298
301
__AlpineMinoVersion=" ${parts[1]} "
299
-
300
- if [[ -z " $__AlpineVersion " ]]; then
301
- __AlpineVersion=" $__AlpineMajorVersion .$__AlpineMinoVersion "
302
- fi
302
+ __AlpineVersion=" $__AlpineMajorVersion .$__AlpineMinoVersion "
303
303
fi
304
-
305
- case " $__AlpineVersion " in
306
- 3.14) __AlpinePackages+=" llvm11-libs" ;;
307
- 3.15) __AlpinePackages+=" llvm12-libs" ;;
308
- 3.16) __AlpinePackages+=" llvm13-libs" ;;
309
- 3.17) __AlpinePackages+=" llvm15-libs" ;;
310
- edge) __AlpineLlvmLibsLookup=1 ;;
311
- * )
312
- if [[ " $__AlpineArch " =~ " s390x|ppc64le" ]]; then
313
- __AlpineVersion=3.15 # minimum version that supports compiler-rt
314
- __AlpinePackages+=" llvm12-libs"
315
- elif [[ " $__AlpineArch " == " riscv64" ]]; then
316
- __AlpineLlvmLibsLookup=1
317
- __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive)
318
- else
319
- __AlpineVersion=3.13 # 3.13 to maximize compatibility
320
- fi
321
- esac
322
304
;;
323
305
freebsd12)
324
306
__CodeName=freebsd
@@ -361,10 +343,41 @@ while :; do
361
343
shift
362
344
done
363
345
346
+ case " $__AlpineVersion " in
347
+ 3.14) __AlpinePackages+=" llvm11-libs" ;;
348
+ 3.15) __AlpinePackages+=" llvm12-libs" ;;
349
+ 3.16) __AlpinePackages+=" llvm13-libs" ;;
350
+ 3.17) __AlpinePackages+=" llvm15-libs" ;;
351
+ edge) __AlpineLlvmLibsLookup=1 ;;
352
+ * )
353
+ if [[ " $__AlpineArch " =~ s390x| ppc64le ]]; then
354
+ echo boo
355
+ __AlpineVersion=3.15 # minimum version that supports lldb-dev
356
+ __AlpinePackages+=" llvm12-libs"
357
+ elif [[ " $__AlpineArch " == " x86" ]]; then
358
+ __AlpineVersion=3.17 # minimum version that supports lldb-dev
359
+ __AlpinePackages+=" llvm15-libs"
360
+ elif [[ " $__AlpineArch " == " riscv64" ]]; then
361
+ __AlpineLlvmLibsLookup=1
362
+ __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive)
363
+ else
364
+ __AlpineVersion=3.13 # 3.13 to maximize compatibility
365
+ __AlpinePackages+=" llvm10-libs"
366
+
367
+ if [[ " $__AlpineArch " == " armv7" ]]; then
368
+ __AlpinePackages=" ${__AlpinePackages// numactl-dev/ } "
369
+ fi
370
+ fi
371
+ esac
372
+
373
+ if [[ " $__AlpineVersion " =~ 3\. 1[345] ]]; then
374
+ # compiler-rt--static was merged in compiler-rt package in alpine 3.16
375
+ # for older versions, we need compiler-rt--static, so replace the name
376
+ __AlpinePackages=" ${__AlpinePackages/ compiler-rt/ compiler-rt-static} "
377
+ fi
378
+
364
379
if [[ " $__BuildArch " == " armel" ]]; then
365
380
__LLDB_Package=" lldb-3.5-dev"
366
- elif [[ " $__BuildArch " == " arm" && " $__AlpineVersion " == " 3.13" ]]; then
367
- __AlpinePackages=" ${__AlpinePackages// numactl-dev/ } "
368
381
fi
369
382
370
383
__UbuntuPackages+=" ${__LLDB_Package:- } "
@@ -407,26 +420,27 @@ if [[ "$__CodeName" == "alpine" ]]; then
407
420
version=" v$__AlpineVersion "
408
421
fi
409
422
423
+ # initialize DB
410
424
" $__ApkToolsDir /apk.static" \
411
425
-X " http://dl-cdn.alpinelinux.org/alpine/$version /main" \
412
426
-X " http://dl-cdn.alpinelinux.org/alpine/$version /community" \
413
- -U --allow-untrusted --root " $__RootfsDir " --arch " $__AlpineArch " --initdb \
414
- add $__AlpinePackages
427
+ -U --allow-untrusted --root " $__RootfsDir " --arch " $__AlpineArch " --initdb add
415
428
416
429
if [[ " $__AlpineLlvmLibsLookup " == 1 ]]; then
417
- " $__ApkToolsDir /apk.static" \
430
+ __AlpinePackages+= " $( " $__ApkToolsDir /apk.static" \
418
431
-X " http://dl-cdn.alpinelinux.org/alpine/$version /main" \
419
432
-X " http://dl-cdn.alpinelinux.org/alpine/$version /community" \
420
433
-U --allow-untrusted --root " $__RootfsDir " --arch " $__AlpineArch " \
421
- search ' llvm*-libs' | sort | tail -1 | while IFS=- read name rest; do
422
- " $__ApkToolsDir /apk.static" \
423
- -X " http://dl-cdn.alpinelinux.org/alpine/$version /main" \
424
- -X " http://dl-cdn.alpinelinux.org/alpine/$version /community" \
425
- -U --allow-untrusted --root " $__RootfsDir " --arch " $__AlpineArch " \
426
- add " $name -libs"
427
- done
434
+ search ' llvm*-libs' | sort | tail -1 | sed ' s/-[^-]*//2g' ) "
428
435
fi
429
436
437
+ # install all packages in one go
438
+ " $__ApkToolsDir /apk.static" \
439
+ -X " http://dl-cdn.alpinelinux.org/alpine/$version /main" \
440
+ -X " http://dl-cdn.alpinelinux.org/alpine/$version /community" \
441
+ -U --allow-untrusted --root " $__RootfsDir " --arch " $__AlpineArch " \
442
+ add $__AlpinePackages
443
+
430
444
rm -r " $__ApkToolsDir "
431
445
elif [[ " $__CodeName " == " freebsd" ]]; then
432
446
mkdir -p " $__RootfsDir " /usr/local/etc
0 commit comments