Link-time failures from "simple" CFLAGS changes

David Edelsohn dje at watson.ibm.com
Tue Jan 8 09:10:45 EST 2002


>>>>> linuxppc-dev  writes:

> When I change -O2 to -O0 in my CFLAGS definition in Makefile thus:

> CFLAGS := -g $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O0 \
> -fno-strict-aliasing -fno-common

> CFLAGS := -g $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
> -fno-strict-aliasing -fno-common

> ...I am astounded to see thousands of unresolved references
> at kernel link time.  WTF?  Any ideas?

	GCC only inlines functions when optimizing and the Linux kernel
assumes inlining and other optimizations only present at -O2.  The Linux
kernel requires optimization at least, and only really is tested at -O2.

David


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list