Skip to content

macOS universal package: Fix automatic bundled libLTO.dylib usage #4857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/merge-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ runs:
lipo -create -output $exe ../ldc2-x86_64/$exe ../ldc2-arm64/$exe
done

# merge LTO plugins to universal one (and keep in hardcoded lib/)
mkdir lib
lipo -create -output lib/libLTO.dylib lib-x86_64/libLTO.dylib lib-arm64/libLTO.dylib
rm lib-{x86_64,arm64}/libLTO.dylib

# ldc2.conf: replace the default section and add extra sections
# note: x86_64-apple-ios section already exists
sections="
Expand Down Expand Up @@ -92,6 +97,7 @@ runs:
for triple in x86_64-apple-macos11.0 arm64-apple-macos11.0 x86_64-apple-ios12.0-simulator arm64-apple-ios12.0; do
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d -link-defaultlib-shared
ldc2-universal/bin/ldc2 -mtriple="$triple" hello.d -O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
done

- name: Pack universal package
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via `-mtriple=aarch64-windows-msvc`, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by running `vsdevcmd.bat -arch=arm64 -host_arch=x64`). There's no bundled libcurl either yet. (#4835, #4846)

#### Bug fixes
- Prebuilt macOS universal package: Fix automatic bundled `libLTO.dylib` usage when linking with LTO. (#4857)
- Building multi-file D applications with control-flow protection will no longer cause LDC to throw an internal compiler error. (#4828)

# LDC 1.40.0 (2024-12-15)
Expand Down
Loading