Skip to content

Commit 4b25b98

Browse files
dmabuptdanielleadams
authored andcommitted
build,test: add proper support for IBM i
Python 3.9 on IBM i now properly returns "os400" for sys.platform instead of claiming to be AIX as it did previously. While the IBM i PASE environment is compatible with AIX, it is a subset and has numerous differences which makes it beneficial to distinguish, however this means that it now needs explicit support here. PR-URL: #46739 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 44375c6 commit 4b25b98

File tree

17 files changed

+59
-36
lines changed

17 files changed

+59
-36
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.mjs doc/api/addons.md
368368
ifeq ($(OSTYPE),aix)
369369
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
370370
endif
371+
ifeq ($(OSTYPE),os400)
372+
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
373+
endif
371374

372375
node_use_openssl = $(call available-node,"-p" \
373376
"process.versions.openssl != undefined")

common.gypi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ],
138138
'cflags': [ '-g', '-O0' ],
139139
'conditions': [
140-
['OS=="aix"', {
140+
['OS in "aix os400"', {
141141
'cflags': [ '-gxcoff' ],
142142
'ldflags': [ '-Wl,-bbigtoc' ],
143143
}],
@@ -393,11 +393,11 @@
393393
'BUILDING_UV_SHARED=1',
394394
],
395395
}],
396-
[ 'OS in "linux freebsd openbsd solaris aix"', {
396+
[ 'OS in "linux freebsd openbsd solaris aix os400"', {
397397
'cflags': [ '-pthread' ],
398398
'ldflags': [ '-pthread' ],
399399
}],
400-
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
400+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
401401
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
402402
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ],
403403
'defines': [ '__STDC_FORMAT_MACROS' ],
@@ -421,11 +421,11 @@
421421
'cflags': [ '-m64' ],
422422
'ldflags': [ '-m64' ],
423423
}],
424-
[ 'target_arch=="ppc" and OS!="aix"', {
424+
[ 'target_arch=="ppc" and OS not in "aix os400"', {
425425
'cflags': [ '-m32' ],
426426
'ldflags': [ '-m32' ],
427427
}],
428-
[ 'target_arch=="ppc64" and OS!="aix"', {
428+
[ 'target_arch=="ppc64" and OS not in "aix os400"', {
429429
'cflags': [ '-m64', '-mminimal-toc' ],
430430
'ldflags': [ '-m64' ],
431431
}],
@@ -444,7 +444,7 @@
444444
}],
445445
],
446446
}],
447-
[ 'OS=="aix"', {
447+
[ 'OS in "aix os400"', {
448448
'variables': {
449449
# Used to differentiate `AIX` and `OS400`(IBM i).
450450
'aix_variant_name': '<!(uname -s)',

configure.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
parser = argparse.ArgumentParser()
4646

4747
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
48-
'android', 'aix', 'cloudabi', 'ios')
48+
'android', 'aix', 'cloudabi', 'os400', 'ios')
4949
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
5050
'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64')
5151
valid_arm_float_abi = ('soft', 'softfp', 'hard')
@@ -1325,7 +1325,7 @@ def configure_node(o):
13251325
elif sys.platform == 'zos':
13261326
configure_zos(o)
13271327

1328-
if flavor == 'aix':
1328+
if flavor in ('aix', 'os400'):
13291329
o['variables']['node_target_type'] = 'static_library'
13301330

13311331
if target_arch in ('x86', 'x64', 'ia32', 'x32'):
@@ -1446,6 +1446,8 @@ def configure_node(o):
14461446
shlib_suffix = '%s.dylib'
14471447
elif sys.platform.startswith('aix'):
14481448
shlib_suffix = '%s.a'
1449+
elif sys.platform == 'os400':
1450+
shlib_suffix = '%s.a'
14491451
elif sys.platform.startswith('zos'):
14501452
shlib_suffix = '%s.x'
14511453
else:
@@ -1959,6 +1961,9 @@ def icu_download(path):
19591961
elif flavor == 'mac':
19601962
icu_config['variables']['icu_asm_ext'] = 'S'
19611963
icu_config['variables']['icu_asm_opts'] = [ '-a', 'gcc-darwin' ]
1964+
elif sys.platform == 'os400':
1965+
icu_config['variables']['icu_asm_ext'] = 'S'
1966+
icu_config['variables']['icu_asm_opts'] = [ '-a', 'xlc' ]
19621967
elif sys.platform.startswith('aix'):
19631968
icu_config['variables']['icu_asm_ext'] = 'S'
19641969
icu_config['variables']['icu_asm_opts'] = [ '-a', 'xlc' ]

deps/cares/cares.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'_GNU_SOURCE'
1010
]
1111
}],
12-
[ 'OS=="aix"', {
12+
[ 'OS in "aix os400"', {
1313
'include_dirs': [ 'config/aix' ],
1414
'sources': [ 'config/aix/ares_config.h' ],
1515
'defines': [

deps/uv/common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
}]
136136
]
137137
}],
138-
['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', {
138+
['OS in "freebsd dragonflybsd linux openbsd solaris android aix os400"', {
139139
'cflags': [ '-Wall' ],
140140
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
141141
'target_conditions': [

deps/uv/uv.gyp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,21 @@
326326
}],
327327
]
328328
}],
329+
[ 'OS=="os400"', {
330+
'sources': [
331+
'src/unix/aix-common.c',
332+
'src/unix/ibmi.c',
333+
'src/unix/posix-poll.c',
334+
'src/unix/no-fsevents.c',
335+
'src/unix/no-proctitle.c',
336+
],
337+
'defines': [
338+
'_ALL_SOURCE',
339+
'_XOPEN_SOURCE=500',
340+
'_LINUX_SOURCE_COMPAT',
341+
'_THREAD_SAFE',
342+
],
343+
}],
329344
[ 'OS=="freebsd" or OS=="dragonflybsd"', {
330345
'sources': [ 'src/unix/freebsd.c' ],
331346
}],

