Subject: port-i386/8493: i386_elf lib/csu can't build with -O3
To: None <gnats-bugs@gnats.netbsd.org>
From: Seebs <seebs@lobe.fleet.plethora.net>
List: netbsd-bugs
Date: 09/25/1999 22:05:40
>Number:         8493
>Category:       port-i386
>Synopsis:       crt0.o gets build without ___start.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 25 22:05:00 1999
>Last-Modified:
>Originator:     Seebs
>Organization:
>Release:        1999/09/25
>Environment:
System: NetBSD lobe.fleet.plethora.net 1.4K NetBSD 1.4K (LOBE) #1: Thu Sep 23 19:41:33 CDT 1999 seebs@lobe.fleet.plethora.net:/usr/src/sys/arch/i386/compile/LOBE i386

>Description:
	If you build with "-O3", gcc "cleverly" optimizes ___start out of
	lib/csu/i386_elf/crt0.c, because it's static and never called from
	anywhere else.
>How-To-Repeat:
	Get pushy about optimization.
>Fix:
	Two suggestions:
	1.  Override CFLAGS in lib/csu
	2.  Remove the "static".  ___ is reserved namespace anyway, so if
	a user wants a symbol called "___start", tough cookies.
>Audit-Trail:
>Unformatted: