Skip to content

Commit 40e320c

Browse files
committed
build: update common.gypi for z/OS
- Don't use icu data file on z/OS; use libnode's bundled ICU data. - Include required defines, cflags, ldflags, and remove unsupported ones, following switch to clang compiler. - Remove _ALL_SOURCE, as _POSIX_C_SOURCE and _POSIX_SOURCE already enable all required library functions (in deps/uv/CMakeLists.txt, only _OPEN_SYS is required to enable setgroups (in grp.h) instead of _ALL_SOURCE); also remove dup _OPEN_SYS_SOCK_IPV6. - Add -D_EXT to defines (for setenv, and vsam.js' `__KEY_*` macros). - Add _POSIX_C_SOURCE=200809L to enable at least `utimensat`. - Add clang option -mzos-target=zosv2r5 also to ldflags, otherwise the default LE dataset is used that may not be for the current target. - Add -m64 to ldflags, otherwise ld passes `AMODE=31,LIST,..` to the binder, causing unresolved symbols if the non-64 suffixed version of the compiler was used (e.g. ibm-clang instead of ibm-clang64). - Add zoslib/include-wrappers/c++ in include_dirs for custom aligned new and delete operators. Signed-off-by: Gaby Baghdadi <baghdadi@ca.ibm.com>
1 parent 1167f85 commit 40e320c

1 file changed

Lines changed: 26 additions & 32 deletions

File tree

‎common.gypi‎

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@
129129
['OS=="linux" or OS=="openharmony"', {
130130
'node_section_ordering_info%': ''
131131
}],
132-
['OS == "zos"', {
133-
# use ICU data file on z/OS
134-
'icu_use_data_file_flag%': 1
135-
}]
136132
],
137133
},
138134

@@ -227,11 +223,7 @@
227223
# pull in V8's postmortem metadata
228224
'ldflags': [ '-Wl,-z,allextract' ]
229225
}],
230-
['OS=="zos"', {
231-
# increase performance, number from experimentation
232-
'cflags': [ '-qINLINE=::150:100000' ]
233-
}],
234-
['OS!="mac" and OS!="win" and OS!="zos"', {
226+
['OS!="mac" and OS!="win"', {
235227
# -fno-omit-frame-pointer is necessary for the --perf_basic_prof
236228
# flag to work correctly. perf(1) gets confused about JS stack
237229
# frames otherwise, even with --call-graph dwarf.
@@ -485,7 +477,7 @@
485477
[ 'target_arch=="arm64"', {
486478
'msvs_configuration_platform': 'arm64',
487479
}],
488-
['asan == 1 and OS != "mac" and OS != "zos"', {
480+
['asan == 1 and OS != "mac"', {
489481
'cflags+': [
490482
'-fno-omit-frame-pointer',
491483
'-fsanitize=address',
@@ -513,7 +505,7 @@
513505
}],
514506
],
515507
}],
516-
['ubsan == 1 and OS != "mac" and OS != "zos"', {
508+
['ubsan == 1 and OS != "mac"', {
517509
'cflags+': [
518510
'-fno-omit-frame-pointer',
519511
'-fsanitize=undefined',
@@ -596,11 +588,11 @@
596588
'NOMINMAX',
597589
],
598590
}],
599-
[ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', {
591+
[ 'OS in "linux freebsd openbsd solaris aix os400 openharmony zos"', {
600592
'cflags': [ '-pthread' ],
601593
'ldflags': [ '-pthread' ],
602594
}],
603-
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', {
595+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony zos"', {
604596
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
605597
'cflags_cc': [
606598
'-fno-rtti',
@@ -619,6 +611,9 @@
619611
'cflags': [ '-I/usr/local/include' ],
620612
'ldflags': [ '-Wl,-z,wxneeded' ],
621613
}],
614+
[ 'OS=="zos"', {
615+
'ldflags!': [ '-rdynamic' ],
616+
}],
622617
['_toolset=="host"', {
623618
'conditions': [
624619
[ 'host_arch=="ia32"', {
@@ -837,47 +832,46 @@
837832
}],
838833
['OS == "zos"', {
839834
'defines': [
835+
'ZOSLIB_OVERRIDE_CLIB',
836+
'ZOSLIB_ALIGNED_NEWDEL',
840837
'_XOPEN_SOURCE_EXTENDED',
841838
'_XOPEN_SOURCE=600',
842839
'_UNIX03_THREADS',
843840
'_UNIX03_WITHDRAWN',
844841
'_UNIX03_SOURCE',
845842
'_OPEN_SYS_SOCK_IPV6',
846843
'_OPEN_SYS_FILE_EXT=1',
844+
'_POSIX_C_SOURCE=200809L',
847845
'_POSIX_SOURCE',
848846
'_OPEN_SYS',
849847
'_OPEN_SYS_IF_EXT',
850-
'_OPEN_SYS_SOCK_IPV6',
851848
'_OPEN_MSGQ_EXT',
852849
'_LARGE_TIME_API',
853-
'_ALL_SOURCE',
854850
'_AE_BIMODAL=1',
855-
'__IBMCPP_TR1__',
851+
'_EXT',
856852
'NODE_PLATFORM="os390"',
857853
'PATH_MAX=1024',
858854
'_ENHANCED_ASCII_EXT=0xFFFFFFFF',
859-
'_Export=extern',
860-
'__static_assert=static_assert',
861855
],
862856
'cflags': [
863-
'-q64',
864-
'-Wc,DLL',
865-
'-Wa,GOFF',
866-
'-qARCH=10',
867-
'-qASCII',
868-
'-qTUNE=12',
869-
'-qENUM=INT',
870-
'-qEXPORTALL',
871-
'-qASM',
872-
],
873-
'cflags_cc': [
874-
'-qxclang=-std=c++14',
857+
'-fno-short-enums',
858+
'-fno-xl-pragma-pack',
859+
'-fstack-protector',
860+
'-fvisibility=default',
861+
'-fzos-le-char-mode=ascii',
862+
'-m64',
863+
'-march=z14',
864+
'-mzos-target=zosv2r5',
875865
],
876866
'ldflags': [
877-
'-q64',
867+
'-m64',
868+
'-mzos-target=zosv2r5',
878869
],
879870
# for addons due to v8config.h include of "zos-base.h":
880-
'include_dirs': ['<(zoslib_include_dir)'],
871+
'include_dirs': [
872+
'<(zoslib_include_dir)',
873+
'<(zoslib_include_dir)/include-wrappers/c++',
874+
],
881875
}],
882876
],
883877
}

0 commit comments

Comments
 (0)