liangh at codeaurora.org
2012-Oct-28 02:13 UTC
[LLVMdev] How to disable or override libgcc when linking?
Hi, I'm using compiler-rt to build the library to replace libgcc. How can I disable -lgcc being added and passed to the linker? When I use: "clang -ccc-gcc-name arm-cross-g++ hello.c -Lmypath -lmylib -v" -lgcc is always added: "...gcc/arm-none-linux-gnueabi/4.6.1/collect2 ... /tmp/hello-Pj9QxO.o -lgcc ..." How can I disable or override libgcc from the command line? Thanks. -Liang
Tim Northover
2012-Oct-29 11:21 UTC
[LLVMdev] How to disable or override libgcc when linking?
Hi Liang,> How can I disable or override libgcc from the command line?I think the option you're looking for may be "-nostdlib". At least, that will probably be part of the solution. Tim.
liangh at codeaurora.org
2012-Nov-16 02:33 UTC
[LLVMdev] [compiler-rt] is the arm lib complete?
Hi, 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? Thanks. -Liang
My memory may be fuzzy, but I believe that those functions are required for ARMv6 support. On ARMv7 and newer they are not used. Apple only supports ARMv7 currently, and so they probably won't have encountered this problem. We're probably going to be adding some things to compiler-rt for FreeBSD on ARM over the next year, but if you get there and do it before us then we certainly won't complain... David On 15 Nov 2012, at 18:33, liangh at codeaurora.org wrote:> Hi, > > 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? > > Thanks. > -Liang > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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
Maybe Matching Threads
- [LLVMdev] [compiler-rt] is the arm lib complete?
- [LLVMdev] [compiler-rt] is the arm lib complete?
- [LLVMdev] [compiler-rt] is the arm lib complete?
- [LLVMdev] OT: intel darwin losing primary target status
- [LLVMdev] clang\clang++ 3.6.0 don't find C\C++ header , in windows ?