Skip to content

build: use libc++ with clang on Travis - #23791

Closed
richardlau wants to merge 10 commits into
nodejs:masterfrom
richardlau:travis-compiler
Closed

build: use libc++ with clang on Travis#23791
richardlau wants to merge 10 commits into
nodejs:masterfrom
richardlau:travis-compiler

Conversation

@richardlau

Copy link
Copy Markdown
Member

Testing alternative fix for #23778.

Checklist

@richardlaurichardlau added the wip Issues and PRs that are still a work in progress. label Oct 21, 2018
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@richardlau

Copy link
Copy Markdown
MemberAuthor

Did not appear to work 😞

@richardlau

Copy link
Copy Markdown
MemberAuthor

Trying more things.

@refack

Copy link
Copy Markdown
Contributor

Did you try upgrading stdlibc++ to 4.9?

@richardlau

Copy link
Copy Markdown
MemberAuthor

@refack I'm trying to see if we can actually use clang (as we're attempting to). If we have to install packages then #23778 already covers this.

@refack

Copy link
Copy Markdown
Contributor

I'm trying to see if we can actually use clang (as we're attempting to). If we have to install packages then #23778 already covers this.

From #23778 (comment) it seems that it does use clang, only it links against the GCC libstdc++-4.8, which has a bug.
(Run make with V=1 to see which compiler is actually used)

@refack

Copy link
Copy Markdown
Contributor

There's -stdlib=libc++ that supposedly tell clang to use it's own libc++

@refack

Copy link
Copy Markdown
Contributor

It works!

@richardlau

Copy link
Copy Markdown
MemberAuthor

It works!

😮. Going to sleep now, but next steps will be to see if all the environment variable changes were necessary. Maybe also -stdlib=libc++ should be set in CXXFLAGS instead of CXX.

@richardlaurichardlau changed the title build: fix compiler selection on Travis buildsbuild: use libc++ with clang on TravisOct 21, 2018
@richardlau

Copy link
Copy Markdown
MemberAuthor

Travis overrides the CC/CXX env vars set under the env: key in the matrix:

image

@richardlau

richardlau commented Oct 24, 2018

Copy link
Copy Markdown
MemberAuthor

This PR allows Travis to build with clang without installing any other packages by making it use libc++ instead of libstdc++. Although it works I'm closing this as this is a non-standard way of building (we only normally use libc++ on macOS) and #23778 better replicates the supported toolchains (gcc 4.9.4 or later) in https://github.com/nodejs/node/blob/master/BUILDING.md#supported-toolchains.

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

Labels

wipIssues and PRs that are still a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@richardlau@nodejs-github-bot@refack