[arch-projects] [devtools] [PATCH] makepkg.conf: move -D_FORTIFY_SOURCE=2 to CPPFLAGS

Dave Reisner d at falconindy.com
Wed Feb 6 12:10:44 EST 2013


On Wed, Feb 06, 2013 at 12:06:30PM -0500, Dave Reisner wrote:
> This never belonged in CFLAGS/CXXFLAGS as it really is a preprocessor
> flag. While not necessarily harmful, this can potentially cause software
> not to build when it fails sanity checks (e.g. curl 7.29.0).
> 
> Signed-off-by: Dave Reisner <dreisner at archlinux.org>
> ---

Damn. this doesn't actually work until pacman 4.1 because makepkg
doesn't export CPPFLAGS from makepkg.conf in 4.0.3.

> A similar change will be wanted for core/pacman's makepkg.conf.
> 
>  makepkg-i686.conf   | 5 +++--
>  makepkg-x86_64.conf | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/makepkg-i686.conf b/makepkg-i686.conf
> index 725c2a2..2104f67 100644
> --- a/makepkg-i686.conf
> +++ b/makepkg-i686.conf
> @@ -29,8 +29,9 @@ CHOST="i686-pc-linux-gnu"
>  #-- Compiler and Linker Flags
>  # -march (or -mcpu) builds exclusively for an architecture
>  # -mtune optimizes for an architecture, but builds for whole processor family
> -CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
> -CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
> +CPPFLAGS="-D_FORTIFY_SOURCE=2"
> +CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
> +CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
>  LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
>  #-- Make Flags: change this for DistCC/SMP systems
>  #MAKEFLAGS="-j2"
> diff --git a/makepkg-x86_64.conf b/makepkg-x86_64.conf
> index 4de5c67..214c8fe 100644
> --- a/makepkg-x86_64.conf
> +++ b/makepkg-x86_64.conf
> @@ -29,8 +29,9 @@ CHOST="x86_64-unknown-linux-gnu"
>  #-- Compiler and Linker Flags
>  # -march (or -mcpu) builds exclusively for an architecture
>  # -mtune optimizes for an architecture, but builds for whole processor family
> -CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
> -CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
> +CPPFLAGS="-D_FORTIFY_SOURCE=2"
> +CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
> +CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4"
>  LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
>  #-- Make Flags: change this for DistCC/SMP systems
>  #MAKEFLAGS="-j2"
> -- 
> 1.8.1.2
> 


More information about the arch-projects mailing list