|
Message-ID: <CAMKF1spx+T-NswOGFYnbj9zzw+tO2ow4Ba5yPJmo10BbBK-ksg@mail.gmail.com> Date: Mon, 11 Oct 2021 10:20:22 -0700 From: Khem Raj <raj.khem@...il.com> To: musl@...ts.openwall.com Subject: Re: Newbie cross compiling with LLVM On Sun, Oct 10, 2021 at 4:22 PM Matt Andrews <mattandrews@...il.com> wrote: > > > Have try with setting passing AR=clang-ar? > > I actually set > > AR=/usr/lib/llvm-13/bin/llvm-ar > > Then I set > > RANLIB=/usr/lib/llvm-13/bin/llvm-ranlib > > That got me a little further down the road, but now I'm getting this error > > /usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi > Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe > clang: error: linker command failed with exit code 1 (use -v to see invocation) > > I added this to CFLAGS > > -B/usr/lib/llvm-13/bin > > But it still uses the system linker. > > How do I specify which linker to use? I guess you need a cross linker here if your -target option matches exactly with cross prefix it will find it. > > On Mon, 11 Oct 2021 at 09:44, Quentin Rameau <quinq@...th.space> wrote: >> >> > Hello everyone, >> >> Hi Matt, >> >> > I'm trying to cross compile from Ubuntu 20.04 to armv7a-linux-musleabihf >> > using LLVM. Configure looks like this >> > >> > ./configure \ >> > --prefix=$VECX/usr \ >> > --syslibdir=$VECX/lib \ >> > --target=armv7a-linux-eabihf \ >> > CC=/usr/lib/llvm-13/bin/clang \ >> > CFLAGS="--target=armv7a-linux-eabihf -mcpu=cortex-a8" >> > >> > Then >> > >> > make && make install >> > >> > The compilation fails with the following >> > >> > make: armv7a-linux-eabihf-ar: Command not found >> > make: *** [Makefile:167: lib/libc.a] Error 127 >> > >> > It's looking for an archiver from a cross compiler toolchain, but should be >> > using llvm-ar. >> > >> > Which configure options should I use to get LLVM to cross compile >> > successfully? >> >> Have try with setting passing AR=clang-ar?
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.