On Nov 15, 2012, at 9:33 PM, liangh at codeaurora.org wrote:> I'm trying to link my objs with compiler-rt built runtime lib for arm. > According to the compiler-rt doc, it should be able to replace libgcc. > However, if I replace "-lgcc" with "compiler-rt.a" for a static linking, > gcc linker complains about undefined functions. Using "nm -g", I compared > the functions in libgcc and compiler-rt.full-arm.a and found there are > many missing functions in compiler-rt, such as "__aeabi_dcmpeq" > "__sync_lock_release_1" "_interwork_call_via_fp", etc. > > Although I can use compiler-rt.a via using "-allow-multiple-definition" to > override libgcc, this is an ugly solution. > > Anybody know how to fully replace libgcc with compiler-rt? Do I need to > link some other lib to totally replace libgcc when using compiler-rt, or > compiler-rt cannot fully replace libgcc yet? I know Apple is using > compiler-rt built runtime libs. How did they link?What compiler are you using? compiler-rt was designed to implement the support functions needed for clang. If you are compiling with gcc, then, yes you might find it relies on support functions not in libcompiler-rt.a. -Nick
liangh at codeaurora.org
2012-Nov-16 18:55 UTC
[LLVMdev] [compiler-rt] is the arm lib complete?
I'm using Clang, with arm-none-linux-gnueabi-g++ as a linker. Although compiler-rt replaced libgcc, we still need other libs such as libc, libm, etc. It seems libc is calling these missing functions.> > On Nov 15, 2012, at 9:33 PM, liangh at codeaurora.org wrote: >> I'm trying to link my objs with compiler-rt built runtime lib for arm. >> According to the compiler-rt doc, it should be able to replace libgcc. >> However, if I replace "-lgcc" with "compiler-rt.a" for a static linking, >> gcc linker complains about undefined functions. Using "nm -g", I >> compared >> the functions in libgcc and compiler-rt.full-arm.a and found there are >> many missing functions in compiler-rt, such as "__aeabi_dcmpeq" >> "__sync_lock_release_1" "_interwork_call_via_fp", etc. >> >> Although I can use compiler-rt.a via using "-allow-multiple-definition" >> to >> override libgcc, this is an ugly solution. >> >> Anybody know how to fully replace libgcc with compiler-rt? Do I need to >> link some other lib to totally replace libgcc when using compiler-rt, or >> compiler-rt cannot fully replace libgcc yet? I know Apple is using >> compiler-rt built runtime libs. How did they link? > > What compiler are you using? compiler-rt was designed to implement the > support functions needed for clang. If you are compiling with gcc, then, > yes you might find it relies on support functions not in libcompiler-rt.a. > > -Nick > >
> I'm using Clang, with arm-none-linux-gnueabi-g++ as a linker. Although > compiler-rt replaced libgcc, we still need other libs such as libc, libm, > etc. It seems libc is calling these missing functions.If you compile libc with gcc, then yes, you might need arbitrary functions from libgcc. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University