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

+3
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

+6-6
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

+7-2
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

+1-1
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

+1-1
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

+15
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

+6-6
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

+3-3
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

+1-1
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

+1-1
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
},

test/addons/openssl-binding/binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'conditions': [
77
['node_use_openssl=="true"', {
88
'conditions': [
9-
['OS=="aix"', {
9+
['OS in "aix os400"', {
1010
'variables': {
1111
# Used to differentiate `AIX` and `OS400`(IBM i).
1212
'aix_variant_name': '<!(uname -s)',

test/addons/openssl-providers/binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'conditions': [
77
['node_use_openssl=="true"', {
88
'conditions': [
9-
['OS=="aix"', {
9+
['OS in "aix os400"', {
1010
'variables': {
1111
# Used to differentiate `AIX` and `OS400`(IBM i).
1212
'aix_variant_name': '<!(uname -s)',

test/addons/zlib-binding/binding.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
'target_name': 'binding',
55
'conditions': [
6-
['OS=="aix"', {
6+
['OS in "aix os400"', {
77
'variables': {
88
# Used to differentiate `AIX` and `OS400`(IBM i).
99
'aix_variant_name': '<!(uname -s)',

tools/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def wanted_zoslib_headers(files_arg, dest):
279279
], 'include/node/')
280280

281281
# Add the expfile that is created on AIX
282-
if sys.platform.startswith('aix'):
282+
if sys.platform.startswith('aix') or sys.platform == "os400":
283283
action(['out/Release/node.exp'], 'include/node/')
284284

285285
subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)

tools/v8_gypfiles/d8.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}],
4848
['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \
4949
or OS=="openbsd" or OS=="solaris" or OS=="android" \
50-
or OS=="qnx" or OS=="aix")', {
50+
or OS=="qnx" or OS=="aix" or OS=="os400")', {
5151
'sources': [ '<(V8_ROOT)/src/d8/d8-posix.cc', ]
5252
}],
5353
[ 'OS=="win"', {

tools/v8_gypfiles/toolchain.gypi

+8-8
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@
330330
'V8_TARGET_ARCH_PPC_BE',
331331
],
332332
'conditions': [
333-
['OS=="aix"', {
333+
['OS=="aix" or OS=="os400"', {
334334
# Work around AIX ceil, trunc and round oddities.
335335
'cflags': [ '-mcpu=power5+ -mfprnd' ],
336336
}],
337-
['OS=="aix"', {
337+
['OS=="aix" or OS=="os400"', {
338338
# Work around AIX assembler popcntb bug.
339339
'cflags': [ '-mno-popcntb' ],
340340
}],
@@ -1098,7 +1098,7 @@
10981098
],
10991099
}],
11001100
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
1101-
or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
1101+
or OS=="netbsd" or OS=="qnx" or OS=="aix" or OS=="os400"', {
11021102
'conditions': [
11031103
[ 'v8_no_strict_aliasing==1', {
11041104
'cflags': [ '-fno-strict-aliasing' ],
@@ -1114,7 +1114,7 @@
11141114
['OS=="netbsd"', {
11151115
'cflags': [ '-I/usr/pkg/include' ],
11161116
}],
1117-
['OS=="aix"', {
1117+
['OS=="aix" or OS=="os400"', {
11181118
'defines': [
11191119
# Support for malloc(0)
11201120
'_LINUX_SOURCE_COMPAT=1',
@@ -1147,7 +1147,7 @@
11471147
# Support for backtrace_symbols.
11481148
'ldflags': [ '-rdynamic' ],
11491149
}],
1150-
['OS=="aix"', {
1150+
['OS=="aix" or OS=="os400"', {
11511151
'ldflags': [ '-Wl,-bbigtoc' ],
11521152
'conditions': [
11531153
['v8_target_arch=="ppc64"', {
@@ -1191,7 +1191,7 @@
11911191
},
11921192
'conditions': [
11931193
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1194-
OS=="qnx" or OS=="aix"', {
1194+
OS=="qnx" or OS=="aix" or OS=="os400"', {
11951195
'cflags!': [
11961196
'-O3',
11971197
'-O2',
@@ -1242,7 +1242,7 @@
12421242
},
12431243
'conditions': [
12441244
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1245-
OS=="qnx" or OS=="aix"', {
1245+
OS=="qnx" or OS=="aix" or OS=="os400"', {
12461246
'cflags!': [
12471247
'-O0',
12481248
'-O1',
@@ -1292,7 +1292,7 @@
12921292
'defines!': ['ENABLE_HANDLE_ZAPPING',],
12931293
'conditions': [
12941294
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
1295-
or OS=="aix"', {
1295+
or OS=="aix" or OS=="os400"', {
12961296
'cflags!': [
12971297
'-Os',
12981298
],

tools/v8_gypfiles/v8.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@
10681068
'<(V8_ROOT)/src/base/platform/platform-posix.h',
10691069
],
10701070
'conditions': [
1071-
['OS != "aix" and OS != "solaris"', {
1071+
['OS != "aix" and OS != "os400" and OS != "solaris"', {
10721072
'sources': [
10731073
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
10741074
'<(V8_ROOT)/src/base/platform/platform-posix-time.h',
@@ -1088,7 +1088,7 @@
10881088
],
10891089
},
10901090
}],
1091-
['OS=="aix"', {
1091+
['OS in "aix os400"', {
10921092
'variables': {
10931093
# Used to differentiate `AIX` and `OS400`(IBM i).
10941094
'aix_variant_name': '<!(uname -s)',

0 commit comments

Comments
 (0)