Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2013 09:23:41 +0100
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        "toolchain@freebsd.org" <toolchain@freebsd.org>
Subject:   [patch] DEBUG_FLAGS cleanup
Message-ID:  <0CBACA33-7420-4045-AD0C-852983CD64CF@cederstrand.dk>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_D26E537B-B33B-436C-9666-7C22FF17F9AC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello folks,

Attached is a patch to clean up unconditional use of "-g" in Makefiles, =
instead respecting the global DEBUG_FLAGS setting.

I need this as part of my quest to support deterministic builds. =
Currently, debug information contains stuff like timestamps, absolute =
paths etc. that make binaries non-deterministic, and Clang lacks the =
necessary flags to rectify this. So I'd like DEBUG_FLAGS=3D"" to =
actually work everywhere.

I'd be thankful for feedback and help committing the changes if it's OK.

Thanks,
Erik


--Apple-Mail=_D26E537B-B33B-436C-9666-7C22FF17F9AC
Content-Disposition: attachment;
	filename=debugflags.txt
Content-Type: text/plain;
	x-unix-mode=0644;
	name="debugflags.txt"
Content-Transfer-Encoding: quoted-printable

Index: head/usr.bin/tar/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/usr.bin/tar/Makefile	(revision 242791)
+++ head/usr.bin/tar/Makefile	(working copy)
@@ -38,7 +38,6 @@
 CFLAGS+=3D	-I${LIBARCHIVEDIR}/libarchive_fe
 SYMLINKS=3D	bsdtar ${BINDIR}/tar
 MLINKS=3D	bsdtar.1 tar.1
-DEBUG_FLAGS=3D-g
=20
 .PHONY: check test clean-test
 check test: $(PROG) bsdtar.1.gz
Index: head/gnu/usr.bin/cc/cc_tools/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/gnu/usr.bin/cc/cc_tools/Makefile	(revision 242791)
+++ head/gnu/usr.bin/cc/cc_tools/Makefile	(working copy)
@@ -6,7 +6,7 @@
=20
 .include "../Makefile.inc"
=20
-CFLAGS+=3D	-g
+CFLAGS+=3D	$(DEBUG_FLAGS)
 CFLAGS+=3D	-DGENERATOR_FILE -DHAVE_CONFIG_H
=20
 # Override LIBIBERTY set by Makefile.inc, We use our own for
Index: head/usr.sbin/bluetooth/bthidd/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/usr.sbin/bluetooth/bthidd/Makefile	(revision 242791)
+++ head/usr.sbin/bluetooth/bthidd/Makefile	(working copy)
@@ -8,7 +8,6 @@
 		session.c
=20
 CFLAGS+=3D	-I${.CURDIR}
-DEBUG_FLAGS=3D	-g
=20
 DPADD=3D          ${LIBBLUETOOTH} ${LIBUSBHID}
 LDADD=3D		-lbluetooth -lusbhid
Index: head/lib/libufs/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/lib/libufs/Makefile	(revision 242791)
+++ head/lib/libufs/Makefile	(working copy)
@@ -21,7 +21,6 @@
=20
 WARNS?=3D	2
=20
-DEBUG_FLAGS =3D -g
 CFLAGS+=3D -D_LIBUFS
 .if defined(LIBUFS_DEBUG)
 CFLAGS+=3D -D_LIBUFS_DEBUGGING
Index: head/crypto/openssl/crypto/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/crypto/openssl/crypto/Makefile	(revision 242791)
+++ head/crypto/openssl/crypto/Makefile	(working copy)
@@ -8,7 +8,7 @@
 INCLUDE=3D	-I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
 # INCLUDES targets sudbirs!
 INCLUDES=3D	-I.. -I../.. -I../modes -I../asn1 -I../evp =
-I../../include $(ZLIB_INCLUDE)
-CFLAG=3D		-g
+CFLAG=3D		$(DEBUG_FLAGS)
 MAKEDEPPROG=3D	makedepend
 MAKEDEPEND=3D	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 MAKEFILE=3D       Makefile
Index: head/contrib/gcc/Makefile.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/contrib/gcc/Makefile.in	(revision 242791)
+++ head/contrib/gcc/Makefile.in	(working copy)
@@ -154,9 +154,9 @@
 TCFLAGS =3D
 CFLAGS =3D @CFLAGS@
 LDFLAGS =3D @LDFLAGS@
