[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-13 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 181484. mgorny marked 7 inline comments as done. mgorny set the repository for this revision to rLLD LLVM Linker. mgorny added a comment. Herald added a subscriber: fedor.sergeev. Split target logic into D56650 , switched to us

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-13 Thread Michał Górny via Phabricator via cfe-commits
mgorny added inline comments. Comment at: ELF/Driver.cpp:770 + // Start with a default initial triple + Config->TargetTriple = llvm::Triple(getDefaultTargetTriple()); + krytarowski wrote: > krytarowski wrote: > > arichardson wrote: > > > arichardson wrote: > >

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1350179 , @ruiu wrote: > To be honest, I don't think I would lgtm a patch that changes lld's default > behavior depending on host/target only for NetBSD, and it seems like a > NetBSD's issue rather than an lld's iss

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. Actually probably Linux MIPS used it and some proprietary OSes.. but we skip them for now. Only FreeBSD sets OSABI in lld and uses an emulation name detection hack. Once we will get merged TripleTarget detection we can switch it to use proper Triple check. CHANGES

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. Right, I'm not aware of anyone but FreeBSD really using the OSABI field. For FreeBSD it was a long standing hack around limitations in the ELF kernel loader. I'm not even sure if FreeBSD use(d) to set the OSABI field for the intermediate object files. CHANGES SINCE LAST

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:375 +switch (Config->EMachine) { + case EM_386: +Config->SearchPaths.push_back("=/usr/lib/i386"); As we have TargetTriple now, I would use it here instead of `Config->EMachine`, it wi

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1354603 , @krytarowski wrote: > @mgorny could you check if we can get crossbuilding functional for: > > - to !NetBSD from NetBSD > - from !NetBSD to NetBSD. > - from NetBSD/amd64 to NetBSD/aarch64 > > I wonder wheth

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. @mgorny could you check if we can get crossbuilding functional for: - to !NetBSD from NetBSD - from !NetBSD to NetBSD. - from NetBSD/amd64 to NetBSD/aarch64 I wonder whether it can work if we will keep using 'ld' file name for a linker. Comment at

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:770 + // Start with a default initial triple + Config->TargetTriple = llvm::Triple(getDefaultTargetTriple()); + krytarowski wrote: > arichardson wrote: > > arichardson wrote: > > > If I invoke an unp

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:770 + // Start with a default initial triple + Config->TargetTriple = llvm::Triple(getDefaultTargetTriple()); + arichardson wrote: > arichardson wrote: > > If I invoke an unprefixed ld.lld on NetBSD

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson requested changes to this revision. arichardson added inline comments. This revision now requires changes to proceed. Comment at: ELF/Driver.cpp:770 + // Start with a default initial triple + Config->TargetTriple = llvm::Triple(getDefaultTargetTriple()); + -

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 181268. mgorny added a comment. Implemented checking the triple against target registry. Also made `--version` output the detected target. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 Files: ELF/Config.

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-11 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added inline comments. Comment at: ELF/Driver.cpp:779 +// TODO: verify the triple somehow? +Config->TargetTriple = llvm::Triple(Prefix); + } mgorny wrote: > joerg wrote: > > See ToolChain::getTargetAndModeFromProgramName in clang. > Yes, I've based

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-10 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. @joerg if you think that this patch is OK, please click accept so we can be aware that this is what you want. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 ___ cfe-com

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-09 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 180886. mgorny added a comment. Adjusted to make paths sysroot-relative. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 Files: ELF/Config.h ELF/Driver.cpp ELF/Driver.h Index: ELF/Driver.h ===

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via cfe-commits
On Wed, Jan 09, 2019 at 12:20:06AM +, Kamil Rytarowski via Phabricator via llvm-commits wrote: > krytarowski added inline comments. > > > > Comment at: ELF/Driver.cpp:781 > + } > +} > + > > There is need to add a fallback for a native triple. Not really. T

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:781 + } +} + There is need to add a fallback for a native triple. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 ___

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via cfe-commits
On Tue, Jan 08, 2019 at 10:58:37PM +, Alexander Richardson via Phabricator via cfe-commits wrote: > arichardson added inline comments. > > > > Comment at: ELF/Driver.cpp:770 > + // Start with a default initial triple > + Config->TargetTriple = llvm::Triple(getDefaultTarget

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added inline comments. Comment at: ELF/Driver.cpp:770 + // Start with a default initial triple + Config->TargetTriple = llvm::Triple(getDefaultTargetTriple()); + If I invoke an unprefixed ld.lld on NetBSD but want to target a different operating sy

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. I want to handle NetBSD in the same way as the other operating systems. I'm sorry to have been saying no to a few recent patches for NetBSD, but I think that's for a good reason, and I don't think you presented a convincing reason why we had to handle only NetBSD different

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added inline comments. Comment at: ELF/Driver.cpp:381 +} +Config->SearchPaths.push_back("/usr/lib"); + } Those need to be sysroot-relative of course. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D5621

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. @ruiu: No, it is exactly what you want, since it allows you to point lld into the normal sysroot. Cross-compiling is the default case for the NetBSD toolchain. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 __

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1350134 , @joerg wrote: > Thanks, this looks like a good starting point. What's the final state you want? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 __

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. To be honest, I don't think I would lgtm a patch that changes lld's default behavior depending on host/target only for NetBSD, and it seems like a NetBSD's issue rather than an lld's issue. As I said, could you please make an effort to pass the flags you need from the comp

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. I'm sorry to say this but I don't think this is a good approach. Just like changing the default behavior depending on host hurts cross-build and is against the policy of the lld driver, changing the default behavior depending on the target hurts it too. Imagine that you ar

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked an inline comment as done. mgorny added inline comments. Comment at: ELF/Driver.cpp:779 +// TODO: verify the triple somehow? +Config->TargetTriple = llvm::Triple(Prefix); + } joerg wrote: > See ToolChain::getTargetAndModeFromProgramName in

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added inline comments. Comment at: ELF/Driver.cpp:779 +// TODO: verify the triple somehow? +Config->TargetTriple = llvm::Triple(Prefix); + } See ToolChain::getTargetAndModeFromProgramName in clang. CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. Thanks, this looks like a good starting point. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-08 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 180717. mgorny added a comment. Next version, based on recognizing NetBSD from triple. @joerg, is this a better approach? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 Files: ELF/Config.h ELF/Driver.cp

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-07 Thread Ed Maste via Phabricator via cfe-commits
emaste added a comment. > There is a list of 140-150 unsafe (LLD_UNSAFE) packages with LLD. Some of these are tagged with a PR or comment explaining why they are LLD_UNSAFE, but we haven't done it consistently. Some of these 140-150 were probably added in the early days of bringing lld into Fre

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-05 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. I've grepped FreeBSD, OpenBSD and pkgsrc. OpenBSD ports = Total 2 packages there have issues with LLD. $ grep -r USE_LLD . ./devel/libcoap/Makefile:USE_LLD= No ./sysutils/firmware/vmm/Makefile:USE_LLD= No FreeBSD ports =

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-04 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. In D56215#1345880 , @krytarowski wrote: > In D56215#1345845 , @ruiu wrote: > > > Not sure what I understand the point, but as to make lld work on/for > > NetBSD, I wonder if you can just add -

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-04 Thread Joerg Sonnenberger via cfe-commits
On Fri, Jan 04, 2019 at 02:48:35PM +, Alexander Richardson via Phabricator wrote: > Or if you really need to call the linker directly without specifying > search paths you could also install a shell script as /usr/bin/ld that > passes the appropriate flags to /usr/bin/ld.lld? That's not a hon

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-04 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1346342 , @arichardson wrote: > In D56215#1346061 , @mgorny wrote: > > > For the record, another option is to actually fix other software not to > > call LD directly. > > > Or

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-04 Thread Joerg Sonnenberger via cfe-commits
On Fri, Jan 04, 2019 at 05:52:46AM +, Michał Górny via Phabricator via llvm-commits wrote: > mgorny added a comment. > > For the record, another option is to actually fix other software not to call > LD directly. See thousand monkeys. It doesn't really scale. Joerg

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-04 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added a comment. In D56215#1346061 , @mgorny wrote: > For the record, another option is to actually fix other software not to call > LD directly. Or if you really need to call the linker directly without specifying search paths you could al

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. For the record, another option is to actually fix other software not to call LD directly. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 ___ cfe-commits mailing list cfe-com

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1345845 , @ruiu wrote: > Not sure what I understand the point, but as to make lld work on/for NetBSD, > I wonder if you can just add -L to the command line in the compiler > driver. Isn't a NetBSD triple passed to t

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. Not sure what I understand the point, but as to make lld work on/for NetBSD, I wonder if you can just add -L to the command line in the compiler driver. Isn't a NetBSD triple passed to the compiler driver? If so, I wonder if you can add a few extra options when invoking th

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. Actually I think that we can handle two cases witch a combination of proposals: - native mode - cross mode For the native mode we go for something like: #if defined(__NetBSD__) #define NATIVE_TARGET LLD_NETBSD #else ... and for cross mode read `argv[0]` to

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1345695 , @ruiu wrote: > In D56215#1345417 , @joerg wrote: > > > Talking from the perspective of having had to deal with thousands of > > packages in pkgsrc over the years: it

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jan 03, 2019 at 10:26:38PM +, Rui Ueyama via Phabricator via cfe-commits wrote: > I see there are pros and cons to not have host-specific config in ld. > That said, if other operating systems can live without host-specific > config in lld, why can't NetBSD do? I really don't like to be

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. In D56215#1345417 , @joerg wrote: > Talking from the perspective of having had to deal with thousands of packages > in pkgsrc over the years: it is naive to believe that there isn't a lot of > software that calls the linker directly

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. On 03.01.2019 23:15, Joerg Sonnenberger wrote: > On Thu, Jan 03, 2019 at 09:38:49PM +, Kamil Rytarowski via Phabricator via cfe-commits wrote: >> I think that this place is not the right place to bash GNU ld for performance issues. > > I didn't. >

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jan 03, 2019 at 09:38:49PM +, Kamil Rytarowski via Phabricator via cfe-commits wrote: > I think that this place is not the right place to bash GNU ld for performance > issues. I didn't. > I will refer just to slides and paper from Ian Lance Taylor to get overview > why it is unacce

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. On Thu, Jan 03, 2019 at 08:31:53PM +, Kamil Rytarowski via Phabricator via cfe-commits wrote: > krytarowski added a comment. > > On 03.01.2019 21:19, Joerg Sonnenberger wrote: > >> On Thu, Jan 03, 2019 at 06:34:22PM +, Kamil Rytarowski via Phabrica

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. I think that ifdefining the linker options with `__NetBSD__` is no-go. In D56215#1345563 , @mgorny wrote: > We've discussed this a bit and given other changes we need to do, and I see > pretty much three options here: > > 1.

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jan 03, 2019 at 08:31:53PM +, Kamil Rytarowski via Phabricator via cfe-commits wrote: > krytarowski added a comment. > > On 03.01.2019 21:19, Joerg Sonnenberger wrote: > > > On Thu, Jan 03, 2019 at 06:34:22PM +, Kamil Rytarowski via Phabricator > > via cfe-commits wrote: > > >

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. We've discussed this a bit and given other changes we need to do, and I see pretty much three options here: 1. We hardcode stuff under `defined(__NetBSD__)` which kinda solves the problem, except lld won't be very cross-friendly. 2. We try to do conditionals based on tri

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. On 03.01.2019 21:19, Joerg Sonnenberger wrote: > On Thu, Jan 03, 2019 at 06:34:22PM +, Kamil Rytarowski via Phabricator > via cfe-commits wrote: > >> krytarowski added a comment. >> >> Actually I find it frustrating and unfair as GNU ld doesn't have builtin >>

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jan 03, 2019 at 06:58:41PM +, Kamil Rytarowski via Phabricator wrote: > But the result is that we don't have GNU gold either and are stuck with > 40min linking times of LLVM. It's destructive to productivity and > damages any LLVM related development. The reason noone cared much about

