[cfe-dev] choosing the gcc toolchain

Reed Kotler rkotler at mips.com
Mon Mar 3 10:42:34 PST 2014


I reran with mip32. Seems to not work at all now.

   $ /home/rkotler/workspace/llvm/configure 
--prefix=/home/rkotler/caviumnativellv
m/install --without-llvmgcc --without-llvmgxx --enable-optimized 
--enable-asserti
ons --build=mips-linux-gnu --host=mips-linux-gnu --target=mips-linux-gnu 
--with-e
xtra-options=-mips32r2 --with-extra-ld-options=-mips32r2

## --------- ##
## Platform. ##
## --------- ##

hostname = mipsswbrd006-le
uname -m = mips64
uname -r = 3.4.27-rt37-Cavium-Octeon
uname -s = Linux
uname -v = #1 SMP Tue Mar 5 10:55:07 PST 2013


rkotler at mipsswbrd006-le:~/caviumnativellvm/build$ 
./Release+Asserts/bin/clang++ -v  ~/testmips16/helloworld.c
clang version 3.5 (gitosis at dmz-portal.mips.com:clang.git 
f4481e0e412e3f817e65d5ce1c835381dc7a7773) 
(gitosis at dmz-portal.mips.com:llvm.git 
18fe44cb057e4b11533bd3f814b96fdca724baf0)
Target: mips-unknown-linux-gnu
Thread model: posix
clang: warning: treating 'c' input as 'c++' when in C++ mode, this 
behavior is deprecated
  "/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/clang" -cc1 
-triple mips-unknown-linux-gnu -S -disable-free -main-file-name 
helloworld.c -mrelocation-model static -mdisable-fp-elim -fmath-errno 
-no-integrated-as -mconstructor-aliases -target-cpu mips32r2 -target-abi 
o32 -mfloat-abi hard -target-linker-version 2.22 -v -resource-dir 
/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/../lib/clang/3.5 -internal-isystem 
/usr/local/include -internal-isystem 
/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/../lib/clang/3.5/include 
-internal-externc-isystem /include -internal-externc-isystem 
/usr/include -fdeprecated-macro -fno-dwarf-directory-asm 
-fdebug-compilation-dir /home/rkotler/caviumnativellvm/build 
-ferror-limit 19 -fmessage-length 81 -mstackrealign -fobjc-runtime=gcc 
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp 
-o /tmp/helloworld-c25fe4.s -x c++ /home/rkotler/testmips16/helloworld.c
clang -cc1 version 3.5 based upon LLVM 3.5svn default target 
mips-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
 
/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/../lib/clang/3.5/include
  /usr/include
End of search list.
  "/usr/bin/as" -march mips32r2 -mabi 32 -EB -o /tmp/helloworld-a3608c.o 
/tmp/helloworld-c25fe4.s
  "/usr/bin/ld" --build-id --eh-frame-hdr -m elf32btsmip -dynamic-linker 
/lib/ld.so.1 -o a.out crt1.o crti.o crtbegin.o 
-L/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/../lib 
-L/lib/../lib -L/usr/lib/../lib 
-L/home/rkotler/caviumnativellvm/build/Release+Asserts/bin/../lib -L/lib 
-L/usr/lib /tmp/helloworld-a3608c.o -lstdc++ -lm -lgcc_s -lgcc -lc 
-lgcc_s -lgcc crtend.o crtn.o
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lstdc++
/usr/lib/mipsel-linux-gnu/libm.so: could not read symbols: File in wrong 
format
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
On 03/03/2014 07:27 AM, Simon Atanasyan wrote:
> On Mon, Mar 3, 2014 at 7:15 PM, reed kotler <rkotler-8NJIiSa5LzA at public.gmane.org> wrote:
>> rkotler at mipsswbrd006-le:~/caviumnativellvm/build$
>> ./Release+Asserts/bin/clang++ -v
>> clang version 3.5 (gitosis-ePK3LoutQbwPXssp/fMQcEEOCMrvLtNR at public.gmane.org:clang.git
>> f4481e0e412e3f817e65d5ce1c835381dc7a7773)
>> (gitosis-ePK3LoutQbwPXssp/fMQcEEOCMrvLtNR at public.gmane.org:llvm.git
>> 18fe44cb057e4b11533bd3f814b96fdca724baf0)
>> Target: mips64el-unknown-linux-gnu
>
> [...]
>
>> rkotler at mipsswbrd006-le:~/caviumnativellvm/build$  find /usr/lib -name
>> crtbegin.o
>> /usr/lib/gcc/mipsel-linux-gnu/4.7/crtbegin.o
>> /usr/lib/gcc/mipsel-linux-gnu/4.6/64/crtbegin.o
>
> That is why the clang selects toolchain version 4.6. You provide
> "mips64el-unknown-linux-gnu" triple but toolchain version 4.7 does not
> support 64 ABI. So the clang fall back to the 4.6.
>
> The first time you provide "mipsel-unknown-linux-gnu" triple and the
> fixed clang successfully selects toolchain version 4.7.
>




More information about the cfe-dev mailing list