Skip to content

Node 15 build fails with LTO enabled #35957

Description

@astefanutti

Node 15.0.1 build fails when LTO is enabled with the following message:

/tmp/ccikGPmp.s: Assembler messages:
/tmp/ccikGPmp.s:26: Error: symbol `PushAllRegistersAndIterateStack' is already defined
make[2]: *** [/tmp/ccdIdoeH.mk:2: /tmp/node.aneJAa.ltrans0.ltrans.o] Error 1
make[2]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.

The build with same configuration used to be successful for Node 14.x and previous versions.

It seems related to the v8 version upgrade from 8.4 to 8.6. It may be the PushAllRegistersAndIterateStack assembly gets inlined multiple times, which leads to duplicated symbols in the LTO compilation unit.

  • Version: 15.0.1
  • Platform: Linux

What steps will reproduce the bug?

$ ./configure --enable-lto && make -j$(getconf _NPROCESSORS_ONLN) V=

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Nov 4, 2020
  2. tniessen commented on Nov 4, 2020

    @tniessen
    Member

    Which Linux distribution and which kernel are you using? Which C/C++ toolchain (compiler, linker, etc.) are you using?

  3. added
    linuxIssues and PRs related to the Linux platform.
    on Nov 4, 2020
  4. astefanutti commented on Nov 5, 2020

    @astefanutti
    Author

    Which Linux distribution and which kernel are you using? Which C/C++ toolchain (compiler, linker, etc.) are you using?

    Linux 4.19.88
    GCC 9.2.0
    Musl 1.2.0
    GNU gold (GNU Binutils 2.33.1) 1.16

  5. tniessen commented on Nov 5, 2020

    @tniessen
    Member

    cc @nodejs/build-files

  6. lyu commented on Nov 25, 2020

    @lyu

    Same thing here when --enable-lto is added, tested with the latest 15.3.0 release.

    Linux 3.10.0 (CentOS 7.8.2003 x86_64)
    GCC 10.2.0
    glibc 2.17
    binutils 2.35.1

    14.15.1 compiles fine with --enable-lto.

  7. sapics commented on Mar 19, 2021

    @sapics
    Contributor

    Same thing here with latest master branch.

    --- Environment ---
    Ubuntu 20.04 (Linux Kernel: 5.4)
    GCC 10.2.0
    glibc 2.31
    binutils 2.34

  8. gengjiawen commented on Apr 29, 2021

    @gengjiawen
    Member

    landed in master.

  9. sapics commented on May 6, 2021

    @sapics
    Contributor

    Thanks! Build was successful in master branch with --enable-lto.

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.linuxIssues and PRs related to the Linux platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions