Skip to content

Commit

Permalink
Remove -static-libgcc flag on Linux
Browse files Browse the repository at this point in the history
tttapa committed Dec 11, 2023
1 parent 39f8bec commit 673ae5f
Showing 5 changed files with 13 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/matlab.yml
Original file line number Diff line number Diff line change
@@ -91,10 +91,10 @@ jobs:
static-libcxx=True
[conf]
tools.build.cross_building:can_run=True
tools.build:cxxflags+=["-march=skylake", "-static-libstdc++", "-static-libgcc"]
tools.build:cflags+=["-march=skylake", "-static-libgcc"]
tools.build:sharedlinkflags+=["-static-libstdc++", "-static-libgcc"]
tools.build:exelinkflags+=["-static-libstdc++", "-static-libgcc"]
tools.build:cxxflags+=["-march=skylake", "-static-libstdc++"]
tools.build:cflags+=["-march=skylake"]
tools.build:sharedlinkflags+=["-static-libstdc++"]
tools.build:exelinkflags+=["-static-libstdc++"]
tools.cmake.cmaketoolchain:generator=Ninja
EOF
conan config install ${{ matrix.host }}.profile -tf profiles
4 changes: 2 additions & 2 deletions .github/workflows/wheel-short-test.yml
Original file line number Diff line number Diff line change
@@ -71,8 +71,8 @@ jobs:
-C--cross="$PWD/ninja-${{ matrix.config }}.cross.toml" \
-C--cross="$staging/$host.py-build-cmake.cross.toml"
env:
CFLAGS: "-fstack-protector-all -mshstk -fcf-protection=full -D_FORTIFY_SOURCE=${{ matrix.config != 'Debug' && '3' || '0' }} -fdiagnostics-color -static-libgcc"
CXXFLAGS: "-fstack-protector-all -mshstk -fcf-protection=full -D_FORTIFY_SOURCE=${{ matrix.config != 'Debug' && '3' || '0' }} -fdiagnostics-color -static-libgcc -static-libstdc++"
CFLAGS: "-fstack-protector-all -mshstk -fcf-protection=full -D_FORTIFY_SOURCE=${{ matrix.config != 'Debug' && '3' || '0' }} -fdiagnostics-color"
CXXFLAGS: "-fstack-protector-all -mshstk -fcf-protection=full -D_FORTIFY_SOURCE=${{ matrix.config != 'Debug' && '3' || '0' }} -fdiagnostics-color -static-libstdc++"
# Upload
- name: Upload Wheels
uses: actions/upload-artifact@v3
9 changes: 3 additions & 6 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
@@ -154,8 +154,7 @@ jobs:
-C--cross="$PWD/ninja-debug-release.cross.toml" \
-C--cross="$staging/$host.py-build-cmake.cross.toml"
env:
CFLAGS: '-static-libgcc'
CXXFLAGS: '-static-libgcc -static-libstdc++'
CXXFLAGS: '-static-libstdc++'
- name: Build debug wheels
if: ${{ matrix.host == 'x86_64-centos7-linux-gnu' }}
run: |
@@ -166,8 +165,7 @@ jobs:
-C--cross="$staging/$host.py-build-cmake.cross.toml" \
-o dist-debug
env:
CFLAGS: '-static-libgcc'
CXXFLAGS: '-static-libgcc -static-libstdc++'
CXXFLAGS: '-static-libstdc++'
# Upload
- name: Upload Wheels
uses: actions/upload-artifact@v3
@@ -226,8 +224,7 @@ jobs:
-C--cross="$PWD/ninja-debug.cross.toml" \
-C--cross="$staging/$host.py-build-cmake.cross.toml"
env:
CFLAGS: '-static-libgcc'
CXXFLAGS: '-static-libgcc -static-libstdc++'
CXXFLAGS: '-static-libstdc++'
# Upload
- name: Upload source
uses: actions/upload-artifact@v3
2 changes: 1 addition & 1 deletion interfaces/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ target_include_directories(alpaqa_mex PRIVATE include)
alpaqa_configure_visibility(alpaqa_mex)
if (NOT WIN32 AND NOT APPLE)
# Matlab's C++ standard library is too old, so link it statically
target_link_options(alpaqa_mex PUBLIC -static-libstdc++ -static-libgcc)
target_link_options(alpaqa_mex PUBLIC -static-libstdc++)
endif()
# Get MSVC to report the correct value for __cplusplus
if (MSVC)
6 changes: 3 additions & 3 deletions scripts/dev/install-locally.sh
Original file line number Diff line number Diff line change
@@ -76,16 +76,16 @@ EOF
pip install -U pip build
develop=false
if $develop; then
LDFLAGS='-static-libgcc -static-libstdc++' \
LDFLAGS='-static-libstdc++' \
pip install -e ".[test]" -v \
--config-settings=--cross="$pfx/$triple.py-build-cmake.cross.toml" \
--config-settings=--local="$PWD/$config"
else
LDFLAGS='-static-libgcc -static-libstdc++' \
LDFLAGS='-static-libstdc++' \
python -m build -w "." -o staging \
-C--cross="$pfx/$triple.py-build-cmake.cross.toml" \
-C--local="$PWD/$config"
LDFLAGS='-static-libgcc -static-libstdc++' \
LDFLAGS='-static-libstdc++' \
python -m build -w "python/alpaqa-debug" -o staging \
-C--cross="$pfx/$triple.py-build-cmake.cross.toml" \
-C--local="$PWD/$config"

0 comments on commit 673ae5f

Please sign in to comment.