Skip to content

Commit 48a442b

Browse files
abmusserichardlau
authored andcommitted
build: aix add conditonal flags for clang builds
Some gcc flags dont work on clang: -mfprnd -mno-popcntb -fno-extern-tls-init So now we conditionally add them when clang is not enabled Also for clang builds we need to pass some additonal flags: -fno-integrated-as -fno-xl-pragma-pack These flags are discuessed in: https://chromium-review.googlesource.com/c/chromium/src/+/7120638 PR-URL: #62656 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 730fa6a commit 48a442b

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

common.gypi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,18 @@
591591
'-maix64',
592592
],
593593
'conditions': [
594+
[ 'clang==1', {
595+
'cflags': [
596+
'-fno-integrated-as',
597+
'-fno-xl-pragma-pack',
598+
'-mcpu=power9',
599+
],
600+
'cflags_cc': [
601+
'-fno-integrated-as',
602+
'-fno-xl-pragma-pack',
603+
'-mcpu=power9',
604+
],
605+
}],
594606
[ '"<(aix_variant_name)"=="OS400"', { # a.k.a. `IBM i`
595607
'ldflags': [
596608
'-Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib',

tools/v8_gypfiles/toolchain.gypi

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,20 @@
330330
'conditions': [
331331
['OS=="aix" or OS=="os400"', {
332332
# Work around AIX ceil, trunc and round oddities.
333-
'cflags': [ '-mcpu=power9 -mfprnd' ],
333+
'cflags': [ '-mcpu=power9' ],
334+
'conditions': [
335+
['clang==0', {
336+
'cflags': [ '-mfprnd' ],
337+
}],
338+
],
334339
}],
335340
['OS=="aix" or OS=="os400"', {
336-
# Work around AIX assembler popcntb bug.
337-
'cflags': [ '-mno-popcntb' ],
341+
'conditions': [
342+
['clang==0', {
343+
# Work around AIX assembler popcntb bug.
344+
'cflags': [ '-mno-popcntb' ],
345+
}],
346+
],
338347
}],
339348
],
340349
}], # ppc64
@@ -593,8 +602,13 @@
593602
'_ALL_SOURCE=1'],
594603
'conditions': [
595604
[ 'v8_target_arch=="ppc64"', {
596-
'cflags': [ '-maix64', '-fdollars-in-identifiers', '-fno-extern-tls-init' ],
605+
'cflags': [ '-maix64', '-fdollars-in-identifiers' ],
597606
'ldflags': [ '-maix64 -Wl,-bbigtoc' ],
607+
'conditions': [
608+
['clang==0', {
609+
'cflags': [ '-fno-extern-tls-init' ],
610+
}],
611+
],
598612
}],
599613
],
600614
}],

0 commit comments

Comments
 (0)