@@ -76,20 +76,18 @@ jobs:
7676 # https://github.com/ldc-developers/ldc/issues/4462:
7777 # When using LTO, we need to explicitly export ~all symbols for plugin support via `ld64 -exported_symbol '__*'`.
7878 # Additionally `-w` to suppress resulting linker warnings.
79- #
80- # We also need to work around issues with the used LDC v1.35.0 host/bootstrap compiler:
81- # * Specify a macOS triple with OS version. And exclude LTO-able host druntime/Phobos because precompiled without OS version.
82- # * Manually specify the path to the bundled libLTO.dylib (broken for *universal* packages for LDC <= v1.40.0).
8379 extra_cmake_flags : >-
84- -DD_COMPILER_FLAGS="-O -flto=full -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-x86_64/libLTO.dylib -mtriple=x86_64-apple-macos$MACOSX_DEPLOYMENT_TARGET "
80+ -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto - L-exported_symbol '-L__*' -L-w"
8581 -DEXTRA_CXXFLAGS=-flto=full
8682 with_pgo : true
8783
8884 - job_name : macOS arm64
8985 os : macos-14
9086 arch : arm64
9187 extra_cmake_flags : >-
92- -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w -flto-binary=$PWD/../bootstrap-ldc/lib-arm64/libLTO.dylib"
88+ -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang
89+ -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang++
90+ -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w"
9391 -DEXTRA_CXXFLAGS=-flto=full
9492 with_pgo : true
9593
@@ -161,25 +159,14 @@ jobs:
161159 uses : ./.github/actions/helper-build-gdb
162160 with :
163161 arch : ${{ matrix.arch }}
162+ - name : ' macOS arm64: Switch to Xcode 16'
163+ if : runner.os == 'macOS' && matrix.arch == 'arm64'
164+ run : sudo xcode-select -switch /Applications/Xcode_16.1.app
164165 - name : Build bootstrap LDC
165- if : runner.os != 'macOS'
166166 uses : ./.github/actions/2-build-bootstrap
167167 with :
168168 cmake_flags : -DBUILD_LTO_LIBS=ON ${{ matrix.base_cmake_flags }}
169169 arch : ${{ matrix.arch }}
170- # FIXME: on macOS, mixing newer LLVM from bootstrap LDC with older LLVM from Xcode clang is problematic,
171- # leading to sporadic 'libc++abi: Pure virtual function called!' compiler crashes etc.
172- - name : ' macOS: Use host LDC (with Xcode-compatible LLVM version) as bootstrap LDC'
173- if : runner.os == 'macOS'
174- run : |
175- ln -s $(dirname $(dirname $(which ldmd2))) ../bootstrap-ldc
176- if [[ '${{ matrix.arch }}' == 'x86_64' ]]; then
177- # work around a v1.35.0 bug - need to rename libLTO-ldc.dylib to make it loadable
178- mv ../bootstrap-ldc/lib-x86_64/libLTO-ldc.dylib ../bootstrap-ldc/lib-x86_64/libLTO.dylib
179- else
180- # use Xcode v16 on arm64
181- sudo xcode-select -switch /Applications/Xcode_16.1.app
182- fi
183170 - name : Build LDC with PGO instrumentation & gather profile from compiling default libs
184171 if : matrix.with_pgo
185172 uses : ./.github/actions/2a-build-pgo
0 commit comments