Hi! Santiago Vila: > >In the quest to get deterministic/reproducible builds [1], I have > >noticed that the result of building hello currently varies according to > >its build path. > […] > While I can agree that reproducible builds is a good thing (I added > gzip -n recently), the proposed patch makes debugedit to be > build-essential and it looks like an awfully horrible hack. > > >This behaviour should eventually be fixed at the compiler > >level. > > Or maybe just > > s/eventually//
Thanks for pushing me to look at other solutions. After poking some more at GCC and its documentation, I came up with the attached patch. It only adds two new switches to the CFLAGS: `-fdebug-prefix-map=` to adjust the source path and `-gno-record-gcc-switches` to prevent the difference in `-fdebug-prefix-map=` values from affecting the output. Does that sound more acceptable to you? -- Lunar .''`. lu...@debian.org : :Ⓐ : # apt-get install anarchism `. `'` `-
diff -Naur a/debian/rules b/debian/rules --- a/debian/rules 2013-08-16 09:36:35.000000000 +0200 +++ b/debian/rules 2013-09-07 15:09:36.755619230 +0200 @@ -10,7 +10,7 @@ package = hello docdir = debian/tmp/usr/share/doc/$(package) -CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall +CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall -fdebug-prefix-map=$(dir $(realpath $(CURDIR)))=/usr/src/debug/ -gno-record-gcc-switches LDFLAGS := `dpkg-buildflags --get LDFLAGS` CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
signature.asc
Description: Digital signature