*BSD News Article 56750


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!chi-news.cic.net!uwm.edu!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!swrinde!sdd.hp.com!hamblin.math.byu.edu!park.uvsc.edu!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Why won't kernel compile with COPTFLAGS=-O3
Date: 5 Dec 1995 23:19:02 GMT
Organization: Utah Valley State College, Orem, Utah
Lines: 37
Message-ID: <4a2k16$8kc@park.uvsc.edu>
References: <49uqc0$1f5s@info4.rus.uni-stuttgart.de>
NNTP-Posting-Host: hecate.artisoft.com

schweikh@zeiss.ito.uni-stuttgart.de (Jens Schweikhardt) wrote:
>
> Hello,
> 
> recently I tried to compile 2.1.0 with a modification in Makefile.i386
> where I changed the COPTFLAGS (sp?) from -O to -m486 -O3.
> At the link stage the make stopped due to undefined symbols
> _dummyinit (init_main.o) and _dummy_cleanup. Looking at the
> source in init_main.c, dummyinit() seems to be an empty function
> which might be optimized out of existence by -O3.
> I've tried -O3 with -fkeep-inline-functions but to no avail.
> I believe there's some strange symbol table hacking going on.
> Is there any way to get a kernel compiled with -O3?
> Or maybe I should complain to the gcc maintainers?

Turn of "dead code" optimization.

The function in question has its address taken and exported via
and assembly symbol tab generation.

Probably the language should know how to do this with an __XXX()
or similar qualifier instea of going to assembly, or assembly
references should be exempted from dead code optimization.

-O3 is known to generate buggy code up through GCC 2.7.1 in any
case.

One wonders how C++ copes with CTOR/DTOR's, given that it uses
the same mechanism for initialization of virtual base classes,
etc.


                                        Terry Lambert
                                        terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.