Skip to content

Commit 43397b2

Browse files
mhdawsonFishrock123
authored andcommitted
build: Updates to enable AIX support
These are the core changes that allow AIX to compile. There are still some test failures as there are some patches needed for libuv and npm that we'll need to contribute through those communities but this set allows node to be built on AIX and pass most of the core tests The change in js2c is because AIX does not support $ in identifier names. See the discussion/agreement in #2272 PR-URL: #2364 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 7ebd881 commit 43397b2

18 files changed

+1113
-21
lines changed

common.gypi

+20-4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
['target_arch=="x64"', {
6565
'msvs_configuration_platform': 'x64',
6666
}],
67+
['OS=="aix"', {
68+
'cflags': [ '-gxcoff' ],
69+
'ldflags': [ '-Wl,-bbigtoc' ],
70+
}],
6771
],
6872
'msvs_settings': {
6973
'VCCLCompilerTool': {
@@ -217,11 +221,11 @@
217221
'BUILDING_UV_SHARED=1',
218222
],
219223
}],
220-
[ 'OS in "linux freebsd openbsd solaris"', {
224+
[ 'OS in "linux freebsd openbsd solaris aix"', {
221225
'cflags': [ '-pthread', ],
222226
'ldflags': [ '-pthread' ],
223227
}],
224-
[ 'OS in "linux freebsd openbsd solaris android"', {
228+
[ 'OS in "linux freebsd openbsd solaris android aix"', {
225229
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
226230
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
227231
'ldflags': [ '-rdynamic' ],
@@ -243,11 +247,11 @@
243247
'cflags': [ '-m64' ],
244248
'ldflags': [ '-m64' ],
245249
}],
246-
[ 'target_arch=="ppc"', {
250+
[ 'target_arch=="ppc" and OS!="aix"', {
247251
'cflags': [ '-m32' ],
248252
'ldflags': [ '-m32' ],
249253
}],
250-
[ 'target_arch=="ppc64"', {
254+
[ 'target_arch=="ppc64" and OS!="aix"', {
251255
'cflags': [ '-m64', '-mminimal-toc' ],
252256
'ldflags': [ '-m64' ],
253257
}],
@@ -257,6 +261,18 @@
257261
'cflags!': [ '-pthread' ],
258262
'ldflags!': [ '-pthread' ],
259263
}],
264+
[ 'OS=="aix"', {
265+
'conditions': [
266+
[ 'target_arch=="ppc"', {
267+
'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
268+
}],
269+
[ 'target_arch=="ppc64"', {
270+
'cflags': [ '-maix64' ],
271+
'ldflags': [ '-maix64' ],
272+
}],
273+
],
274+
'ldflags!': [ '-rdynamic' ],
275+
}],
260276
],
261277
}],
262278
[ 'OS=="android"', {

configure

+11-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import nodedownload
2525
# parse our options
2626
parser = optparse.OptionParser()
2727

28-
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android')
28+
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
29+
'android', 'aix')
2930
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32',
3031
'x64', 'x86')
3132
valid_arm_float_abi = ('soft', 'softfp', 'hard')
@@ -492,11 +493,11 @@ def check_compiler(o):
492493
o['variables']['gas_version'] = get_gas_version(CC)
493494

494495

495-
def cc_macros():
496-
"""Checks predefined macros using the CC command."""
496+
def cc_macros(cc=None):
497+
"""Checks predefined macros using the C compiler command."""
497498

498499
try:
499-
p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'],
500+
p = subprocess.Popen(shlex.split(cc or CC) + ['-dM', '-E', '-'],
500501
stdin=subprocess.PIPE,
501502
stdout=subprocess.PIPE,
502503
stderr=subprocess.PIPE)
@@ -554,7 +555,12 @@ def is_arm_hard_float_abi():
554555
def host_arch_cc():
555556
"""Host architecture check using the CC command."""
556557

557-
k = cc_macros()
558+
if sys.platform.startswith('aix'):
559+
# we only support gcc at this point and the default on AIX
560+
# would be xlc so hard code gcc
561+
k = cc_macros('gcc')
562+
else:
563+
k = cc_macros()
558564

559565
matchup = {
560566
'__aarch64__' : 'arm64',

deps/cares/cares.gyp

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
'_GNU_SOURCE'
1010
]
1111
}],
12+
[ 'OS=="aix"', {
13+
'include_dirs': [ 'config/aix' ],
14+
'sources': [ 'config/aix/ares_config.h' ],
15+
}],
1216
['OS=="solaris"', {
1317
'defines': [
1418
'__EXTENSIONS__',

deps/cares/common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
],
138138
}],
139139

140-
[ 'OS in "linux freebsd openbsd solaris android"', {
140+
[ 'OS in "linux freebsd openbsd solaris android aix"', {
141141
'variables': {
142142
'gcc_version%': '<!(python build/gcc_version.py)>)'
143143
},

0 commit comments

Comments
 (0)