Skip to content

libuv CI should build 64-bit binaries on AIX #1245

Closed

Description

@richardlau

Refs: nodejs/node#20129 (comment)

Node.js only supports 64-bit AIX but it looks like libuv is compiling 32-bit binaries on AIX and thus didn't detect the compilation failure that libuv/libuv#1795 introduced.

Needs libuv/libuv#1807 to land first so that libuv can actually build 64-bit AIX binaries.

cc @nodejs/libuv @nodejs/platform-aix

Activity

  1. richardlau commented on Apr 23, 2018

    @richardlau
    MemberAuthor

    libuv/libuv#1807 has landed so it should just be a matter of passing -Dtarget_arch=ppc64 to gyp_uv.py to build 64-bit AIX binaries.

    I have no strong feelings on whether we should continue to build 32-bit AIX binaries for libuv -- we currently only build 64-bit for AIX for Node.js.

  2. mhdawson commented on Apr 23, 2018

    @mhdawson
    Member

    @richardlau so do you mean add -Dtarget_arch=ppc64 to the CI job ?

    I'd lean to just building for 64 bit, although the libuv jobs are quite quick.

  3. richardlau commented on Apr 23, 2018

    @richardlau
    MemberAuthor

    @richardlau so do you mean add -Dtarget_arch=ppc64 to the CI job ?

    I did, but I was assuming the CI job was using gyp, but looking at https://ci.nodejs.org/job/libuv-test-commit-aix/803/nodes=aix61-ppc64/console it looks like it might be using autotools which I am not familiar with.

  4. mhdawson commented on Apr 24, 2018

    @mhdawson
    Member

    @richardlau if you can't figure it out can you see if you can get help from @gireeshpunathil

  5. gireeshpunathil commented on Apr 25, 2018

    @gireeshpunathil
    Member

    @richardlau - can you try this?

    diff --git a/Makefile.am b/Makefile.am
    index ae9d96bc..45936421 100644
    --- a/Makefile.am
    +++ b/Makefile.am
    @@ -331,7 +331,9 @@ libuv_la_CFLAGS += -D_ALL_SOURCE \
                        -D_XOPEN_SOURCE=500 \
                        -D_LINUX_SOURCE_COMPAT \
                        -D_THREAD_SAFE \
    -                   -DHAVE_SYS_AHAFS_EVPRODS_H
    +                   -DHAVE_SYS_AHAFS_EVPRODS_H \
    +                   -maxi64 \
    +test_run_tests_CFLAGS += -maix64
     include_HEADERS += include/uv-aix.h
     libuv_la_SOURCES += src/unix/aix.c src/unix/aix-common.c
     endif

    As we don't have 32 bit builds, the 64 bit hard-coding is fine, and that is what other platforms that don't support 32 bit do.

  6. richardlau commented on Apr 25, 2018

    @richardlau
    MemberAuthor

    @gireeshpunathil Unfortunately I cannot because the AIX machines I have access to do not have autotools installed.

  7. richardlau commented on Apr 25, 2018

    @richardlau
    MemberAuthor

    Thanks to @gireeshpunathil I've found an AIX machine with autotools. It's not enough to pass -maix64 as CFLAGS and LDFLAGS -- you also need to make sure nm and ar run in the correct object mode.

    The libuv build instructions for autotools:

    $ sh autogen.sh
    $ ./configure
    $ make
    $ make check
    $ make install
    

    what appears to work for 64-bit binaries on AIX is:

    $ export OBJECT_MODE=64
    $ sh autogen.sh
    $ ./configure CFLAGS=-maix64 LDFLAGS=-maix64
    $ make
    $ make check
    $ make install
    
    Validating binary is 64-bit
    -bash-4.4$ dump -X64 -ov test/run-tests
    
    test/run-tests:
    
                            ***Object Module Header***
    # Sections      Symbol Ptr      # Symbols       Opt Hdr Len     Flags
             5      0x002eb352         174207               120     0x1002
    Flags=( EXEC DYNLOAD DEP_SYSTEM )
    Timestamp = "Apr 25 14:19:26 2018"
    Magic = 0x1f7  (64-bit XCOFF)
    
                            ***Optional Header***
    Tsize       Dsize       Bsize       Tstart      Dstart
    0x000de360  0x00013510  0x006ae340  0x10000240  0x200005a0
    
    SNloader    SNentry     SNtext      SNtoc       SNdata
    0x0004      0x0002      0x0001      0x0002      0x0002
    
    TXTalign    DATAalign   TOC         vstamp      entry
    0x0007      0x0004      0x2000bab0  0x0001      0x200044c0
    
    maxSTACK    maxDATA     SNbss       magic       modtype
    0x00000000  0x00000000  0x0003      0x010b        1L
    -bash-4.4$
    

    @mhdawson I believe adding export OBJECT_MODE=64 and adding CFLAGS=-maix64 LDFLAGS=-maix64 to the ./configure command are the required changes to build 64-bit AIX binaries.

  8. richardlau commented on Apr 25, 2018

    @richardlau
    MemberAuthor

    Alternatively we could switch the AIX build to use gyp, but we should clear that with the libuv maintainers first.

  9. bnoordhuis commented on Apr 25, 2018

    @bnoordhuis
    Member

    I'm fine with that, I don't think there are any users of the aix+autotools combo. Pull request welcome.

  10. mhdawson commented on Apr 25, 2018

    @mhdawson
    Member

    Ok so current job has

    sh autogen.sh && ./configure
    make -j2
    make check

    @richardlau I tried to update to:

    sh autogen.sh && ./configure CFLAGS=-maix64 LDFLAGS=-maix64

    We got an error:

    + ./configure CFLAGS=-maix64 LDFLAGS=-maix64
    checking for a BSD-compatible install... ./install-sh -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... ./install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... nawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking build system type... Could not load program /usr/opt/freeware/bin/rpm:
    Could not load module /opt/freeware/lib/libpopt.so.
    	Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
    	Member libiconv.so.2 is not found in archive 
    Could not load module rpm.
    	Dependent module /opt/freeware/lib/libpopt.so could not be loaded.
    Could not load module .
    

    which is strange since we compile libuv fine in the Node.js builds

  11. mhdawson commented on Apr 25, 2018

    @mhdawson
    Member

    Actually, that same error occurs previously but does not seem to block the process is unrealated.

    The real problem seems to be:

    checking for ar... ar
    checking the archiver (ar) interface... unknown
    configure: error: could not determine ar interface
    Build step 'Conditional steps (multiple)' marked build as failure
    Notifying upstream projects of job completion
    Finished: FAILURE
    
  12. mhdawson commented on Apr 25, 2018

    @mhdawson
    Member

    @richardlau ar shows as

    checking for ar... ar
    checking the archiver (ar) interface... unknown
    configure: error: could not determine ar interface
    Build step 'Conditional steps (multiple)' marked build as failure
    Notifying upstream projects of job completion
    Finished: FAILURE
    

    and figure out what might be going wrong.

  13. richardlau commented on Apr 25, 2018

    @richardlau
    MemberAuthor

    @mhdawson was export OBJECT_MODE=64 set? If it was try not setting it until after configure is run?

  14. richardlau commented on Apr 25, 2018

    @richardlau
    MemberAuthor

    I'm fine with that, I don't think there are any users of the aix+autotools combo. Pull request welcome.

    @bnoordhuis AFAIK the libuv CI configuration isn't stored in a GitHub repo? Happy to raise a PR otherwise.

  15. bnoordhuis commented on Apr 25, 2018

    @bnoordhuis
    Member

    It's not. It's done through Jenkins config, I think.

  16. mhdawson commented on Apr 26, 2018

    @mhdawson
    Member

    Sorry missed the OBJECT_MODE bit

  17. mhdawson commented on Apr 26, 2018

    @mhdawson
    Member

    Ok now building ok, thanks for all the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions