This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc -Os option
- From: Ian Lance Taylor <iant at google dot com>
- To: wizard00 <sys_eng00 at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 24 Aug 2006 18:03:53 -0700
- Subject: Re: gcc -Os option
- References: <5974772.post@talk.nabble.com>
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