Skip to content

Commit 719f156

Browse files
richardlautargos
authored andcommitted
build: fix host_arch_cc() for AIX/IBM i
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 <[email protected]> Reviewed-By: Ash Cripps <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 5696bcf commit 719f156

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

configure.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,12 +964,7 @@ def is_arm_hard_float_abi():
964964
def host_arch_cc():
965965
"""Host architecture check using the CC command."""
966966

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

974969
matchup = {
975970
'__aarch64__' : 'arm64',

0 commit comments

Comments
 (0)