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: add support for 64-bit AIX #1807

Closed
wants to merge 1 commit into from
Closed

Conversation

richardlau
Copy link
Contributor

Support building 64-bit binaries on AIX via gyp. At the moment there's no automatic detection as platform.machine()/uname -m on AIX is a bit useless (e.g., on an AIX system I have access to uname -m outputs 00F460A94C00) so you need to pass -Dtarget_arch=ppc64 to gyp_uv.py to activate.

Note however that #1795 actually fails to compile on 64-bit AIX due to incorrect assumptions about the size of uv_sem_t, see nodejs/node#20129 (comment).

Pass `-Dtarget_arch=ppc64` to `gyp_uv.py` to activate.
@richardlau
Copy link
Contributor Author

With regards to automatic host/target arch detection, at least one place in V8 appears to assume that if you're on AIX you want ppc64: https://github.com/nodejs/node/blob/82e475dc75751df08d80bd6e25926bd25c1794f2/deps/v8/third_party/binutils/detect_v8_host_arch.py#L63-L68

@richardlau
Copy link
Contributor Author

I assume I also need to make an equivalent change for autotools? Anyone able to point me at where I should be editing?

@santigimeno
Copy link
Member

Probably around here: https://github.com/libuv/libuv/blob/v1.x/Makefile.am#L330

@mhdawson
Copy link
Contributor

The -Dtarget_arch=ppc64 must be what is allowing the 64 bit Node.js builds.

If we have to choose either 32 or 64 bit it should be 64 bit as we have only every shipped 64 bit node.js community builds, however, is it possible for us to update the CI job to set the target arch for AIX ?

@richardlau
Copy link
Contributor Author

@mhdawson Node.js has it's own version of common.gypi that adds the correct flags for target_arch=ppc64: https://github.com/nodejs/node/blob/94596560c2556fae614ef237ed0ff2f749b14651/common.gypi#L371-L393

There's no such equivalent (until this PR) in the libuv version of common.gypi (so you can set -Dtarget_arch=ppc64 in the CI but it won't actually change any of the compile/link flags).

@richardlau
Copy link
Contributor Author

Probably around here: https://github.com/libuv/libuv/blob/v1.x/Makefile.am#L330

I don't see any equivalents for the equivalent -m32 flags for ia32:

libuv/common.gypi

Lines 146 to 149 in 1e4823c

[ 'host_arch != target_arch and target_arch=="ia32"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],

Do we want to hardcode -maix64 into https://github.com/libuv/libuv/blob/v1.x/Makefile.am, or is the convention to pass such flags through to make using environment variables?

@mhdawson
Copy link
Contributor

@richardlau got it.

@santigimeno
Copy link
Member

@richardlau from other similar changes such as this it seems that for some architectures the support is only added to gyp build system. I'm sure @bnoordhuis knows better.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis
Copy link
Member

from other similar changes such as this it seems that for some architectures the support is only added to gyp build system

Yes. If someone needs aix+autotools, they'll open an issue.

Copy link
Contributor

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cjihrig pushed a commit that referenced this pull request Apr 22, 2018
Pass -Dtarget_arch=ppc64 to gyp_uv.py to activate.

Refs: nodejs/node#20129
Refs: #1795
PR-URL: #1807
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@cjihrig
Copy link
Contributor

cjihrig commented Apr 22, 2018

Landed in 4f77a23. Thanks!

@cjihrig cjihrig closed this Apr 22, 2018
@richardlau
Copy link
Contributor Author

from other similar changes such as this it seems that for some architectures the support is only added to gyp build system

Yes. If someone needs aix+autotools, they'll open an issue.

So to follow up it appears that the libuv CI is using autotools on AIX 😆 . I think I've figured out the steps you need to build 64-bit AIX binaries via autotools in nodejs/build#1245 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants