public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "karlson2k at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/56271] New: GCC build errors when building ada and using LDFLAGS
Date: Sun, 10 Feb 2013 00:11:00 -0000	[thread overview]
Message-ID: <bug-56271-4@http.gcc.gnu.org/bugzilla/> (raw)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56271

             Bug #: 56271
           Summary: GCC build errors when building ada and using LDFLAGS
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: karlson2k@gmail.com
              Host: i686-pc-mingw32
            Target: i686-pc-mingw32
             Build: x86_64-w64-mingw32, i686-w64-mingw32


GCC is configured with 

LDFLAGS="-L/home/xxx/mingw-w64/packages/gcc/packages/gmp/gmp-5.1.0-i686/lib"
../../source/gcc-4.7.2/configure --build=i686-pc-mingw32 --host=i686-pc-mingw32
--target=i686-w64-mingw32 --disable-nls --disable-multilib
--prefix=/home/xxx/mingw-w64/mingw-w64-i686
--with-sysroot=/home/xxx/mingw-w64/mingw-w64-i686
--with-native-system-header-dir=/i686-w64-mingw32/include
--with-host-libstdcxx=/mingw/lib/gcc/mingw32/4.7.2/libstdc++.a
--disable-cloog-version-check --disable-ppl-version-check
--with-mpc=/home/xxx/mingw-w64/packages/gcc/packages/mpc/mpc-1.0.1-i686
--with-mpfr=/home/xxx/mingw-w64/packages/gcc/packages/mpfr/mpfr-3.1.1-i686
--with-gmp=/home/xxx/mingw-w64/packages/gcc/packages/gmp/gmp-5.1.0-i686
--with-ppl=/home/xxx/mingw-w64/packages/gcc/packages/ppl/ppl-1.0-i686
--with-isl=/home/xxx/mingw-w64/packages/gcc/packages/isl/isl-0.11.1-i686
--with-cloog=/home/xxx/mingw-w64/packages/gcc/packages/cloog-ppl/cloog-ppl-0.15.11-i686
--enable-languages=ada,c,c++ --enable-threads=win32
--enable-fully-dynamic-string --disable-sjlj-exceptions
--with-multilib-list=m32 --with-arch=pentium3
--enable-leading-mingw64-underscores --with-dwarf2 --enable-lto
--disable-win32-registry --with-win32-nlsapi=unicode --enable-libstdcxx-debug

Building ada is always produce some errors like 

if [ -f gnat1.exe ] ; \
        then \
          make "ADA_CFLAGS=" "BISON=bison" "BISONFLAGS=" "CFLAGS=-pipe
-D__USE_MINGW_ACCESS "
"LDFLAGS=-L/home/xxx/mingw-w64/packages/gcc/packages/gmp/gmp-5.1.0-i686/lib
"FLEX=flex" "FLEXFLAGS=" "LN=ln" "LN_S=cp -pR"
"MAKEINFO=makeinfo--split-size=5000000" "MAKEINFOFLAGS=--no-split"
"MAKEOVERRIDES=" "SHELL=/bin/sh" "exeext=.exe" "build_exeext=.exe" "objext=.o"
"exec_prefix=/home/xxx/mingw-w64/mingw-w64-i686"
"prefix=/home/xxx/mingw-w64/mingw-w64-i686" "local_prefix=/usr/local"
"gxx_include_dir=/home/xxx/mingw-w64/mingw-w64-i686/lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/c++/4.7.2"
"build_tooldir=/home/xxx/mingw-w64/mingw-w64-i686/i686-w64-mingw32"
"gcc_tooldir=/home/xxx/mingw-w64/mingw-w64-i686/lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32"
"bindir=/home/xxx/mingw-w64/mingw-w64-i686/bin"
"libexecsubdir=/home/xxx/mingw-w64/mingw-w64-i686/libexec/gcc/i686-w64-mingw32/4.7.2"
"datarootdir=/home/xxx/mingw-w64/mingw-w64-i686/share"
"datadir=/home/xxx/mingw-w64/mingw-w64-i686/share"
"localedir=/home/xxx/mingw-w64/mingw-w64-i686/share/locale" "ADA_FOR_BUILD="
"ADA_INCLUDE_DIR=/home/xxx/mingw-w64/mingw-w64-i686/lib/gcc/i686-w64-mingw32/4.7.2/adainclude"
"ADA_RTL_OBJ_DIR=/home/xxx/mingw-w64/mingw-w64-i686/lib/gcc/i686-w64-mingw32/4.7.2/adalib"
"ADAFLAGS=-gnatpg -gnata -gnatwns -W -Wall" "ADA_FOR_TARGET="
"INSTALL=/bin/install -c" "INSTALL_DATA=/bin/install -c -m 644"
"INSTALL_PROGRAM=/bin/install -c" install-gnatlib; \
        fi
/bin/sh: -c: line 2: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 4: syntax error: unexpected end of file
make[1]: [ada.install-common] Error 2 (ignored)

As you can see make parameter "LDFLAGS=... don't have closing double quote.
The reason for this is as follows: 'root' Makefile adds to LDFLAGS: 

LDFLAGS += -Wl,--stack,12582912

, so ./gcc/Makefile has 

LDFLAGS = 
-L/home/Karlson/mingw-w64/packages/gcc/packages/gmp/gmp-5.1.0-i686/lib
-Wl,--stack,12582912

that flag in included into FLAGS_TO_PASS by

FLAGS_TO_PASS = \
    "ADA_CFLAGS=$(ADA_CFLAGS)" \
    "BISON=$(BISON)" \
    "BISONFLAGS=$(BISONFLAGS)" \
    "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
    "LDFLAGS=$(LDFLAGS)" \
    "FLEX=$(FLEX)" \...

which is filtered in included makefile
source/gcc/ada/gcc-interface/Make-lang.in:

COMMON_FLAGS_TO_PASS = $(filter-out -pedantic -W%, $(FLAGS_TO_PASS))

This filter is supposed to exclude '-pedantic' and all warning control flags,
but in real:
1. Don't filter out option not surrounded by spaces, like CFLAGS=-pedantic
2. With '-W%' filter out with closing quote in "LDFLAGS=-L/some/path
-Wl,--stack,12582912"
3. Filter out all -Wp,... -Wl,... -Wa,.. options as well


             reply	other threads:[~2013-02-10  0:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-10  0:11 karlson2k at gmail dot com [this message]
2013-02-10 11:55 ` [Bug ada/56271] " karlson2k at gmail dot com
2013-02-20 18:24 ` ebotcazou at gcc dot gnu.org
2013-02-20 18:28 ` ebotcazou at gcc dot gnu.org
2013-02-20 21:29 ` k2k at narod dot ru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56271-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).