From c6ab4d58a0dae0d8187fa475d00cc99a7d148e1b Mon Sep 17 00:00:00 2001 From: mengxumx Date: Mon, 11 Apr 2022 11:32:21 +0800 Subject: [PATCH 1/2] 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. --- Makefile | 3 ++ common.gypi | 60 +++++++++++------------- configure.py | 9 +++- node.gyp | 12 ++--- node.gypi | 6 +-- test/addons/common.gypi | 2 +- test/addons/dlopen-ping-pong/binding.gyp | 2 +- test/addons/openssl-binding/binding.gyp | 2 +- test/addons/zlib-binding/binding.gyp | 2 +- tools/install.py | 2 +- tools/v8_gypfiles/d8.gyp | 2 +- tools/v8_gypfiles/toolchain.gypi | 16 +++---- tools/v8_gypfiles/v8.gyp | 8 +++- 13 files changed, 67 insertions(+), 59 deletions(-) diff --git a/Makefile b/Makefile index 4aace77c7c8c63..8dba4eb1ab6c7a 100644 --- a/Makefile +++ b/Makefile @@ -345,6 +345,9 @@ DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.mjs doc/api/addons.md ifeq ($(OSTYPE),aix) DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp endif +ifeq ($(OSTYPE),os400) +DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp +endif node_use_openssl = $(call available-node,"-p" \ "process.versions.openssl != undefined") diff --git a/common.gypi b/common.gypi index f4cec334c19a5f..8c605105888738 100644 --- a/common.gypi +++ b/common.gypi @@ -137,7 +137,7 @@ 'defines': [ 'DEBUG', '_DEBUG', 'V8_ENABLE_CHECKS' ], 'cflags': [ '-g', '-O0' ], 'conditions': [ - ['OS=="aix"', { + ['OS=="aix" or OS=="os400"', { 'cflags': [ '-gxcoff' ], 'ldflags': [ '-Wl,-bbigtoc' ], }], @@ -394,11 +394,11 @@ 'BUILDING_UV_SHARED=1', ], }], - [ 'OS in "linux freebsd openbsd solaris aix"', { + [ 'OS in "linux freebsd openbsd solaris aix os400"', { 'cflags': [ '-pthread' ], 'ldflags': [ '-pthread' ], }], - [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', { + [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ], 'defines': [ '__STDC_FORMAT_MACROS' ], @@ -422,11 +422,11 @@ 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }], - [ 'target_arch=="ppc" and OS!="aix"', { + [ 'target_arch=="ppc" and OS not in "aix os400"', { 'cflags': [ '-m32' ], 'ldflags': [ '-m32' ], }], - [ 'target_arch=="ppc64" and OS!="aix"', { + [ 'target_arch=="ppc64" and OS not in "aix os400"', { 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], }], @@ -445,39 +445,33 @@ }], ], }], + [ 'OS=="os400"', { + 'ldflags!': [ '-rdynamic', ], + 'ldflags': [ + '-Wl,-bbigtoc', + '-Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib', + ], + }], [ 'OS=="aix"', { - 'variables': { - # Used to differentiate `AIX` and `OS400`(IBM i). - 'aix_variant_name': ' Date: Mon, 11 Apr 2022 14:05:35 +0800 Subject: [PATCH 2/2] build: add libuv patches --- deps/uv/common.gypi | 2 +- deps/uv/uv.gyp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/deps/uv/common.gypi b/deps/uv/common.gypi index 8e2aa7160bb0a0..cc9c98e762c284 100644 --- a/deps/uv/common.gypi +++ b/deps/uv/common.gypi @@ -135,7 +135,7 @@ }] ] }], - ['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', { + ['OS in "freebsd dragonflybsd linux openbsd solaris android aix os400"', { 'cflags': [ '-Wall' ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], 'target_conditions': [ diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 093f611fb6f6d8..cdb6af7ca0e65b 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -324,6 +324,21 @@ }], ] }], + [ 'OS=="os400"', { + 'sources': [ + 'src/unix/aix-common.c', + 'src/unix/ibmi.c', + 'src/unix/posix-poll.c', + 'src/unix/no-fsevents.c', + 'src/unix/no-proctitle.c', + ], + 'defines': [ + '_ALL_SOURCE', + '_XOPEN_SOURCE=500', + '_LINUX_SOURCE_COMPAT', + '_THREAD_SAFE', + ], + }], [ 'OS=="freebsd" or OS=="dragonflybsd"', { 'sources': [ 'src/unix/freebsd.c' ], }],