This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] tweak -ffunction-sections configure test


Benjamin Kosnik wrote:

> This adds -g to the compile line when testing -ffunction-sections, in
> the hopes that the results will be more accurate on AIX and cygwin, and
> reflect actual usage.
> 
> In addition, I fixed up the breakage caused when I added the function
> definition to the test code to be compiled.

This test is still problematic, at least on MinGW (and thus probably
Cygwin but I haven't checked it yet.)  On a cross from current HEAD I
see this:

configure:16661: checking for g++ that supports -ffunction-sections
-fdata-sections
configure:16680:  /b/mingw-43-dw2-cross/./gcc/xgcc -shared-libgcc
-B/b/mingw-43-dw2-cross/./gcc -nostdinc++
-L/b/mingw-43-dw2-cross/i686-pc-mingw32/libstdc++-v3
/src -L/b/mingw-43-dw2-cross/i686-pc-mingw32/libstdc++-v3/src/.libs
-L/b/mingw-43-dw2-cross/i686-pc-mingw32/winsup/mingw
-L/b/mingw-43-dw2-cross/i686-pc-mingw32
/winsup/w32api/lib -isystem /s/c/winsup/mingw/include -isystem
/s/c/winsup/w32api/include -B/i/mingw-43-dw2-cross/i686-pc-mingw32/bin/
-B/i/mingw-43-dw2-cross/i
686-pc-mingw32/lib/ -isystem
/i/mingw-43-dw2-cross/i686-pc-mingw32/include -isystem
/i/mingw-43-dw2-cross/i686-pc-mingw32/sys-include
-L/b/mingw-43-dw2-cross/./
ld -c -g -Werror -ffunction-sections -fdata-sections  conftest.cc >&5
cc1plus: warnings being treated as errors
conftest.cc:1: error: -ffunction-sections may affect debugging on some
targets
configure:16686: $? = 1
configure: failed program was:
[...]
configure:16718: result: no

Would it be acceptable to omit -Werror if $host in
*-mingw32*|*-cygwin*?  I'm a little confused about -Werror handling here
anyway as WERROR is set only if USE_MAINTAINER_MODE=yes, but then in the
test itself -Werror is put in CXXFLAGS unconditionally:

  # Check for maintainer-mode bits.
  if test x"$USE_MAINTAINER_MODE" = xno; then
    WERROR=''
  else
    WERROR='-Werror'
  fi

  # Check for -ffunction-sections -fdata-sections
  AC_MSG_CHECKING([for g++ that supports -ffunction-sections
-fdata-sections])
  CXXFLAGS='-g -Werror -ffunction-sections -fdata-sections'
  AC_TRY_COMPILE([int foo; void bar() { };],, [ac_fdsections=yes],
[ac_fdsections=no])

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]