This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Preventing --enable-omitfp from overriding -Os in CFLAGS
- To: libc-alpha at sourceware dot cygnus dot com
- Subject: Preventing --enable-omitfp from overriding -Os in CFLAGS
- From: greyham at research dot canon dot com dot au (Graham Stoney)
- Date: Thu, 25 May 2000 16:18:29 +1000 (EST)
Hello libc-ites,
Makeconfig currently supplies a -O99 setting for building optimised objects
whenever --enable-omitfp is specified to configure. This is a bit nasty,
since it overrides any optimisation requested by the user in CFLAGS at the
time configure is run. For example, I'd like to be able to build glibc
optimised-for-space with:
% export CFLAGS="-Os"
% configure --enable-omitfp
At present this doesn't work, because the -O99 setting generated in Makeconfig
appears later on the gcc command line, and overrides my -Os setting. Below is
a patch to fix this problem, and to also add -DNDEBUG when building the
undebuggable optimised -fomit-frame-pointer library. My assumption here is
that if the user has specified --enable-omitfp, they want the library as
fast/small as possible:
Here's the ChangeLog entry:
2000-05-25 Graham Stoney <greyham@research.canon.com.au>
* Makeconfig: Don't force -O99 on --enable-omitfp user, but do add
-DNDEBUG for smallest/fastest library possible.
Index: Makeconfig
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makeconfig
--- Makeconfig 2000/05/25 02:25:15 1.1.1.1
+++ Makeconfig 2000/05/25 05:21:26
@@ -619,8 +619,8 @@
object-suffixes += .og
CPPFLAGS-.og = $(pic-default)
CFLAGS-.og = -g
-CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
-CFLAGS-.os += -g0 -O99 -fomit-frame-pointer -D__USE_STRING_INLINES
+CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -g0 -DNDEBUG -fomit-frame-pointer -D__USE_STRING_INLINES
+CFLAGS-.os += -g0 -DNDEBUG -fomit-frame-pointer -D__USE_STRING_INLINES
libtype.og = lib%_g.a
endif
ifeq (yes,$(build-bounded))
--
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909 Fax: +61 2 9805 2929