[cfe-dev] Clang and multilib search paths

Armin K. via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 20 15:59:28 PDT 2016


On 20.07.2016 19:33, Armin K. via cfe-dev wrote:
> Hi again,
> 
> This is a follow up from the previous thread.
> 
> When I use crtbegin.S and crtend.S for x86_64 from OpenBSD, and
> place the assembled *.o files in /usr/lib/clang/3.9.0, I can
> compile a 64 bit program, and it will use crtbegin.o and crtend.o
> from /usr/lib/clang/3.9.0, which I can confirm by running clang
> with -v.
> 
> However, this is also a multilib system. I have 32 bit clang
> runtime in /usr/lib32/clang/3.9.0. If I assemble crtbegin.S and
> crtend.S for i386, and place them in the mentioned dir, clang
> won't pick them up. It tries to use ones from /usr/lib/clang/3.9.0
> when compiling a test program with clang -m32.
> 
> Everything's okay and it picks up gcc's 32 bit files just fine. And,
> of course, it works too when I explicitly use -B/usr/lib32/clang/3.9.0.
> 
> So, the question is:
> 
> How to make clang automatically search /usr/lib32/clang/3.9.0? or
> Is there another directory the 32 bit files should be placed in?
> 
> Thanks in advance!
> 

After spending some hours on hacking the clang source, I came up
with the following patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-runtime.patch
Type: text/x-patch
Size: 2425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160721/c2e3792c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160721/c2e3792c/attachment.sig>


More information about the cfe-dev mailing list