Re: [CVS] RPM: rpm/ CHANGES configure.ac
Instead of more AutoFu, you might just want to add to default GCC CFLAGS. BTW, clang is Really Nice Stuff, found several minor issues when I ran clang across RPM a couple of weeks ago. hth 73 de Jeff On Sep 28, 2009, at 10:38 AM, Pinto Elia wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: rpm Date: 28-Sep-2009 16:38:50 Branch: HEAD Handle: 2009092814385000 Modified files: rpm CHANGES configure.ac Log: add -fno-delete-null-pointer-checks: http://patchwork.kernel.org/patch/36060/ Summary: RevisionChanges Path 1.3131 +1 -0 rpm/CHANGES 2.404 +9 -0 rpm/configure.ac patch -p0 '@@ .' Index: rpm/CHANGES = = = = = = == $ cvs diff -u -r1.3130 -r1.3131 CHANGES --- rpm/CHANGES24 Sep 2009 12:21:47 - 1.3130 +++ rpm/CHANGES28 Sep 2009 14:38:50 - 1.3131 @@ -1,5 +1,6 @@ 5.2b1 - 5.3a1 +- devzero2000: add rpm-genenerate-loop-test-harness.sh - devzero2000: add INSTALL.developer - jbj: order: fix: check current package for files/dirs before other packages. - jbj: order: fix: avoid self-looping for man-pages (and pkgs w no requires) @@ . patch -p0 '@@ .' Index: rpm/configure.ac = = = = = = == $ cvs diff -u -r2.403 -r2.404 configure.ac --- rpm/configure.ac 19 Sep 2009 23:12:03 - 2.403 +++ rpm/configure.ac 28 Sep 2009 14:38:50 - 2.404 @@ -187,6 +187,15 @@ fi fi ]) +AC_ARG_ENABLE(build-optimization, +AS_HELP_STRING([--enable-build-optimization], [build RPM instrumented for extra optimization/security (GCC only)]), [dnl +if test .$enableval = .yes; then +if test .`$CC --version 21 | grep 'GCC'` != .; then +dnl # GNU GCC (usually gcc) +CFLAGS=$CFLAGS -fno-delete-null-pointer-checks +fi +fi +]) AC_ARG_ENABLE(build-gcov, AS_HELP_STRING([--enable-build-gcov], [build RPM instrumented for gcov]), [dnl if test .$enableval = .yes; then @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-...@rpm5.org __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ configure.ac
Pinto Elia wrote: Log: rework security CFLAGS without autofu. Add also some other -AC_ARG_ENABLE(build-optimization, -AS_HELP_STRING([--enable-build-optimization], [build RPM instrumented for extra optimization/security (GCC only)]), [dnl -if test .$enableval = .yes; then -if test .`$CC --version 21 | grep 'GCC'` != .; then -dnl # GNU GCC (usually gcc) -CFLAGS=$CFLAGS -fno-delete-null-pointer-checks -fi -fi -]) +dnl # build RPM instrumented for extra optimization/security (GCC only) +dnl # -fno-delete-null-pointer as the kernel does http:// patchwork.kernel.org/patch/36060/ +if test .`$CC --version 21 | grep 'GCC'` != .; then +dnl # GNU GCC (usually gcc) +CFLAGS=$CFLAGS -fno-delete-null-pointer-checks - D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector +fi If you absolutely *must* hack CFLAGS inside configure, as opposed to outside, it was better with the enablers. cc1: error: unrecognized command line option -fstack-protector --anders __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ configure.ac
On Mon, Sep 28, 2009 at 6:11 PM, Anders F Björklund a...@rpm5.org wrote: Pinto Elia wrote: Log: rework security CFLAGS without autofu. Add also some other -AC_ARG_ENABLE(build-optimization, -AS_HELP_STRING([--enable-build-optimization], [build RPM instrumented for extra optimization/security (GCC only)]), [dnl -if test .$enableval = .yes; then -if test .`$CC --version 21 | grep 'GCC'` != .; then -dnl # GNU GCC (usually gcc) -CFLAGS=$CFLAGS -fno-delete-null-pointer-checks -fi -fi -]) +dnl # build RPM instrumented for extra optimization/security (GCC only) +dnl # -fno-delete-null-pointer as the kernel does http:// patchwork.kernel.org/patch/36060/ +if test .`$CC --version 21 | grep 'GCC'` != .; then +dnl # GNU GCC (usually gcc) +CFLAGS=$CFLAGS -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector +fi If you absolutely *must* hack CFLAGS inside configure, as opposed to outside, it was better with the enablers. cc1: error: unrecognized command line option -fstack-protector No absolutely, sure. The best portable thing to do is to check the flags first. What gcc version are you using ? --anders __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ configure.ac
cc1: error: unrecognized command line option -fstack-protector No absolutely, sure. The best portable thing to do is to check the flags first. What gcc version are you using ? Apple GCC. They haven't switched entirely over to LLVM (just yet). --anders __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org