node.gyp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
[ 'node_shared=="true"', {
6464
'node_target_type%': 'shared_library',
6565
'conditions': [
66-
['OS=="aix"', {
66+
['OS in "aix os400"', {
6767
# For AIX, always generate static library first,
6868
# It needs an extra step to generate exp and
6969
# then use both static lib and exp to create
@@ -112,7 +112,7 @@
112112
},
113113

114114
'conditions': [
115-
['OS=="aix"', {
115+
['OS in "aix os400"', {
116116
'ldflags': [
117117
'-Wl,-bnoerrmsg',
118118
],
@@ -193,7 +193,7 @@
193193
},
194194
}],
195195
[ 'node_intermediate_lib_type=="static_library" and '
196-
'node_shared=="true" and OS=="aix"', {
196+
'node_shared=="true" and OS in "aix os400"', {
197197
# For AIX, shared lib is linked by static lib and .exp. In the
198198
# case here, the executable needs to link to shared lib.
199199
# Therefore, use 'node_aix_shared' target to generate the
@@ -228,7 +228,7 @@
228228
},
229229
},
230230
'conditions': [
231-
['OS != "aix" and OS != "mac" and OS != "ios"', {
231+
['OS != "aix" and OS != "os400" and OS != "mac" and OS != "ios"', {
232232
'ldflags': [
233233
'-Wl,--whole-archive',
234234
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
@@ -742,7 +742,7 @@
742742
'NODE_USE_NODE_CODE_CACHE=1',
743743
],
744744
}],
745-
['node_shared=="true" and OS=="aix"', {
745+
['node_shared=="true" and OS in "aix os400"', {
746746
'product_name': 'node_base',
747747
}],
748748
[ 'v8_enable_inspector==1', {
@@ -1432,7 +1432,7 @@
14321432
], # end targets
14331433

14341434
'conditions': [
1435-
['OS=="aix" and node_shared=="true"', {
1435+
['OS in "aix os400" and node_shared=="true"', {
14361436
'targets': [
14371437
{
14381438
'target_name': 'node_aix_shared',

node.gypi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
},
157157
},
158158
'conditions': [
159-
['OS!="aix" and OS!="ios" and node_shared=="false"', {
159+
['OS!="aix" and OS!="os400" and OS!="ios" and node_shared=="false"', {
160160
'ldflags': [
161161
'-Wl,--whole-archive',
162162
'<(obj_dir)/deps/zlib/<(STATIC_LIB_PREFIX)zlib<(STATIC_LIB_SUFFIX)',
@@ -195,7 +195,7 @@
195195
},
196196
},
197197
'conditions': [
198-
['OS!="aix" and OS!="ios" and node_shared=="false"', {
198+
['OS!="aix" and OS!="os400" and OS!="ios" and node_shared=="false"', {
199199
'ldflags': [
200200
'-Wl,--whole-archive',
201201
'<(obj_dir)/deps/uv/<(STATIC_LIB_PREFIX)uv<(STATIC_LIB_SUFFIX)',
@@ -233,7 +233,7 @@
233233
'-lkvm',
234234
],
235235
}],
236-
[ 'OS=="aix"', {
236+
[ 'OS in "aix os400"', {
237237
'defines': [
238238
'_LINUX_SOURCE_COMPAT',
239239
'__STDC_FORMAT_MACROS',

test/addons/common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
'defines': [ 'V8_DEPRECATION_WARNINGS=1' ],
33
'conditions': [
4-
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
4+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
55
'cflags': ['-Wno-cast-function-type'],
66
}],
77
],

test/addons/dlopen-ping-pong/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'OTHER_LDFLAGS': [ '-Wl,-undefined', '-Wl,dynamic_lookup' ]
1212
}}],
1313
# Enable the shared object to be linked by runtime linker
14-
['OS=="aix"', {
14+
['OS in "aix os400"', {
1515
'ldflags': [ '-Wl,-G' ]
1616
}]],
1717
},

0 commit comments

Comments
 (0)