Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Updates to enable AIX support #2364

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
['OS=="aix"', {
'cflags': [ '-gxcoff' ],
'ldflags': [ '-Wl,-bbigtoc' ],
}],
],
'msvs_settings': {
'VCCLCompilerTool': {
Expand Down Expand Up @@ -199,11 +203,11 @@
'BUILDING_UV_SHARED=1',
],
}],
[ 'OS in "linux freebsd openbsd solaris"', {
[ 'OS in "linux freebsd openbsd solaris aix"', {
'cflags': [ '-pthread', ],
'ldflags': [ '-pthread' ],
}],
[ 'OS in "linux freebsd openbsd solaris android"', {
[ 'OS in "linux freebsd openbsd solaris android aix"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
'ldflags': [ '-rdynamic' ],
Expand All @@ -225,11 +229,11 @@
'cflags': [ '-m64' ],
'ldflags': [ '-m64' ],
}],
[ 'target_arch=="ppc"', {
[ 'target_arch=="ppc" and OS!="aix"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="ppc64"', {
[ 'target_arch=="ppc64" and OS!="aix"', {
'cflags': [ '-m64', '-mminimal-toc' ],
'ldflags': [ '-m64' ],
}],
Expand All @@ -239,6 +243,18 @@
'cflags!': [ '-pthread' ],
'ldflags!': [ '-pthread' ],
}],
[ 'OS=="aix"', {
'conditions': [
[ 'target_arch=="ppc"', {
'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
}],
[ 'target_arch=="ppc64"', {
'cflags': [ '-maix64' ],
'ldflags': [ '-maix64' ],
}],
],
'ldflags!': [ '-rdynamic' ],
}],
],
}],
[ 'OS=="android"', {
Expand Down
16 changes: 11 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import nodedownload
# parse our options
parser = optparse.OptionParser()

valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android')
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
'android', 'aix')
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32',
'x64', 'x86')
valid_arm_float_abi = ('soft', 'softfp', 'hard')
Expand Down Expand Up @@ -480,11 +481,11 @@ def check_compiler(o):
o['variables']['gas_version'] = get_gas_version(CC)


def cc_macros():
"""Checks predefined macros using the CC command."""
def cc_macros(cc=None):
"""Checks predefined macros using the C compiler command."""

try:
p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'],
p = subprocess.Popen(shlex.split(cc or CC) + ['-dM', '-E', '-'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down Expand Up @@ -542,7 +543,12 @@ def is_arm_hard_float_abi():
def host_arch_cc():
"""Host architecture check using the CC command."""

k = cc_macros()
if sys.platform.startswith('aix'):
# we only support gcc at this point and the default on AIX
# would be xlc so hard code gcc
k = cc_macros('gcc')
else:
k = cc_macros()

matchup = {
'__aarch64__' : 'arm64',
Expand Down
4 changes: 4 additions & 0 deletions deps/cares/cares.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
'_GNU_SOURCE'
]
}],
[ 'OS=="aix"', {
'include_dirs': [ 'config/aix' ],
'sources': [ 'config/aix/ares_config.h' ],
}],
['OS=="solaris"', {
'defines': [
'__EXTENSIONS__',
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
],
}],

[ 'OS in "linux freebsd openbsd solaris android"', {
[ 'OS in "linux freebsd openbsd solaris android aix"', {
'variables': {
'gcc_version%': '<!(python build/gcc_version.py)>)'
},
Expand Down
Loading