[cfe-dev] Changing the way Clang's driver computes the library search paths on Linux
chandlerc at google.com
Mon Oct 3 09:09:40 PDT 2011
On Sun, Oct 2, 2011 at 11:44 AM, David Chisnall <csdavec at swan.ac.uk> wrote:
> > I'm still happy for you to propose patches using -B, but they need to not
> break existing use cases.
> It would help if you told me WHAT didn't work with my last patch. I added
> = to the start of a couple of paths. If -B is not specified, then this
> should have no effect. If -B is specified and the searched-for files do not
> exist in that location, then it should still have no effect...
When -B was not specified, there was an '=' prefixing those paths as handed
to the linker. You can see this by running clang with '-###'. That's why I
checked in the test case I did afterward. Also, when -B is not specified,
GCC does the exact same thing, passing the '=' prefixed paths down to the
>From my commit message that did the revert:
The manual pages for 'ld' on Linux mention translating a '=' at the
> beginning of the path into a *configure time* sysroot prefix (this is,
> I believe, distinct from the --sysroot flag which 'ld' also can
> support). I tested this with a normal binutils 'ld', a binutils 'ld'
> with the sysroot flag enabled, and gold with the sysroot flag enabled,
> and all of them try to open the path '=/lib/../lib32', No translation
I think at the very least inserting an '=' needs to be conditioned on
> some indication that it is supported and desired. I'm also curious to
> see what toolchain and whan environment cause it to actually make
> a difference.
As you can see, just inserting a '=' prefix isn't viable. There needs to be
some conditioning or some translation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev