diff --git a/.github/actions/merge-macos/action.yml b/.github/actions/merge-macos/action.yml index 21668749b43..dd0db8b363f 100644 --- a/.github/actions/merge-macos/action.yml +++ b/.github/actions/merge-macos/action.yml @@ -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=" @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c8dcf891a9..2dc6105aa9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)