Skip to content

build: be more conservative when passing -target #19973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

compnerd
Copy link
Member

When building the swift tools with gcc, we would fail as we would try to
pass -target to gcc, which does not support this option. Invert the
condition and only pass the argument when building with clang.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

When building the swift tools with gcc, we would fail as we would try to
pass `-target` to gcc, which does not support this option.  Invert the
condition and only pass the argument when building with clang.
@compnerd
Copy link
Member Author

CC: @gottesmm

@compnerd
Copy link
Member Author

@swift-ci please test and merge

@gottesmm
Copy link
Contributor

LGTM

@gottesmm
Copy link
Contributor

Question. I am not that familiar how gcc handles this without the -target option?

@gottesmm
Copy link
Contributor

Question. How does gcc handle this without the -triple option? I.e. can you give me the bigger picture here.

@swift-ci swift-ci merged commit 474ecd5 into swiftlang:master Oct 22, 2018
@compnerd compnerd deleted the target branch October 22, 2018 15:49
@compnerd
Copy link
Member Author

@gottesmm - it can't, however, this is still "useful" for building just the tools. Unfortunately, I am now attempting to build with gcc 4.8, and that is not looking very good, I am finding there are constructs that we are using that gcc objects to and they are not easy to fix :/ I think that we really should setup a build bot to track the newer gcc builds if we want to keep the compiler itself fairly portable (which I think is a good thing to do).

@gottesmm
Copy link
Contributor

gottesmm commented Oct 22, 2018 via email

devincoughlin added a commit that referenced this pull request Oct 30, 2018
In #19973 the logic that adds "-target" when
building the C parts of the Standard Library and overlays was changed to use
CMAKE_C_COMPILER_ID to only do so when the compiler ID is "Clang". However,
on Apple toolchains the compiler ID is "AppleClang", so the target was no
longer being explicitly set.

Update the logic to relax the explicit check for "Clang" to also allow
"AppleClang".

rdar://problem/45579667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants