Skip to content

Commit

Permalink
build: fix host_arch_cc() for AIX/IBM i
Browse files Browse the repository at this point in the history
The AIX/IBM i branch in `host_arch_cc()` that hardcodes the compiler
executable to `gcc` precludes picking up either `CC_host` or `CC`
environment variables (if set) as is done on other platforms. On an
AIX/IBM i platform where the compiler is, e.g. `gcc-10` instead of
just `gcc`, the current check will fail to detect the host architecture
and incorrectly default to `ia32`. Removing the AIX/IBM i specific
branch will follow the same logic as on the other platforms:
1. The value, if set, of the `CC_host` environment variable.
2. Otherwise, if set, the value of the `CC` environment variable.
3. `gcc` (`cc` if on macOS).

PR-URL: #39481
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
richardlau authored and BethGriggs committed Jul 29, 2021
1 parent 039f64f commit e1910ef
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,12 +1050,7 @@ def is_arm_hard_float_abi():
def host_arch_cc():
"""Host architecture check using the CC command."""

if sys.platform.startswith('aix'):
# we only support gcc at this point and the default on AIX
# would be xlc so hard code gcc
k = cc_macros('gcc')
else:
k = cc_macros(os.environ.get('CC_host'))
k = cc_macros(os.environ.get('CC_host'))

matchup = {
'__aarch64__' : 'arm64',
Expand Down

0 comments on commit e1910ef

Please sign in to comment.