From d2385bd0e569562c83771386010396ee2d6fb90b Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 20 Aug 2026 16:12:22 +0000 Subject: [PATCH] build: target Power 9 and z14 Set compiler flags to match the minimum supported Power and z architectures. Signed-off-by: Richard Lau --- common.gypi | 16 ++++++++-------- node.gypi | 6 ++++++ tools/v8_gypfiles/toolchain.gypi | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/common.gypi b/common.gypi index 0b01ec8c49fe..a83523286a91 100644 --- a/common.gypi +++ b/common.gypi @@ -604,12 +604,12 @@ 'cflags': [ '-mminimal-toc' ], }], ], - 'cflags': [ '-m64' ], - 'ldflags': [ '-m64' ], + 'cflags': [ '-m64', '-mcpu=power9' ], + 'ldflags': [ '-m64', '-mcpu=power9' ], }], [ 'host_arch=="s390x" and OS=="linux"', { - 'cflags': [ '-m64', '-march=z196' ], - 'ldflags': [ '-m64', '-march=z196' ], + 'cflags': [ '-m64', '-march=z14' ], + 'ldflags': [ '-m64', '-march=z14' ], }], ], }], @@ -629,12 +629,12 @@ 'cflags': [ '-mminimal-toc' ], }], ], - 'cflags': [ '-m64' ], - 'ldflags': [ '-m64' ], + 'cflags': [ '-m64', '-mcpu=power9' ], + 'ldflags': [ '-m64', '-mcpu=power9' ], }], [ 'target_arch=="s390x" and OS=="linux"', { - 'cflags': [ '-m64', '-march=z196' ], - 'ldflags': [ '-m64', '-march=z196' ], + 'cflags': [ '-m64', '-march=z14' ], + 'ldflags': [ '-m64', '-march=z14' ], }], ], }], diff --git a/node.gypi b/node.gypi index 3636633c622a..104e884e6614 100644 --- a/node.gypi +++ b/node.gypi @@ -87,6 +87,12 @@ [ 'OS=="aix" or OS=="os400"', { 'cflags': [ '-mcpu=power9' ], }], + [ 'OS=="linux" and target_arch=="ppc64"', { + 'cflags': [ '-mcpu=power9' ], + }], + [ 'OS=="linux" and target_arch=="s390x"', { + 'cflags': [ '-march=z14' ], + }], [ 'node_enable_d8=="true"', { 'dependencies': [ 'tools/v8_gypfiles/d8.gyp:d8' ], }], diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index 5aa9d020a920..3676848df8a4 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -316,7 +316,7 @@ 'V8_TARGET_ARCH_S390_LE_SIM', ], }, { - 'cflags': [ '-march=z196' ], + 'cflags': [ '-march=z14' ], }], ], }], # s390x @@ -326,11 +326,11 @@ ], 'cflags': [ '-ffp-contract=off', + '-mcpu=power9', ], 'conditions': [ ['OS=="aix" or OS=="os400"', { # Work around AIX ceil, trunc and round oddities. - 'cflags': [ '-mcpu=power9' ], 'conditions': [ ['clang==0', { 'cflags': [ '-mfprnd' ],