Date: Wed, 23 Jan 2013 12:05:58 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Erik Cederstrand <erik@cederstrand.dk> Cc: "toolchain@freebsd.org" <toolchain@freebsd.org> Subject: Re: [patch] DEBUG_FLAGS cleanup Message-ID: <20130123100558.GV2522@kib.kiev.ua> In-Reply-To: <0CBACA33-7420-4045-AD0C-852983CD64CF@cederstrand.dk>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Wed, Jan 23, 2013 at 09:23:41AM +0100, Erik Cederstrand wrote:
> 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="" to actually work everywhere.
>
> I'd be thankful for feedback and help committing the changes if it's OK.
>
> Thanks,
> Erik
>
> Index: head/usr.bin/tar/Makefile
> ===================================================================
> --- head/usr.bin/tar/Makefile (revision 242791)
> +++ head/usr.bin/tar/Makefile (working copy)
> @@ -38,7 +38,6 @@
> CFLAGS+= -I${LIBARCHIVEDIR}/libarchive_fe
> SYMLINKS= bsdtar ${BINDIR}/tar
> MLINKS= bsdtar.1 tar.1
> -DEBUG_FLAGS=-g
>
> .PHONY: check test clean-test
> check test: $(PROG) bsdtar.1.gz
> Index: head/gnu/usr.bin/cc/cc_tools/Makefile
> ===================================================================
> --- head/gnu/usr.bin/cc/cc_tools/Makefile (revision 242791)
> +++ head/gnu/usr.bin/cc/cc_tools/Makefile (working copy)
> @@ -6,7 +6,7 @@
>
> .include "../Makefile.inc"
>
> -CFLAGS+= -g
> +CFLAGS+= $(DEBUG_FLAGS)
> CFLAGS+= -DGENERATOR_FILE -DHAVE_CONFIG_H
>
> # Override LIBIBERTY set by Makefile.inc, We use our own for
This fragment catched my eye, and it is typical for the patch.
Why do you need to add DEBUG_FLAGS to the CFLAGS manually ?
Wouldn't share/mk magic do this automatically ?
If not, I think that it should be considered to fix the remaining
cases where DEBUG_FLAGS are not added in the common mk code, instead
of sprinkling the additions all over the place ?
I think that the cleanup you performed is needed.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
iQIcBAEBAgAGBQJQ/7YGAAoJEJDCuSvBvK1BaX0P/RWdHVCqLQU6k3m+2X7gxzI4
qDEd2cEURrU6/YbIs9QpKmg/QoJ/mJVDnVmez6q8g40R7JCnF24YIdcbk2uHZxY1
EgTummWyTNIsTUkR2WMXlSdTIbFcz1XeT+c/KVQDPuTo44ZrmiVUC+cXdkSPJ+KI
5IAdg7r9/Lr/tf/Oxcnz+YewhbYBPiTn/H6sWuTdhcIhjGJH69S5d83dH7lJeQ+S
xw5QOHKzCyJ9JSXnuMoUG+zjytHvOuYg5NONzdRZwBZLEdhQ94bcVZwNJ1Kx1g7o
YfHGmGOA8oJOMuESCvrBjjDfxtQpv+/mhr9eRwX0Y2E7kgecKQGtEdAQQ61RiGPQ
4cBdr2O46lrEtiWQu5W1tq/LAmK5Zj1dRC3xTyiQMYcvAH4lNHuUHwHS98RkpCJW
tv32Pwix+dswubMECpR0GUV2mEDE597S8S4LOrFuoiuSzGo5JegWifB0IXXGUUey
rOxiaQXFM8ebJYaAe7zdEacPaHq3+Fc+bIE5aNRZqgo+iw2g5X15AscBixWe4B/q
qKGKFEgdm/74tpyfcrjpP5E81XFOqtOlbH+EhUhOJtw1CBifbmx+Its5lEU373HG
bXUq5ueMcM1EmBbIwDMw7cqGfMMJ5QNbETH19d99pr4KMDUkuEPIdzQkJ1G+6wJ3
Bbz+DJKNm32WiFIW/tq0
=9kAn
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130123100558.GV2522>
