Bug 738 - Swig should not be invoked with CPPFLAGS
Swig should not be invoked with CPPFLAGS
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
All Linux
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-23 21:58 CET by Robert Edmonds
Modified: 2016-01-25 09:08 CET (History)
2 users (show)

See Also:


Attachments
Makefile.in: Pass PYTHON_CPPFLAGS to swig instead of CPPFLAGS (1.51 KB, patch)
2016-01-23 21:58 CET, Robert Edmonds
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Edmonds 2016-01-23 21:58:15 CET
Created attachment 320 [details]
Makefile.in: Pass PYTHON_CPPFLAGS to swig instead of CPPFLAGS

Hi,

Debian (and derivatives) have started injecting gcc >= 4.9's -Wdate-time into CPPFLAGS by default as of dpkg 1.18.4, as part of the Reproducible Builds effort. For more details, see https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805872.

This causes build failures with a very small number of packages in Debian that includes Unbound, due to the unfiltered use of $(CPPFLAGS) in the arguments to swig. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809055 for the Debian bug tracking the issue in the Unbound package.

If I understand correctly, per Swig upstream's comments, Swig should not really be invoked with CPPFLAGS, only a few flags that look like C preprocessor flags like -I, -D, -U are actually supported.

The attached patch should fix this, by importing the Autoconf variable PYTHON_CPPFLAGS into the Makefile and using $(PYTHON_CPPFLAGS) instead of $(CPPFLAGS) for the arguments to the Swig command.

Thanks!
Comment 1 Wouter Wijngaards 2016-01-25 09:08:10 CET
Hi Robert,

Committed, thank you for the patch.

Best regards, Wouter