svn commit: trunk/busybox
Bernhard Fischer
rep.nop at aon.at
Sat May 13 12:11:42 PDT 2006
On Tue, May 09, 2006 at 03:08:58PM -0700, landley at busybox.net wrote:
>Author: landley
>Date: 2006-05-09 15:08:56 -0700 (Tue, 09 May 2006)
>New Revision: 15043
>
>Log:
>Split CONFIG_DEBUG from CONFIG_DEBUG_PESSIMIZE, and consolidate some Rules.mak
>stuff along the way.
Along the way you have dropped pulling in *any* OPTIMIZATION flags for
this trivial .config:
$ egrep -v "(#|^$)" .config
HAVE_DOT_CONFIG=y
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
CROSS_COMPILER_PREFIX=""
EXTRA_CFLAGS_OPTIONS=""
CONFIG_INSTALL_APPLET_SYMLINKS=y
PREFIX="./_install"
CONFIG_MD5_SIZE_VS_SPEED=2
CONFIG_HDPARM=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y
CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y
CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y
CONFIG_FEATURE_SH_IS_NONE=y
CONFIG_FEATURE_COMMAND_HISTORY=0
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
make V=3 for the .config above gives a completely un-optimized
executable:
gcc-4.1 -I/tmp/obj/busybox/include -I/tmp/obj/busybox/include
-I/tmp/obj/busybox
/libbb -D_GNU_SOURCE -funsigned-char -fno-builtin-strlen
-Wstrict-prototypes -Wm
issing-prototypes -Wmissing-declarations -Wunused -Winit-self -Wshadow
-Wcast-al
ign -Wall -Wstrict-prototypes -Wshadow -DNDEBUG -funsigned-char
-fno-builtin-str
len -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wunused -Wi
nit-self -Wshadow -Wcast-align -c -o /tmp/obj/busybox/miscutils/hdparm.o
/tmp/ob
j/busybox/miscutils/hdparm.c
ar cru /tmp/obj/busybox/miscutils/miscutils.a
/tmp/obj/busybox/miscutils/hdparm.
o
Please fix!
>
>
>Modified:
> trunk/busybox/Config.in
> trunk/busybox/Rules.mak
>
>
>Changeset:
>Modified: trunk/busybox/Config.in
>===================================================================
>--- trunk/busybox/Config.in 2006-05-09 11:29:56 UTC (rev 15042)
>+++ trunk/busybox/Config.in 2006-05-09 22:08:56 UTC (rev 15043)
>@@ -288,17 +288,27 @@
> menu 'Debugging Options'
>
> config CONFIG_DEBUG
>- bool "Build BusyBox with Debugging symbols"
>+ bool "Build BusyBox with extra Debugging symbols"
> default n
> help
>- Say Y here if you wish to compile BusyBox with debugging symbols.
>- This will allow you to use a debugger to examine BusyBox internals
>- while applets are running. This increases the size of the binary
>- considerably and should only be used when doing development.
>- If you are doing development and want to debug BusyBox, answer Y.
>+ Say Y here if you wish to examine BusyBox internals while applets are
>+ running. This increases the size of the binary considerably, and
>+ should only be used when doing development. If you are doing
>+ development and want to debug BusyBox, answer Y.
>
> Most people should answer N.
>
>+config CONFIG_DEBUG_PESSIMIZE
>+ bool "Disable compiler optimizations."
>+ default n
>+ depends on CONFIG_DEBUG
>+ help
>+ The compiler's optimization of source code can eliminate and reorder
>+ code, resulting in an executable that's hard to understand when
>+ stepping through it with a debugger. This switches it off, resulting
>+ in a much bigger executable that more closely matches the source
>+ code.
>+
> choice
> prompt "Additional debugging library"
> default CONFIG_NO_DEBUG_LIB
>
>Modified: trunk/busybox/Rules.mak
>===================================================================
>--- trunk/busybox/Rules.mak 2006-05-09 11:29:56 UTC (rev 15042)
>+++ trunk/busybox/Rules.mak 2006-05-09 22:08:56 UTC (rev 15043)
>@@ -75,13 +75,14 @@
>
> # This must bind late because srcdir is reset for every source subdirectory.
> INCS:=-I$(top_builddir)/include -I$(top_srcdir)/include
>-CFLAGS=$(INCS) -I$(srcdir)
>+CFLAGS=$(INCS) -I$(srcdir) -D_GNU_SOURCE
> CFLAGS+=$(CHECKED_CFLAGS)
> ARFLAGS=cru
>
> # Warnings
>
>-CFLAGS+=-Wall -Wstrict-prototypes -Wshadow
>+CFLAGS += -Wall -Wstrict-prototypes -Wshadow
>+LDFLAGS += $(call check_ld,--warn-common,)
>
> # gcc centric. Perhaps fiddle with findstring gcc,$(CC) for the rest
> # get the CC MAJOR/MINOR version
>@@ -183,7 +184,7 @@
> OPTIMIZATION+=$(call check_gcc,-fno-branch-count-reg,)
> endif # gcc-4.1 and beyond
> endif
>-OPTIMIZATIONS:=$(OPTIMIZATION) $(call check_gcc,-fomit-frame-pointer,)
>+OPTIMIZATION+=$(call check_gcc,-fomit-frame-pointer,)
>
> #
> #--------------------------------------------------------
>@@ -207,14 +208,21 @@
> LIBRARIES:=-lefence
> endif
> endif
>+
>+# Debugging info
>+
> ifeq ($(strip $(CONFIG_DEBUG)),y)
>- CFLAGS +=-g -D_GNU_SOURCE
>- LDFLAGS += $(call check_ld,--warn-common,)
>+ CFLAGS +=-g
> else
>- CFLAGS+=$(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
>- LDFLAGS += $(call check_ld,--warn-common,)
>+ CFLAGS +=-DNDEBUG
> LDFLAGS += $(call check_ld,--sort-common,)
> endif
>+
>+ifneq ($(strip $(CONFIG_DEBUG_PESSIMIZE)),y)
>+else
>+ CFLAGS += $(OPTIMIZATION)
>+endif
>+
> # warn a bit more verbosely for non-release versions
> ifneq ($(EXTRAVERSION),)
> CHECKED_CFLAGS+=$(call check_gcc,-Wstrict-prototypes,)
>
>_______________________________________________
>busybox-cvs mailing list
>busybox-cvs at busybox.net
>http://busybox.net/cgi-bin/mailman/listinfo/busybox-cvs
>
More information about the busybox
mailing list