-STAGE1_CFLAGS =3D -g @stage1_cflags@
+STAGE1_CFLAGS =3D $(DEBUG_FLAGS) @stage1_cflags@
 STAGE1_CHECKING_CFLAGS =3D -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING
-BOOT_CFLAGS =3D -g -O2
+BOOT_CFLAGS =3D $(DEBUG_FLAGS) -O2
=20
 # Flags to determine code coverage. When coverage is disabled, this =
will
 # contain the optimization flags, as you normally want code coverage
@@ -553,7 +553,7 @@
=20
 # Options to use when compiling libgcc2.a.
 #
-LIBGCC2_DEBUG_CFLAGS =3D -g
+LIBGCC2_DEBUG_CFLAGS =3D $(DEBUG_FLAGS)
 LIBGCC2_CFLAGS =3D -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) =
$(TARGET_LIBGCC2_CFLAGS) \
 		 $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \
 		 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
Index: head/contrib/gdtoa/makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/contrib/gdtoa/makefile	(revision 242791)
+++ head/contrib/gdtoa/makefile	(working copy)
@@ -25,7 +25,7 @@
=20
 .SUFFIXES: .c .o
 CC =3D cc
-CFLAGS =3D -g
+CFLAGS =3D $(DEBUG_FLAGS)
=20
 .c.o:
 	$(CC) -c $(CFLAGS) $*.c
Index: head/cddl/usr.bin/ctfconvert/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/cddl/usr.bin/ctfconvert/Makefile	(revision 242791)
+++ head/cddl/usr.bin/ctfconvert/Makefile	(working copy)
@@ -3,8 +3,6 @@
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common
 .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt
=20
-DEBUG_FLAGS=3D	-g
-
 PROG=3D		ctfconvert
 SRCS=3D		alist.c \
 		ctf.c \
Index: head/cddl/usr.sbin/lockstat/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/cddl/usr.sbin/lockstat/Makefile	(revision 242791)
+++ head/cddl/usr.sbin/lockstat/Makefile	(working copy)
@@ -18,7 +18,7 @@
 		-I${OPENSOLARIS_SYS_DISTDIR}/compat \
 		-I${.CURDIR}/../../../sys
=20
-CFLAGS+=3D	-DNEED_ERRLOC -g
+CFLAGS+=3D	-DNEED_ERRLOC $(DEBUG_FLAGS)
=20
 #YFLAGS+=3D	-d
=20
Index: head/sys/modules/sfxge/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/sys/modules/sfxge/Makefile	(revision 242822)
+++ head/sys/modules/sfxge/Makefile	(working copy)
@@ -20,6 +20,6 @@
SRCS+=3D	siena_mac.c siena_nic.c siena_nvram.c siena_phy.c
SRCS+=3D	siena_sram.c siena_vpd.c=20

-DEBUG_FLAGS=3D -g -DDEBUG=3D1
+DEBUG_FLAGS+=3D -DDEBUG=3D1

.include <bsd.kmod.mk>
Index: head/sys/modules/cxgb/cxgb/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/sys/modules/cxgb/cxgb/Makefile	(revision 242822)
+++ head/sys/modules/cxgb/cxgb/Makefile	(working copy)
@@ -13,7 +13,7 @@
SRCS+=3D	opt_inet.h opt_inet6.h opt_zero.h opt_sched.h
SRCS+=3D	uipc_mvec.c

-CFLAGS+=3D -g -DDEFAULT_JUMBO -I${CXGB}
+CFLAGS+=3D ${DEBUG_FLAGS} -DDEFAULT_JUMBO -I${CXGB}

.if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} !=3D "no"
Index: head/sys/modules/cxgb/cxgb_t3fw/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- head/sys/modules/cxgb/cxgb_t3fw/Makefile	(revision 242822)
+++ head/sys/modules/cxgb/cxgb_t3fw/Makefile	(working copy)
@@ -1,10 +1,12 @@
# $FreeBSD$

+.include <bsd.own.mk>
+
CXGB =3D ${.CURDIR}/../../../dev/cxgb
.PATH: ${CXGB}=20

KMOD=3D cxgb_t3fw
SRCS+=3D cxgb_t3fw.c
-CFLAGS+=3D -g -I${CXGB}
+CFLAGS+=3D ${DEBUG_FLAGS} -I${CXGB}

.include <bsd.kmod.mk>=

--Apple-Mail=_D26E537B-B33B-436C-9666-7C22FF17F9AC--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0CBACA33-7420-4045-AD0C-852983CD64CF>