Skip to content

Commit d4899b2

Browse files
dmabupttargos
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 83b529f commit d4899b2

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')
@@ -1302,7 +1302,7 @@ def configure_node(o):
13021302
elif sys.platform == 'zos':
13031303
configure_zos(o)
13041304

1305-
if flavor == 'aix':
1305+
if flavor in ('aix', 'os400'):
13061306
o['variables']['node_target_type'] = 'static_library'
13071307

13081308
if target_arch in ('x86', 'x64', 'ia32', 'x32'):
@@ -1403,6 +1403,8 @@ def configure_node(o):
14031403
shlib_suffix = '%s.dylib'
14041404
elif sys.platform.startswith('aix'):
14051405
shlib_suffix = '%s.a'
1406+
elif sys.platform == 'os400':
1407+
shlib_suffix = '%s.a'
14061408
elif sys.platform.startswith('zos'):
14071409
shlib_suffix = '%s.x'
14081410
else:
@@ -1916,6 +1918,9 @@ def icu_download(path):
19161918
elif flavor == 'mac':
19171919
icu_config['variables']['icu_asm_ext'] = 'S'
19181920
icu_config['variables']['icu_asm_opts'] = [ '-a', 'gcc-darwin' ]
1921+
elif sys.platform == 'os400':
1922+
icu_config['variables']['icu_asm_ext'] = 'S'
1923+
icu_config['variables']['icu_asm_opts'] = [ '-a', 'xlc' ]
19191924
elif sys.platform.startswith('aix'):
19201925
icu_config['variables']['icu_asm_ext'] = 'S'
19211926
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
@@ -61,7 +61,7 @@
6161
[ 'node_shared=="true"', {
6262
'node_target_type%': 'shared_library',
6363
'conditions': [
64-
['OS=="aix"', {
64+
['OS in "aix os400"', {
6565
# For AIX, always generate static library first,
6666
# It needs an extra step to generate exp and
6767
# then use both static lib and exp to create
@@ -110,7 +110,7 @@
110110
},
111111

112112
'conditions': [
113-
['OS=="aix"', {
113+
['OS in "aix os400"', {
114114
'ldflags': [
115115
'-Wl,-bnoerrmsg',
116116
],
@@ -192,7 +192,7 @@
192192
},
193193
}],
194194
[ 'node_intermediate_lib_type=="static_library" and '
195-
'node_shared=="true" and OS=="aix"', {
195+
'node_shared=="true" and OS in "aix os400"', {
196196
# For AIX, shared lib is linked by static lib and .exp. In the
197197
# case here, the executable needs to link to shared lib.
198198
# Therefore, use 'node_aix_shared' target to generate the
@@ -227,7 +227,7 @@
227227
},
228228
},
229229
'conditions': [
230-
['OS != "aix" and OS != "mac" and OS != "ios"', {
230+
['OS != "aix" and OS != "os400" and OS != "mac" and OS != "ios"', {
231231
'ldflags': [
232232
'-Wl,--whole-archive',
233233
'<(obj_dir)/<(STATIC_LIB_PREFIX)<(node_core_target_name)<(STATIC_LIB_SUFFIX)',
@@ -741,7 +741,7 @@
741741
'NODE_USE_NODE_CODE_CACHE=1',
742742
],
743743
}],
744-
['node_shared=="true" and OS=="aix"', {
744+
['node_shared=="true" and OS in "aix os400"', {
745745
'product_name': 'node_base',
746746
}],
747747
[ 'v8_enable_inspector==1', {
@@ -1170,7 +1170,7 @@
11701170
], # end targets
11711171

11721172
'conditions': [
1173-
['OS=="aix" and node_shared=="true"', {
1173+
['OS in "aix os400" and node_shared=="true"', {
11741174
'targets': [
11751175
{
11761176
'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
@@ -274,7 +274,7 @@ def wanted_zoslib_headers(files_arg, dest):
274274
], 'include/node/')
275275

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

280280
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
}],
@@ -651,7 +651,7 @@
651651
],
652652
}],
653653
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
654-
or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
654+
or OS=="netbsd" or OS=="qnx" or OS=="aix" or OS=="os400"', {
655655
'conditions': [
656656
[ 'v8_no_strict_aliasing==1', {
657657
'cflags': [ '-fno-strict-aliasing' ],
@@ -667,7 +667,7 @@
667667
['OS=="netbsd"', {
668668
'cflags': [ '-I/usr/pkg/include' ],
669669
}],
670-
['OS=="aix"', {
670+
['OS=="aix" or OS=="os400"', {
671671
'defines': [
672672
# Support for malloc(0)
673673
'_LINUX_SOURCE_COMPAT=1',
@@ -700,7 +700,7 @@
700700
# Support for backtrace_symbols.
701701
'ldflags': [ '-rdynamic' ],
702702
}],
703-
['OS=="aix"', {
703+
['OS=="aix" or OS=="os400"', {
704704
'ldflags': [ '-Wl,-bbigtoc' ],
705705
'conditions': [
706706
['v8_target_arch=="ppc64"', {
@@ -744,7 +744,7 @@
744744
},
745745
'conditions': [
746746
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
747-
OS=="qnx" or OS=="aix"', {
747+
OS=="qnx" or OS=="aix" or OS=="os400"', {
748748
'cflags!': [
749749
'-O3',
750750
'-O2',
@@ -795,7 +795,7 @@
795795
},
796796
'conditions': [
797797
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
798-
OS=="qnx" or OS=="aix"', {
798+
OS=="qnx" or OS=="aix" or OS=="os400"', {
799799
'cflags!': [
800800
'-O0',
801801
'-O1',
@@ -845,7 +845,7 @@
845845
'defines!': ['ENABLE_HANDLE_ZAPPING',],
846846
'conditions': [
847847
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
848-
or OS=="aix"', {
848+
or OS=="aix" or OS=="os400"', {
849849
'cflags!': [
850850
'-Os',
851851
],

tools/v8_gypfiles/v8.gyp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@
10641064
'<(V8_ROOT)/src/base/platform/platform-posix.h',
10651065
],
10661066
'conditions': [
1067-
['OS != "aix" and OS != "solaris"', {
1067+
['OS != "aix" and OS != "os400" and OS != "solaris"', {
10681068
'sources': [
10691069
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
10701070
'<(V8_ROOT)/src/base/platform/platform-posix-time.h',
@@ -1084,7 +1084,7 @@
10841084
],
10851085
},
10861086
}],
1087-
['OS=="aix"', {
1087+
['OS in "aix os400"', {
10881088
'variables': {
10891089
# Used to differentiate `AIX` and `OS400`(IBM i).
10901090
'aix_variant_name': '<!(uname -s)',

0 commit comments

Comments
 (0)