Skip to content

Cannot build 4.3.2 on OS X 10.8.5 #5550

Description

@richardlau
  • Version: v4.3.2
  • Platform: Darwin fama.ottawa.ibm.com 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
  • Subsystem: deps/openssl

Getting compilation errors on OS X 10.8.5 with v4.3.2 (previous versions, e.g. v4.3.1, built successfully on the same system) that must be related to the OpenSSL update (since that's the only thing that changed):

  gcc '-DPURIFY' '-D_REENTRANT' '-DOPENSSL_NO_SSL2' '-DOPENSSL_NO_SSL3' '-DOPENSSL_NO_HEARTBEATS' '-DENGINESDIR="/dev/null"' '-DTERMIOS' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-D_DARWIN_USE_64_BIT_INODE=1' '-DL_ENDIAN' '-DAES_ASM' '-DCPUID_ASM' '-DOPENSSL_BN_ASM_MONT' '-DOPENSSL_CPUID_OBJ' '-DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DGHASH_ASM' '-DVPAES_ASM' '-DBN_ASM' '-DBF_ASM' '-DBNCO_ASM' '-DDES_ASM' '-DLIB_BN_ASM' '-DMD5_ASM' '-DOPENSSL_BN_ASM' '-DRIP_ASM' '-DRMD160_ASM' '-DWHIRLPOOL_ASM' '-DWP_ASM' '-DOPENSSL_BN_ASM_MONT5' '-DOPENSSL_BN_ASM_GF2m' '-DOPENSSL_IA32_SSE2' '-DBSAES_ASM' '-DDSO_DLFCN' '-DHAVE_DLFCN_H' -I../deps/openssl -I../deps/openssl/openssl -I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/asn1 -I../deps/openssl/openssl/crypto/evp -I../deps/openssl/openssl/crypto/md2 -I../deps/openssl/openssl/crypto/modes -I../deps/openssl/openssl/crypto/store -I../deps/openssl/openssl/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF /home/users/riclau/sandbox/github/node/out/Release/.deps//home/users/riclau/sandbox/github/node/out/Release/obj.target/openssl/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.o.d.raw  -c -o /home/users/riclau/sandbox/github/node/out/Release/obj.target/openssl/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.o ../deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.s
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3465:missing or invalid immediate expression `0b00010000' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3465:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3467:missing or invalid immediate expression `0b10001100' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3467:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3469:missing or invalid immediate expression `0b11111111' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3469:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3480:missing or invalid immediate expression `0b00010000' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3480:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3483:missing or invalid immediate expression `0b10001100' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3483:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3486:missing or invalid immediate expression `0b01010101' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3486:suffix or operands invalid for `pshufd'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3489:missing or invalid immediate expression `0b11111111' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3489:suffix or operands invalid for `pshufd'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3496:missing or invalid immediate expression `0b01000100' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3496:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3498:missing or invalid immediate expression `0b01001110' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3498:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3508:missing or invalid immediate expression `0b00010000' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3508:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3510:missing or invalid immediate expression `0b10001100' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3510:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3512:missing or invalid immediate expression `0b11111111' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3512:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3521:missing or invalid immediate expression `0b00010000' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3521:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3523:missing or invalid immediate expression `0b10001100' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3523:suffix or operands invalid for `shufps'
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3525:missing or invalid immediate expression `0b10101010' taken as 0
../deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s:3525:suffix or operands invalid for `shufps'
make[2]: *** [/home/users/riclau/sandbox/github/node/out/Release/obj.target/openssl/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.o] Error 1

gist of complete build log

Activity

  1. richardlau commented on Mar 3, 2016

    @richardlau
    MemberAuthor

    Not seeing the errors on a second system running OS X 10.10.1.

  2. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    macosIssues and PRs related to the macOS platform.
    opensslIssues and PRs related to the OpenSSL dependency.
    on Mar 3, 2016
  3. mscdex commented on Mar 3, 2016

    @mscdex
    Contributor

    Out of curiosity, what does gcc -v show?

  4. richardlau commented on Mar 3, 2016

    @richardlau
    MemberAuthor

    On our 10.8.5 system (fails):

    $ gcc -v
    Using built-in specs.
    Target: i686-apple-darwin11
    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    $
    

    on 10.10.1 (passes):

    $ gcc -v
    Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    $
    
  5. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @richardlau Also pointed out this may be an upstream issue, see https://www.mail-archive.com/openssl-dev%40openssl.org/msg43040.html

  6. mscdex commented on Mar 3, 2016

    @mscdex
    Contributor

    If that's real gcc, I believe you need to use gcc 4.8.x or newer (in general).

  7. bnoordhuis commented on Mar 3, 2016

    @bnoordhuis
    Member

    Works for me on 10.8.5 with this:

    $ c++ -v
    Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.6.0
    Thread model: posix
    
  8. richardlau commented on Mar 3, 2016

    @richardlau
    MemberAuthor

    For comparison (our 10.8.5):

    $ c++ -v
    Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.5.0
    Thread model: posix
    
  9. MylesBorins commented on Mar 3, 2016

    @MylesBorins
    Contributor

    @bnoordhuis what is gcc -v outputting out your system?

    From the openssl thread it looks like there is an alternative patch that someone tested that is building, so we at least have confirmation that this is happening in the wild

  10. bnoordhuis commented on Mar 3, 2016

    @bnoordhuis
    Member
    $ gcc -v
    Using built-in specs.
    Target: i686-apple-darwin11
    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    
  11. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    Applying the patch suggested on the OpenSSL mailing list appears to resolve the issue https://github.com/openssl/openssl/pull/597/files.

    Here are some examples of assembler (asm_obsolete) generated before and after the patch.

    Before:

    .p2align    4
    L$key_expansion_128:
        movups  %xmm0,(%rax)
        leaq    16(%rax),%rax
    L$key_expansion_128_cold:
        shufps  $0b00010000,%xmm0,%xmm4
        xorps   %xmm4,%xmm0
        shufps  $0b10001100,%xmm0,%xmm4
        xorps   %xmm4,%xmm0
        shufps  $0b11111111,%xmm1,%xmm1
        xorps   %xmm1,%xmm0
        .byte   0xf3,0xc3
    

    After:

    .p2align    4
    L$key_expansion_128:
        movups  %xmm0,(%rax)
        leaq    16(%rax),%rax
    L$key_expansion_128_cold:
        shufps  $16,%xmm0,%xmm4
        xorps   %xmm4,%xmm0
        shufps  $140,%xmm0,%xmm4
        xorps   %xmm4,%xmm0
        shufps  $255,%xmm1,%xmm1
        xorps   %xmm1,%xmm0
        .byte   0xf3,0xc3
    

    Regenerating the asm folder shows similar issues but in fewer places, but I really don't understand why @bnoordhuis is not seeing this issue, the build system decides to use asm or asm_obsolete based on: https://github.com/nodejs/node/blob/master/deps/openssl/openssl.gypi#L1043 so he should also be falling back to asm_obsolete folder. @bnoordhuis does your machine compile the assembler from the asm or asm_obsolete folders?

    In fact, the checks done in https://github.com/nodejs/node/blob/master/configure#L442:L463 appear to fail completely on the latest OS X because the banner of clang has changed:

    Stefan@Stefans-MacBook-Pro:~$ sw_vers -productVersion
    10.11.3
    Stefan@Stefans-MacBook-Pro:~$ cc -v
    Apple LLVM version 7.0.2 (clang-700.1.81)
    Target: x86_64-apple-darwin15.3.0
    Thread model: posix
    

    Therefore my machine fails to use the higher performance code path despite having support for AVX2.

  12. MylesBorins commented on Mar 3, 2016

    @MylesBorins
    Contributor

    @stefanmb would you be willing to send a PR to fix the ./configure to work on the latest OSX?

  13. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @thealphanerd Sure, as soon as I figure out how to interpret the newer version numbers. :)

    Based on https://en.wikipedia.org/wiki/Xcode#Version_comparison_table everything after clang-500.2.75 should be okay.

  14. bnoordhuis commented on Mar 3, 2016

    @bnoordhuis
    Member

    does your machine compile the assembler from the asm or asm_obsolete folders?

    asm_obsolete. I noticed it uses cc and not gcc like it seems to do on @richardlau's machine. For me, cc -v prints:

    $ cc -v
    Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
    Target: x86_64-apple-darwin12.6.0
    Thread model: posix
    
  15. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @bnoordhuis I have access to @richardlau's machine and that's what I used to test the fix. Now, looking at that assembler, it's obvious those immediates have the same values but in different bases, I wonder if certain versions of the toolchain can understand binary as well as base10.

  16. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @thealphanerd As requested, I've fixed the clang detection for OS X: #5553

  17. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @bnoordhuis Running the offending line with cc (or c++) works, gcc does not!

  18. stefanmb commented on Mar 3, 2016

    @stefanmb
    Contributor

    @richardlau @bnoordhuis So I can confirm by removing "export CC=gcc" from the build scripts (ours, not Node's) everything is resolved. This problem may break others, but I'm not sure if there is anything else to do at this point other than keep a record of the problem. Thanks for the help!

  19. richardlau commented on Mar 4, 2016

    @richardlau
    MemberAuthor

    Thanks @stefanmb

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

    buildIssues and PRs related to Node.js builds or CI infrastructure.macosIssues and PRs related to the macOS platform.opensslIssues and PRs related to the OpenSSL dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions