Skip to content
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

Add patch for LLVM-3.9+Clang+macOS Sierra #18920

Merged
merged 1 commit into from
Oct 22, 2017
Merged

Add patch for LLVM-3.9+Clang+macOS Sierra #18920

merged 1 commit into from
Oct 22, 2017

Conversation

andreasnoack
Copy link
Member

Removes hardcoded lower version bounds incompatible with Sierra
in CMake file for compiler-rt

This seems to necessary to build Clang on Sierra with LLVM 3.9.

cc: @vchuravy who diagnosed the issue.

@tkelman
Copy link
Contributor

tkelman commented Oct 14, 2016

Was this submitted / already fixed upstream?

@andreasnoack
Copy link
Member Author

No. It's still there on master https://github.com/llvm-mirror/compiler-rt/blob/master/cmake/builtin-config-ix.cmake#L57. They might have different backward compatibility requirements so maybe they want a different patch.

@kshyatt kshyatt added building Build system, or building Julia or its dependencies system:mac Affects only macOS labels Oct 14, 2016
@@ -0,0 +1,33 @@
--- a/projects/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/projects/compiler-rt/cmake/builtin-config-ix.cmake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this path always present in the llvm tarball, or can this patch only be applied if clang/compiler-rt is being built?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know. Will check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the patch conditional on building Clang.

@stevengj
Copy link
Member

I can confirm that this patch allowed LLVM to build for me (fixing an "invalid deployment target" error) on 10.12.2.

@tkelman
Copy link
Contributor

tkelman commented Dec 30, 2016

just needs to be opened as an issue or sent as a patch upstream. what are we doing that makes this a problem that every clang developer at Apple hasn't hit?

@StefanKarpinski
Copy link
Member

what are we doing that makes this a problem that every clang developer at Apple hasn't hit?

somehow this happens to us with everything we use – especially LLVM.

@ihnorton
Copy link
Member

what are we doing that makes this a problem that every clang developer at Apple hasn't hit?

Adding -stdlib=libc++? On my system (10.11 / SDK10.12), removing that option from a failing command line, see below, gets rid of the error (clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)).

cd /Users/inorton/git/julia/deps/scratch/llvm-3.9.1/build_Release/projects/compiler-rt/lib/builtins && /usr/bin/clang -stdlib=libc++ -mmacosx-version-min=10.8 -m64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/inorton/git/julia/deps/scratch/llvm-3.9.1/build_Release/projects/compiler-rt/lib/builtins -I/Users/inorton/git/julia/deps/srccache/llvm-3.9.1/projects/compiler-rt/lib/builtins -I/Users/inorton/git/julia/deps/scratch/llvm-3.9.1/build_Release/include -I/Users/inorton/git/julia/deps/srccache/llvm-3.9.1/include  -O3 -DNDEBUG -arch i386    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.5 -arch i386 -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -o CMakeFiles/clang_rt.eprintf.dir/eprintf.c.o   -c /Users/inorton/git/julia/deps/srccache/llvm-3.9.1/projects/compiler-rt/lib/builtins/eprintf.c

@stevengj
Copy link
Member

stevengj commented May 27, 2017

Bump? I just had

clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)

again on a fresh install.

@tkelman
Copy link
Contributor

tkelman commented May 27, 2017

Adding -stdlib=libc++?

Wonder whether the buildbots are new enough to get away with leaving that off. Aren't we setting our deployment target to something 10.7 or later, does it not overrule the flags clang is setting that this patch gets rid of?

These look like they're still getting set upstream on trunk https://github.com/llvm-mirror/compiler-rt/blob/master/cmake/builtin-config-ix.cmake so we should raise the issue or patch to figure out if these still need to be set so old upstream.

@stevengj
Copy link
Member

This patch still fixes the compilation problem for me.

@tkelman
Copy link
Contributor

tkelman commented May 27, 2017

And I'm still fine with merging this, as soon as it gets opened as an issue or patch upstream

@stevengj
Copy link
Member

Ping.

@ViralBShah
Copy link
Member

We should merge this if it fixes things, and undo it when upstream fixes it.

@tkelman
Copy link
Contributor

tkelman commented Oct 22, 2017

It's unlikely to ever get fixed upstream if it never gets reported to them. There might be a better solution in terms of build flags that wouldn't require indefinitely carrying a patch to LLVM's build system (which would repeatedly need to be rebased).

Removes hardcoded lower version bounds incompatible with Sierra
in CMake file for compiler-rt
@stevengj
Copy link
Member

I just got clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) again when building the latest master. Shouldn't that have been fixed by this PR?

@stevengj
Copy link
Member

stevengj commented May 11, 2018

Oh, I see, we bumped to LLVM 6, and this patch was only for LLVM 3.9... Looks like the same patch should still work.

@tkelman
Copy link
Contributor

tkelman commented May 11, 2018

This is why I repeatedly said

fine with merging this, as soon as it gets opened as an issue or patch upstream

and

It's unlikely to ever get fixed upstream if it never gets reported to them. There might be a better solution in terms of build flags that wouldn't require indefinitely carrying a patch to LLVM's build system (which would repeatedly need to be rebased).

Please report things upstream instead of indefinitely carrying patches that only exist here. It's not difficult.

@vchuravy
Copy link
Member

Someone jog my memory here, is the issue that the Sierra toolchain doesn't support a minimum version as low as 10.5 and 10.4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:mac Affects only macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants