Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-22 Thread Nico Weber via cfe-commits
After some discussion on IRC, we agreed to give https://reviews.llvm.org/D26984 a try. On Tue, Nov 22, 2016 at 11:41 AM, Mehdi Amini wrote: > This has been like that forever, this is not new with 3.9. > Note also that the system ar/ranlib are sensitive to the environment > DYLD_LIBRARY_PATH and

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-22 Thread Mehdi Amini via cfe-commits
This has been like that forever, this is not new with 3.9. Note also that the system ar/ranlib are sensitive to the environment DYLD_LIBRARY_PATH and will look for libLTO appropriately (since they aren’t invoked with clang, we haven’t been able to do any “magic” here yet). — Mehdi > On Nov 22,

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-22 Thread Jack Howarth via cfe-commits
I would also note that llvm 3.9.x and 4.0svn also require use of their own llvm-ar and llvm-ranlib for archiving under -flto as well (beyond using the matching libLTO.dylib). On Tue, Nov 22, 2016 at 12:59 AM, Mehdi Amini wrote: > Double-checked on the latest binary release on llvm.org, it ships w

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi Amini via cfe-commits
Double-checked on the latest binary release on llvm.org, it ships with clang+llvm-3.9.0-x86_64-apple-darwin/lib/libLTO.dylib I also can’t find any CMake option that disable LTO support at build time for clang. > On Nov 21, 2016, at 9:53 PM, Mehdi Amini via cfe-commits > wrote: > > AFAIK any

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi Amini via cfe-commits
AFAIK any clang build open-source ships with libLTO. Not having libLTO built with clang is a Chromium oddity, unless I missed the obvious somewhere. > On Nov 21, 2016, at 9:50 PM, Nico Weber wrote: > > In what way is this chromium specific? It's "all non-xcode uses of clang on > mac", no? >

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Nico Weber via cfe-commits
In what way is this chromium specific? It's "all non-xcode uses of clang on mac", no? On Nov 21, 2016 7:29 PM, "Mehdi Amini" wrote: > > On Nov 21, 2016, at 2:44 PM, Nico Weber wrote: > > On Mon, Nov 21, 2016 at 5:34 PM, Mehdi Amini > wrote: > >> >> On Nov 21, 2016, at 2:27 PM, Nico Weber wrot

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi Amini via cfe-commits
> On Nov 21, 2016, at 4:29 PM, Mehdi Amini wrote: > >> >> On Nov 21, 2016, at 2:44 PM, Nico Weber > > wrote: >> >> On Mon, Nov 21, 2016 at 5:34 PM, Mehdi Amini > > wrote: >> >>> On Nov 21, 2016, at 2:27 PM, Nico Weber >>

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi Amini via cfe-commits
> On Nov 21, 2016, at 2:44 PM, Nico Weber wrote: > > On Mon, Nov 21, 2016 at 5:34 PM, Mehdi Amini > wrote: > >> On Nov 21, 2016, at 2:27 PM, Nico Weber > > wrote: >> >> On Mon, Nov 21, 2016 at 5:19 PM, Mehdi AMINI via cfe-commits >> m

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Reid Kleckner via cfe-commits
rnk added a comment. What if we only warn if `D.isUsingLTO()`? Things are only going to go wrong if *this* version of clang generates LLVM IR not understood by the system libLTO. Presumably bitcode from static archives will work with the system version of libLTO. Repository: rL LLVM https:

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Nico Weber via cfe-commits
On Mon, Nov 21, 2016 at 5:34 PM, Mehdi Amini wrote: > > On Nov 21, 2016, at 2:27 PM, Nico Weber wrote: > > On Mon, Nov 21, 2016 at 5:19 PM, Mehdi AMINI via cfe-commits lists.llvm.org> wrote: > >> mehdi_amini added a comment. >> >> In https://reviews.llvm.org/D25932#601842, @rnk wrote: >> >> > I

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi Amini via cfe-commits
> On Nov 21, 2016, at 2:27 PM, Nico Weber wrote: > > On Mon, Nov 21, 2016 at 5:19 PM, Mehdi AMINI via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > mehdi_amini added a comment. > > In https://reviews.llvm.org/D25932#601842 > , @rnk wrote: >

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Reid Kleckner via cfe-commits
rnk added a comment. Maybe we should `touch ../lib/libLTO.dylib` relative to clang in our package and just let the loader fail if a bitcode file comes along. Repository: rL LLVM https://reviews.llvm.org/D25932 ___ cfe-commits mailing list cfe-co

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Nico Weber via cfe-commits
On Mon, Nov 21, 2016 at 5:19 PM, Mehdi AMINI via cfe-commits < cfe-commits@lists.llvm.org> wrote: > mehdi_amini added a comment. > > In https://reviews.llvm.org/D25932#601842, @rnk wrote: > > > In https://reviews.llvm.org/D25932#601820, @mehdi_amini wrote: > > > > > We ship `clang + libLTO + ld64`

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi AMINI via cfe-commits
mehdi_amini added a comment. In https://reviews.llvm.org/D25932#601842, @rnk wrote: > In https://reviews.llvm.org/D25932#601820, @mehdi_amini wrote: > > > We ship `clang + libLTO + ld64` bundled in the toolchain, so even if you > > don't package libLTO yourself, it is already accessible from the

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Reid Kleckner via cfe-commits
rnk added a comment. In https://reviews.llvm.org/D25932#601820, @mehdi_amini wrote: > We ship `clang + libLTO + ld64` bundled in the toolchain, so even if you > don't package libLTO yourself, it is already accessible from the linker: it > will use the one in the toolchain when needed. > > I don

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Mehdi AMINI via cfe-commits
mehdi_amini added a comment. We ship `clang + libLTO + ld64` bundled in the toolchain, so even if you don't package libLTO yourself, it is already accessible from the linker: it will use the one in the toolchain when needed. I don't have an immediate idea to prevent this and have the linker iss

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Nico Weber via cfe-commits
(In addition to rnk's question: We build with -Werror, but Wliblto seems unaffected by this. Because of that, our bots didn't catch the new warning and we only noticed this when a human did a local build after we updated compilers and saw a wall of warnings. It'd be good if Wliblto was affected by

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-11-21 Thread Reid Kleckner via cfe-commits
rnk added a comment. This added a bunch of warnings to the Chromium build, which doesn't use LTO today, so we had to revert our clang roll: https://codereview.chromium.org/2520453002/ We currently don't use LTO on Mac, so we don't build or package the LTO plugin, and in the near term aren't pla

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Jack Howarth via cfe-commits
jwhowarth added a comment. In https://reviews.llvm.org/D25932#581167, @mehdi_amini wrote: > I just verified that I reproduce with -flto and an previous clang version. This issue will only be triggered if you build with "-DCMAKE_INSTALL_PREFIX:PATH=/sw/opt/llvm-4.0" to place llvm in a buried s

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Mehdi AMINI via cfe-commits
mehdi_amini added a comment. I reproduced with clang that ships with XCode by doing: ln -s `xcrun -find clang` /tmp/clang /tmp/clang /tmp/main.cpp -flto clang: warning: libLTO.dylib relative to clang installed dir not found; using 'ld' default search path instead ` Repos

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Jack Howarth via cfe-commits
jwhowarth added a comment. Opened https://llvm.org/bugs/show_bug.cgi?id=30811 since the inability for symlinks to be handled in locating libLTO.dylib defeats the purpose of this commit. Repository: rL LLVM https://reviews.llvm.org/D25932 ___ cf

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Mehdi AMINI via cfe-commits
mehdi_amini added a comment. I just verified that I reproduce with -flto and an previous clang version. Repository: rL LLVM https://reviews.llvm.org/D25932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Mehdi AMINI via cfe-commits
mehdi_amini added a comment. Since you re-open this revision, can you clarify how this is triggering the bug you mention? It seems like the issue already existed? Repository: rL LLVM https://reviews.llvm.org/D25932 ___ cfe-commits mailing list c

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-27 Thread Jack Howarth via cfe-commits
jwhowarth reopened this revision. jwhowarth added a comment. This approach doesn't work if the user installs clang in a buried subdirectory such as /sw/opt/llvm-4.0 but accesses the compilers via a /sw/bin/clang-4.0 symlink pointing at /sw/opt/llvm-4.0/bin/clang-4.0... $ /sw/bin/clang-4.0 -flto

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-26 Thread Mehdi AMINI via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL285254: Unconditionally pass `-lto_library` to the linker on Darwin (authored by mehdi_amini). Changed prior to commit: https://reviews.llvm.org/D25932?vs=75668&id=75963#toc Repository: rL LLVM http

Re: [PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-25 Thread Duncan P. N. Exon Smith via cfe-commits
> On 2016-Oct-24, at 21:43, Mehdi AMINI wrote: > > mehdi_amini created this revision. > mehdi_amini added a reviewer: dexonsmith. > mehdi_amini added a subscriber: cfe-commits. > > We're only doing it with -flto currently, however it never "hurt" > to pass it, and users that are linking without

[PATCH] D25932: Unconditionally pass `-lto_library` to the linker on Darwin

2016-10-24 Thread Mehdi AMINI via cfe-commits
mehdi_amini created this revision. mehdi_amini added a reviewer: dexonsmith. mehdi_amini added a subscriber: cfe-commits. We're only doing it with -flto currently, however it never "hurt" to pass it, and users that are linking without -flto can get in trouble if one of the dependency (a static lib