Compiling without -g
Joseph H. Buehler
jhpb@sarto.gaithersburg.md.us
Fri Jan 23 14:48:00 GMT 1998
>>>>> "JB" == Joe Buck <jbuck@Synopsys.COM> writes:
>> > make CFLAGS=-O2
>>
>> Not true, at least in some cases I have had to resort to using perl as
>> shown. As I recall, the problem was recursive makes that either did
>> not pass CFLAGS or overrode it.
JB> Either you are not using GNU make, or this is a bug that occurs on your
JB> platform but not mine, or you are assuming behavior based on reading
JB> the makefiles rather than checking it (make variables go in the
JB> environment, so they get passed to recursive makes automatically).
JB> If it is not working the way I described, it is a bug that should be
JB> fixed! We should not be encouraging people to write perl scripts to
JB> mangle the makefiles.
JB> (note that for 'make bootstrap' there is a different variable BOOT_CFLAGS
JB> that is used by stage 2 and stage 3 builds).
Here's what happens under redhat 5.0. I configure with CFLAGS=-O and
run "make" with CFLAGS=-O. As soon as the bootstrap starts in the
gcc/ directory, a -g appears in the compiler arguments and the -O is
gone.
Joe Buehler
cd /usr/local/src/gnu/egcs/
make
./egcs-build 971225
+ [ -f /etc/bashrc ]
+ . /etc/bashrc
++ PS1=[\u@\h \W]\$
++ alias which=type -path
++ PVM_ROOT=/usr/local/clustering/pvm3
++ PVM_DPATH=/usr/local/clustering/pvm3/lib/pvmd
++ LAMHOME=/usr/local/clustering/lam
++ MANPATH=/usr/man:/usr/local/man:/usr/X11R6/man:/usr/openwin/man:/usr/local/clustering/pvm3/man:/usr/local/clustering/lam/man
++ export PVM_ROOT PVM_DPATH LAMHOME MANPATH
+ NEW=971225
+ rm -fr egcs-971225
+ gunzip
+ tar xf -
+ cd egcs-971225
+ rm -fr gcc/f
+ rm -fr gcc/objc
+ mkdir build
+ cd build
+ CFLAGS=-O
+ ../configure --prefix=/usr/local/egcs --host=i486-pc-linux-gnu --target=i486-pc-linux-gnu
Created "Makefile" in /2/usr/local/src/gnu/egcs/egcs-971225/build using "mt-frag"
Links are now set up to build a native compiler for i486-pc-linux-gnu
+ make CFLAGS=-O bootstrap-lean
make[1]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build'
make[2]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/libiberty'
if [ -n "" ] && [ ! -d pic ]; then \
mkdir pic; \
else true; fi
touch stamp-picdir
echo "# !Automatically generated from ../../libiberty/functions.def"\
"- DO NOT EDIT!" >needed2.awk
grep '^DEFVAR(' < ../../libiberty/functions.def \
| sed -e '/DEFVAR/s|DEFVAR.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
grep '^DEFFUNC(' < ../../libiberty/functions.def \
| sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/dummy.c 2>/dev/null
(gcc -o dummy -O dummy.o ) >errors 2>&1 || true
echo "/* !Automatically generated from ../../libiberty/functions.def"\
"- DO NOT EDIT! */" >lconfig.h
awk -f needed2.awk <errors >>lconfig.h
cp lconfig.h config.tmp
/bin/sh ../../libiberty/../move-if-change config.tmp config.h
touch stamp-config
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/argv.c -o pic/argv.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/argv.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/basename.c -o pic/basename.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/basename.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/choose-temp.c -o pic/choose-temp.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/choose-temp.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/concat.c -o pic/concat.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/concat.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/cplus-dem.c -o pic/cplus-dem.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/cplus-dem.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/fdmatch.c -o pic/fdmatch.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/fdmatch.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/fnmatch.c -o pic/fnmatch.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/fnmatch.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getopt.c -o pic/getopt.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getopt.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getopt1.c -o pic/getopt1.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getopt1.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getruntime.c -o pic/getruntime.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/getruntime.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/hex.c -o pic/hex.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/hex.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/floatformat.c -o pic/floatformat.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/floatformat.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/objalloc.c -o pic/objalloc.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/objalloc.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/obstack.c -o pic/obstack.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/obstack.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/pexecute.c -o pic/pexecute.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/pexecute.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/spaces.c -o pic/spaces.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/spaces.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/strerror.c -o pic/strerror.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/strerror.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/strsignal.c -o pic/strsignal.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/strsignal.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xatexit.c -o pic/xatexit.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xatexit.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xexit.c -o pic/xexit.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xexit.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xmalloc.c -o pic/xmalloc.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xmalloc.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xstrdup.c -o pic/xstrdup.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xstrdup.c
test -z "" || \
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xstrerror.c -o pic/xstrerror.o
gcc -c -O -I. -I../../libiberty/../include ../../libiberty/xstrerror.c
echo "# !Automatically generated from ../../libiberty/functions.def"\
"- DO NOT EDIT!" >needed.awk
grep '^DEF(' < ../../libiberty/functions.def \
| sed -e '/DEF/s|DEF.\([^,]*\).*|/\1/ { printf "\1.o " }|' \
>>needed.awk
rm -f lneeded-list
f=""; \
for i in `awk -f needed.awk <errors` ; do \
case " $f " in \
*" $i "*) ;; \
*) f="$f $i" ;; \
esac ; \
done ; \
case $f in \
*alloca.o*) f="$f xmalloc.o xexit.o" ;; \
esac ; \
echo $f >>lneeded-list
cp lneeded-list needed-tmp
/bin/sh ../../libiberty/../move-if-change needed-tmp needed-list
touch stamp-needed
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/libiberty'
rm -rf libiberty.a
ar rc libiberty.a \
argv.o basename.o choose-temp.o concat.o cplus-dem.o fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o floatformat.o objalloc.o obstack.o pexecute.o spaces.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o
ranlib libiberty.a
echo argv.o basename.o choose-temp.o concat.o cplus-dem.o fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o floatformat.o objalloc.o obstack.o pexecute.o spaces.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o > required-list
make[3]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/libiberty'
make[2]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/libiberty'
make[2]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo'
rm -f stmp-sub-all
for dir in libtxi makeinfo util emacs; do \
echo making sub-all in $dir; \
(cd $dir && make bindir='/usr/local/egcs/bin' mandir='/usr/local/egcs/man/man1' manext='1' prefix='/usr/local/egcs' binprefix='' manprefix='' infodir='/usr/local/egcs/info' CFLAGS='-O' CC='gcc' ALLOCA='' LDFLAGS='' DEFAULT_INFOPATH='/usr/local/egcs/info:.' INSTALL='/bin/sh /2/usr/local/src/gnu/egcs/egcs-971225/install-sh -c' INSTALL_DATA='/bin/sh /2/usr/local/src/gnu/egcs/egcs-971225/install-sh -c -m 644' INSTALL_PROGRAM='/bin/sh /2/usr/local/src/gnu/egcs/egcs-971225/install-sh -c ' sub-all || exit 1); \
done
making sub-all in libtxi
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/libtxi'
gcc -c -I. -I../../../texinfo/libtxi -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -O ../../../texinfo/libtxi/getopt.c
gcc -c -I. -I../../../texinfo/libtxi -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -O ../../../texinfo/libtxi/getopt1.c
gcc -c -I. -I../../../texinfo/libtxi -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -O ../../../texinfo/libtxi/bzero.c
rm -f libtxi.a
ar cq libtxi.a getopt.o getopt1.o bzero.o
ranlib libtxi.a
make[3]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/libtxi'
making sub-all in makeinfo
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/makeinfo'
gcc -c -I. -I../../../texinfo/makeinfo -I../../../texinfo/makeinfo/../libtxi -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -O ../../../texinfo/makeinfo/makeinfo.c
gcc -c -I. -I../../../texinfo/makeinfo -I../../../texinfo/makeinfo/../libtxi -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -O ../../../texinfo/makeinfo/multi.c
gcc -o makeinfo makeinfo.o multi.o -L../libtxi -ltxi -lbsd
./makeinfo --no-split -I../../../texinfo/makeinfo makeinfo.texi
Making info file `makeinfo.info' from `makeinfo.texi'.
make[3]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/makeinfo'
making sub-all in util
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/util'
gcc -c -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -I. -I../../../texinfo/util -I../../../texinfo/util/../libtxi -O ../../../texinfo/util/texindex.c
gcc -o texindex texindex.o -L../libtxi -ltxi -lbsd
gcc -c -DHAVE_LIBBSD=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_TERMIO_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_SETVBUF=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_BZERO=1 -DHAVE_STRCHR=1 -DHAVE_STRCASECMP=1 -DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRERROR=1 -DHAVE_SIGPROCMASK=1 -DHAVE_SIGSETMASK=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_STRDUP=1 -I. -I../../../texinfo/util -I../../../texinfo/util/../libtxi -O ../../../texinfo/util/install-info.c
gcc -o install-info install-info.o -L../libtxi -ltxi -lbsd
make[3]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/util'
making sub-all in emacs
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/emacs'
make[3]: Nothing to be done for `sub-all'.
make[3]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo/emacs'
touch stmp-sub-all
./makeinfo/makeinfo -I../../texinfo texinfo.texi
Making info file `texinfo' from `texinfo.texi'.
make[2]: Leaving directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/texinfo'
Bootstrapping the compiler
make[2]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/gcc'
make CC="gcc" libdir=/usr/local/egcs/lib LANGUAGES="c "
make[3]: Entering directory `/2/usr/local/src/gnu/egcs/egcs-971225/build/gcc'
gcc -DIN_GCC -g -DHAVE_CONFIG_H -I. -I../../gcc -I../../gcc/config \
-DGCC_INCLUDE_DIR=\"/usr/local/egcs/lib/gcc-lib/i486-pc-linux-gnu/egcs-2.91.03/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"/usr/local/egcs/include/g++\" \
-DOLD_GPLUSPLUS_INCLUDE_DIR=\"/usr/local/egcs/lib/g++-include\" \
-DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
-DCROSS_INCLUDE_DIR=\"/usr/local/egcs/lib/gcc-lib/i486-pc-linux-gnu/egcs-2.91.03/sys-include\" \
-DTOOL_INCLUDE_DIR=\"/usr/local/egcs/i486-pc-linux-gnu/include\" \
-c `echo ../../gcc/cccp.c | sed 's,^\./,,'`
More information about the Gcc
mailing list