The system directories can't be changed?
Andi Hellmund
mail@andihellmund.com
Thu Dec 17 01:41:00 GMT 2009
Andi Hellmund wrote:
> Pan ruochen wrote:
>
>> Dear All,
>>
>> I'm developping with cross gcc toolchain. The size of the shared
>> objects of the toolchain
>> is a little big. I try linking the applications againast smaller
>> libraries like uclibc.
>> But I read gcc manual and find no description about how to suppress
>> the system directories on linking.
>>
>> There seems to be no way of changing the default behaviors of invoking
>> `gcc' instead of
>> `ld' as the linker. Is it?
>>
>> PRC
>> Dec 16,2009
>>
>>
>>
> Hey Pan,
>
> system directories like you call them are fixed and hard-coded in the
> linker (ld --verbose | grep -i search), but you could use the -L option
> of gcc to specify directories which should be searched for libraries
> before the default system directories.
>
> But I guess what you want to do is to suppress linking against the
> default libraries like libc? In this case, you could use the
> -nodefaultlibs option so that no system libraries are automatically used
> at link time. But note that you would then possibly have to explicitly
> link against libgcc (which is used "internally" by gcc for some
> optimizations or limitations of your system)!
>
This second comment is quite senseless :-) I somehow assumed that uclibc
is using different library names than the default libraries (e.g. libuc,
etc.), but it isn't by default ... so that however the first option (-L)
should work.
- Andi -
More information about the Gcc-help
mailing list