Skip to content

Commit b35c563

Browse files
authored
Update build.yml to fix bin size issue (#57)
Fixed bin size issue on macOS
1 parent c98427d commit b35c563

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
shacmd: 'sha512sum'
6464
- os: macosx
6565
runner: macos-13
66-
os-cmake-args: '-DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -flto" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ${POSIX_CMAKE_ARGS} ${MACOS_CMAKE_ARGS}'
66+
os-cmake-args: '-DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -flto -ffunction-sections -fdata-sections" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-dead_strip" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ${POSIX_CMAKE_ARGS} ${MACOS_CMAKE_ARGS} -DLLVM_TARGETS_TO_BUILD=X86'
6767
build-args: '-j$(sysctl -n hw.ncpu)'
6868
bindir: '/build/bin'
6969
dotexe: ''
@@ -134,7 +134,15 @@ jobs:
134134
- name: Patch cmake implicit link libraries on macOS
135135
if: ${{ matrix.os == 'macosx' }}
136136
shell: bash
137-
run: sed -i.backup 's/gcc_eh.\*|/gcc_eh.*|gcc_ext.*|/g' $(find /usr/local/Cellar -name CMakeParseImplicitLinkInfo.cmake)
137+
run: |
138+
BREW_PREFIX=$(brew --prefix)
139+
FILES=$(find "$BREW_PREFIX" -name CMakeParseImplicitLinkInfo.cmake)
140+
141+
for file in $FILES; do
142+
echo "Patching $file"
143+
sed -i.backup 's/gcc_eh.*|/gcc_eh.*|gcc_ext.*|/g' "$file"
144+
done
145+
138146
- name: Cmake
139147
run: cmake -S ${{ matrix.release }}/llvm -B ${{ matrix.release }}/build ${{ env.COMMON_CMAKE_ARGS }} ${{ matrix.os-cmake-args }} ${{ matrix.extra-cmake-args }}
140148
- name: Build
@@ -192,7 +200,7 @@ jobs:
192200
- os: linux
193201
runner: ubuntu-22.04
194202
- os: macosx
195-
runner: macos-13
203+
runner: macos-13 # Intel macOS runner
196204
- os: windows
197205
runner: windows-latest
198206
runs-on: ${{ matrix.runner }}
@@ -275,6 +283,8 @@ jobs:
275283
uses: svenstaro/upload-release-action@v2
276284
with:
277285
repo_token: ${{ secrets.GITHUB_TOKEN }}
286+
tag: "master-${{ steps.get-sha.outputs.short_sha }}"
287+
release_name: "master-${{ steps.get-sha.outputs.short_sha }}"
278288
draft: true
279289
file_glob: true
280-
file: clang-*/**/*
290+
file: clang-*/**/*

0 commit comments

Comments
 (0)