|
Re: gcc-uClibc botches -nodefaultlibs / -nostdlib: msg#00170lib.uclibc.general
Miles Bader <miles@xxxxxxx> writes: > I don't know the semantics that gcc uses for these options (I can look > tomorrow if you want), but based on the code in gcc-uClibc, it looks like the > intention is that you use `-nostdlib' in the case where you want _nothing_ > passed to the linker, and `-nodefaultlibs' when you just want to omit the > system _libraries_. I looked at the gcc docs, and they seem to agree with what I wrote above. So can I check my change? Thanks, -Miles Here's what the info page (`(gcc-3.2)Link Options') says: `-nodefaultlibs' Do not use the standard system libraries when linking. Only the libraries you specify will be passed to the linker. The standard startup files are used normally, unless `-nostartfiles' is used. The compiler may generate calls to memcmp, memset, and memcpy for System V (and ISO C) environments or to bcopy and bzero for BSD environments. These entries are usually resolved by entries in libc. These entry points should be supplied through some other mechanism when this option is specified. `-nostdlib' Do not use the standard system startup files or libraries when linking. No startup files and only the libraries you specify will be passed to the linker. The compiler may generate calls to memcmp, memset, and memcpy for System V (and ISO C) environments or to bcopy and bzero for BSD environments. These entries are usually resolved by entries in libc. These entry points should be supplied through some other mechanism when this option is specified. One of the standard libraries bypassed by `-nostdlib' and `-nodefaultlibs' is `libgcc.a', a library of internal subroutines that GCC uses to overcome shortcomings of particular machines, or special needs for some languages. (*Note Interfacing to GCC Output: (gccint)Interface, for more discussion of `libgcc.a'.) In most cases, you need `libgcc.a' even when you want to avoid other standard libraries. In other words, when you specify `-nostdlib' or `-nodefaultlibs' you should usually specify `-lgcc' as well. This ensures that you have no unresolved references to internal GCC library subroutines. (For example, `__main', used to ensure C++ constructors will be called; *note `collect2': (gccint)Collect2..) -- A zen-buddhist walked into a pizza shop and said, "Make me one with everything." |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | ARM IO: 00170, Vincent Sanders |
|---|---|
| Next by Date: | Re: gcc-uClibc botches -nodefaultlibs / -nostdlib: 00170, Erik Andersen |
| Previous by Thread: | Re: gcc-uClibc botches -nodefaultlibs / -nostdlibi: 00170, Miles Bader |
| Next by Thread: | Re: gcc-uClibc botches -nodefaultlibs / -nostdlib: 00170, Erik Andersen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |