This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc -Os option


wizard00 <sys_eng00@yahoo.com> writes:

> gcc try.c -o try would give me linking problem
> 
> /tmp/ccQOkXtu.o: In function `serial_echo_print':
> try.c:(.text+0x31e): undefined reference to `__inb'
> try.c:(.text+0x34a): undefined reference to `__outb'
> try.c:(.text+0x360): undefined reference to `__inb'
> try.c:(.text+0x387): undefined reference to `__outb'
> collect2: ld returned 1 exit status
> 
> but gcc -Os try.c -o try would be OK /w no error
> 
> what's this -Os option? I thought it's only for optimization. 
> from upper error it seems as if missing library. I wouldn't make the
> connection between
> them.

This message is appropriate for gcc-help@gcc.gnu.org, not for
gcc@gcc.gnu.org.  Please direct any followups to gcc-help (only).
Thanks.

Most likely the functions are defined in a header file.  When using
-Os they are inlined.  When not using optimization they are not
inlined, and must be found in some library.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]