Re: [PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via cfe-commits
On Thu, Jan 03, 2019 at 06:34:22PM +, Kamil Rytarowski via Phabricator via cfe-commits wrote: > krytarowski added a comment. > > Actually I find it frustrating and unfair as GNU ld doesn't have builtin > knowledge either.. it's passed with gross 'super hack' comments from build > scripts...

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 180121. mgorny edited the summary of this revision. mgorny added a comment. Removed non-x86. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 Files: ELF/Driver.cpp ELF/Driver.h Index: ELF/Driver.h ==

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny marked an inline comment as done. mgorny added inline comments. Comment at: ELF/Driver.cpp:369 +void LinkerDriver::appendDefaultSearchPaths() { +#if defined(__NetBSD__) + // NetBSD driver relies on the linker knowing the default search paths. krytarowski

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:369 +void LinkerDriver::appendDefaultSearchPaths() { +#if defined(__NetBSD__) + // NetBSD driver relies on the linker knowing the default search paths. is it possible to use some Triple NetBSD target

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added inline comments. Comment at: ELF/Driver.cpp:377 + break; +case EM_MIPS: + if (Config->EKind == ELF64LEKind || Config->EKind == ELF64BEKind) Please drop MIPS/PPC for now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Michał Górny via Phabricator via cfe-commits
mgorny updated this revision to Diff 180114. mgorny edited the summary of this revision. mgorny added a comment. Herald added subscribers: atanasyan, sdardis. Updated to use clang's libdir logic. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 F

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. We will prepare a patch for i386 x86_64 only for now. Until we will get lld fully functional on NetBSD/amd64 we will skip other architectures. Repository: rLLD LLVM Linker CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. Talking from the perspective of having had to deal with thousands of packages in pkgsrc over the years: it is naive to believe that there isn't a lot of software that calls the linker directly for various reasons. As such, it is very important to have a useful configurati

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1345400 , @ruiu wrote: > Joerg, what is special about NetBSD? Nothing. But the result is that we don't have GNU gold either and are stuck with 40min linking times of LLVM. It's destructive to productivity and dama

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. I sympathize and understand your frustration, but I don't know what I can do to you. The thing that lld doesn't have host-specific config is a policy matter we've been maintaining so far for all operating systems. I don't think NetBSD should be the only exception of the po

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. Actually I find it frustrating and unfair as GNU ld doesn't have builtin knowledge either.. it's passed with gross 'super hack' comments from build scripts... but we are forced to push it to lld in order to move on. Repository: rLLD LLVM Linker CHANGES SINCE LAS

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. It's an option but Joerg insists on using lld standalone. Repository: rLLD LLVM Linker CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56215/new/ https://reviews.llvm.org/D56215 ___ cfe-commits mailing list cfe

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. As you can see, lld doesn't really have any host-dependent knowledge so far, even though there are a few OSes that use lld as the default linker. We've added host-dependent knowledge to the compiler driver instead of to the linker for various operating systems. I guess tha

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1345326 , @ruiu wrote: > In D56215#1344279 , @krytarowski > wrote: > > > In D56215#1344233 , @ruiu wrote: > > > > > lld's driver is in

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-03 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. In D56215#1344279 , @krytarowski wrote: > In D56215#1344233 , @ruiu wrote: > > > lld's driver is intentionally designed to be agnostic of the host that the > > linker is running for the reason

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. I assume that we need to reimplement this in the context of lld: NetBSD::NetBSD(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { if (!Args.hasArg(options::OPT_nostdlib)) { // When targeting a 32-bit

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1344317 , @joerg wrote: > In D56215#1344279 , @krytarowski > wrote: > > > In D56215#1344183 , @joerg wrote: > > > > > This doesn't see

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. In D56215#1344279 , @krytarowski wrote: > In D56215#1344183 , @joerg wrote: > > > This doesn't seem a reasonable approach at all: > > > > (1) It breaks cross-linking. > > (2) It is not correc

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. In D56215#1344233 , @ruiu wrote: > lld's driver is intentionally designed to be agnostic of the host that the > linker is running for the reasons described at the beginning of Driver.cpp: > https://github.com/llvm-project/lld

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. lld's driver is intentionally designed to be agnostic of the host that the linker is running for the reasons described at the beginning of Driver.cpp: https://github.com/llvm-project/lld/blob/master/ELF/Driver.cpp#L13 I think I like that approach. If you need to do this, y

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. This doesn't seem a reasonable approach at all: (1) It breaks cross-linking. (2) It is not correct for any target architecture, e.g. /usr/local/lib certainly doesn't belong on this list and /lib doesn't either. (3) The correct list depends not only on the target architectu

[PATCH] D56215: [lld] [ELF] Include default search paths for NetBSD driver

2019-01-02 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision. mgorny added reviewers: krytarowski, joerg, ruiu, grimar, espindola. mgorny added a project: lld. Herald added subscribers: llvm-commits, MaskRay, arichardson, emaste. The NetBSD clang driver relies on NetBSD ld knowing the default search paths and never passes those