[GRASS-dev] [GRASS GIS] #2916: configure bug (?): FORTIFY_SOURCE in CPPFLAGS breaks configure on Arch Linux

GRASS GIS trac at osgeo.org
Tue Feb 16 17:50:03 PST 2016


#2916: configure bug (?): FORTIFY_SOURCE in CPPFLAGS breaks configure on Arch
Linux
------------------------+-------------------------
  Reporter:  msieczka   |      Owner:  grass-dev@…
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:  7.0.4
 Component:  Compiling  |    Version:  7.0.3
Resolution:             |   Keywords:
       CPU:  All        |   Platform:  Linux
------------------------+-------------------------

Comment (by glynn):

 Replying to [ticket:2916 msieczka]:
 > Arch Linux build system by default sets CPPFLAGS="-D_FORTIFY_SOURCE=2".
 >
 > If I unset FORTIFY_SOURCE, configure and make passes. But when it's set,
 configure in GRASS 6 and 7 fails.

 {{{
 configure:2722: checking how to run the C preprocessor
 configure:2741: gcc -E -D_FORTIFY_SOURCE=2 conftest.c >/dev/null
 2>conftest.out
 In file included from /usr/include/assert.h:35:0,
                  from configure:2736:
 /usr/include/features.h:328:4: warning: #warning _FORTIFY_SOURCE requires
 compiling with optimization (-O) [-Wcpp]
  #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
     ^
 configure: failed program was:
 }}}

 This all arises because autoconf tends to treat ANYTHING written to stderr
 as indicating a failure.

 It then goes on to try:

 {{{
 configure:2758: gcc -E -traditional-cpp -D_FORTIFY_SOURCE=2 conftest.c
 >/dev/null 2>conftest.out
 In file included from /usr/include/assert.h:36:0,
                  from configure:2754:
 /usr/include/features.h:328:4: warning: #warning _FORTIFY_SOURCE requires
 compiling with optimization (-O) [-Wcpp]
  #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
 }}}

 which fails for the same reason.

 Finally it tries:

 {{{
 configure:2775: gcc -nologo -E -D_FORTIFY_SOURCE=2 conftest.c >/dev/null
 2>conftest.out
 gcc: error: unrecognized command line option '-nologo'
 }}}

 After everything it has tried has failed (by its standards), it
 unconditionally sets CPP to /lib/cpp and uses that (resulting in every
 subsequent use of $(CPP) failing).

 The first thing it tried (gcc -E) would actually work, but it doesn't know
 that.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2916#comment:7>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list