Skip to content

Why do we pass "-std=gnu++0x" to the compiler? #945

Closed

Description

@targos

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/728026#message-a337cd5c8611b2408a8972deb3d20528b5845be1

It seems that we should pass -std=gnu++11 at least. Unless we support compilers that don't have this option?

Activity

  1. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    -std=gnu++14 would be even better and Clang supports it since version 3.4: https://clang.llvm.org/cxx_status.html

  2. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    Ref: nodejs/node@e43c109891d

    I'm going to try and change this option to see if CI can pass.

  3. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    CI: https://ci.nodejs.org/job/node-test-commit/13446/

    I already see that LinuxONE does not support it.

  4. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    /cc @nodejs/build and @nodejs/v8

  5. gibfahn commented on Oct 25, 2017

    @gibfahn
    Member
  6. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    So, by looking at this build, I see that we are still compiling with GCC 4.8. but we officially stopped to support it for Node 8.

    New CI with -std=gnu++11: https://ci.nodejs.org/job/node-test-commit/13447/

    Edit: GCC 4.8 does not support C++14. I don't know if 4.9 does.

  7. targos commented on Oct 25, 2017

    @targos
    MemberAuthor
  8. refack commented on Oct 25, 2017

    @refack
    Contributor

    RE migration to a newer version: we're trying to balance the new requirements (GCC 4.9 for example is a "soft" requirement) and still keeping the old configuration for LTS node versions.
    Refs: #809
    Refs: #797

    1. Some old platforms (CentOS5 & 6) don't have well supported binaries of newer GCC.
    2. changing the global GCC changes the global stdlib++ which requires the users to upgrade, so we're trying figure out way to either have it side-by-side, or have multiple build-bots
    3. getting prebuilt toolschains for 32bit environments is also a challenge. Dropping 32-bit builds #885
  9. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    From https://chromium-review.googlesource.com/c/v8/v8/+/728026#message-697b6bb5ae15281bdd7c9b457aa75b75ef8a14ea:

    C++14 is generally allowed in chromium (https://chromium-cpp.appspot.com/), hence also in V8. The only restriction is that it has to compile in GCC 4.8 (and all the other compilers we use on the bots). GCC 4.8 only supports C++11, so all code used by this compiler has to compile with c++11.

    If CI is green, I'll start a new run with -std=gnu++11 with the canary branch. If it is still green, I'll submit a PR to core.

  10. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    Canary build: https://ci.nodejs.org/view/MyJobs/job/node-test-commit-node-v8/193/

    Edit: that obviously does not work :(

  11. targos commented on Oct 25, 2017

    @targos
    MemberAuthor

    It's looking good on osx with -std=gnu++14.

    Here is a proposition that should work:

    • Build with -std=gnu++11 in GCC
    • Build with -std=gnu++14 in LLVM (including osx and freebsd)

    @refack do you think it's possible to modify common.gypi do achieve that?

  12. refack commented on Oct 25, 2017

    @refack
    Contributor

    @refack do you think it's possible to modify common.gypi do achieve that?

    Yep, I'll make a PR

  13. refack commented on Oct 25, 2017

    @refack
    Contributor

    refack/node@master...higher-c++-ver-by-default

    https://ci.nodejs.org/job/node-test-commit/13465/

    For now I see that freebsd10 is not happy - error: invalid value 'c++14' in '-std=c++14'

  14. bnoordhuis commented on Oct 26, 2017

    @bnoordhuis
    Member

    changing the global GCC changes the global stdlib++

    Right, that might be a problem. Technically it already matters if you compile with 4.8.2 or 4.8.3 (libstdc++ 6.0.18 vs. 6.0.19; 4.9 is 6.0.20) but yeah.

  15. fhinkel commented on Jan 15, 2018

    @fhinkel

    I know this is closed already, but I would very much like it if we could go up to GCC 4.9. We can't use a bunch of C++14 feature in V8, because then Node wouldn't compile anymore with 4.8.

  16. targos commented on Jan 15, 2018

    @targos
    MemberAuthor

    @fhinkel do you mind opening a new issue? IMO It's important that we arrive to a conclusion before the release of Node 10.

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