Skip to content
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

fix version compare error when gcc version >= 10 #1016

Merged
merged 5 commits into from
Aug 25, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["2.7", "3.6", "3.9", "3.10"]
python-version: ["3.6", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 7 additions & 1 deletion src/blade/cc_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
import os
from string import Template

try:
from packaging.version import parse as version_parse
except ImportError:
from distutils.version import LooseVersion as version_parse


from blade import build_manager
from blade import build_rules
from blade import config
Expand Down Expand Up @@ -1321,7 +1327,7 @@ def _get_rpath_links(self):
def _generate_cc_binary_link_flags(self, dynamic_link):
linkflags = []
toolchain = self.blade.get_build_toolchain()
if not dynamic_link and toolchain.cc_is('gcc') and toolchain.get_cc_version() > '4.5':
if not dynamic_link and toolchain.cc_is('gcc') and version_parse(toolchain.get_cc_version()) > version_parse('4.5'):
linkflags += ['-static-libgcc', '-static-libstdc++']
if self.attr.get('export_dynamic'):
linkflags.append('-rdynamic')
Expand Down
Loading