On Sun, Oct 20, 2013 at 10:56:49AM -0500, Dirk Eddelbuettel wrote: > [...] > | When I run dpkg-buildflags, the output is: > | > | CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat > -Werror=format-security > | CPPFLAGS=-D_FORTIFY_SOURCE=2 > | CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat > -Werror=format-security > | FFLAGS=-g -O2 > | LDFLAGS=-Wl,-z,relro > | > | I have poked through cdbs, and it seems to use the dpkg-buildflags > | program to figure out the default build flags, so somewhere, somehow, > | that is either being ignored or overwritten. But I haven't had the > | time to figure out where, unfortunately. > > Try > > $ cat /usr/share/R/debian/r-cran.mk > > Patches and testing welcome. > > This r-cran.mk file is used by what must now be ~ 200 packages so this may be > useful to have, but I am personally not too worried about hardening of R > add-on packages.
Ah, I'm guessing it comes from /usr/lib/R/etc/Makeconf (I straced R CMD config LDFLAGS). That seems to be created at R build time, so I wonder whether simply tweaking that would do the trick? I've just had a look at the debian/rules file for r-base. At present, optimflags seems to be derived from a hand-written set of rules. Could it be replaced by something vaguely like the following: optimflags = $(shell dpkg-buildflags --get CFLAGS) ldflags = $(shell dpkg-buildflags --get LDFLAGS) etc., and the same for CPPFLAGS, CXXFLAGS, FFLAGS, and then set these environment variables when you run configure, instead of setting LDFLAGS to be empty? I could write a whole patch if you wish, but only if you would like me to. Julian -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org