Skip to content

Commit a1bf43e

Browse files
committed
macOS universal package: Fix automatic bundled libLTO.dylib usage
1 parent 29230c3 commit a1bf43e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/actions/merge-macos/action.yml

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ runs:
3333
lipo -create -output $exe ../ldc2-x86_64/$exe ../ldc2-arm64/$exe
3434
done
3535
36+
# merge LTO plugins to universal one (and keep in hardcoded lib/)
37+
mkdir lib
38+
lipo -create -output lib/libLTO.dylib lib-x86_64/libLTO.dylib lib-arm64/libLTO.dylib
39+
rm lib-{x86_64,arm64}/libLTO.dylib
40+
3641
# ldc2.conf: replace the default section and add extra sections
3742
# note: x86_64-apple-ios section already exists
3843
sections="
@@ -92,6 +97,7 @@ runs:
9297
for triple in x86_64-apple-macos11.0 arm64-apple-macos11.0 x86_64-apple-ios12.0-simulator arm64-apple-ios12.0; do
9398
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d
9499
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d -link-defaultlib-shared
100+
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d -O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
95101
done
96102
97103
- name: Pack universal package

0 commit comments

Comments
 (0)