I got the second to latest gcc and latest binutils and am attempting to create a cross compiler on a Debian system. For some reason, GCC won't compile:

make[2]: Leaving directory `/home/dylan/Documents/cross/gcc-build/fixincludes'
Configuring in ./gmp
configure: error: invalid feature name: libstdc++-v3
make[1]: *** [configure-gmp] Error 1
make[1]: Leaving directory `/home/dylan/Documents/cross/gcc-build'
make: *** [all] Error 2

with this configuration:

../gcc-4.9.0/configure                               \
    --target=$TARGET                                \
    --prefix=$PREFIX                                  \
    --with-sysroot=/mnt                              \
    --with-newlib                                    \
    --without-headers                                \
    --with-local-prefix=/tools                       \
    --with-native-system-header-dir=/tools/include   \
    --disable-nls                                    \
    --disable-shared                                 \
    --disable-multilib                               \
    --disable-decimal-float                          \
    --disable-threads                                \
    --disable-libatomic                              \
    --disable-libgomp                                \
    --disable-libitm                                 \
    --disable-libquadmath                            \
    --disable-libsanitizer                           \
    --disable-libssp                                 \
    --disable-libvtv                                 \
    --disable-libcilkrts                             \
    --disable-libstdc++-v3                           \

I ran version check from Linux From Scratch and got this:

bash, version 4.2.37(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Debian) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 4.7.2-5) 4.7.2
GNU C Library (Debian EGLIBC 2.13-38+deb7u4) stable release version 2.13
grep (GNU grep) 2.12
gzip 1.5
Linux version 3.2.0-4-amd64 ([email protected]) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.60-1+deb7u3
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
Compilation OK

I don't think this is a bug as I see it on google, however all of these fixes and hints I see are not my problem. It seems as though the C++ library will not get disabled.

1 Answer 1


I had the exact same problem and was puzzled. The clue was in the error line:

configure: error: invalid feature name: libstdc++-v3
make[1]: *** [configure-gmp] Error 1

evidently the configure-gmp target (in make) was passed the feature name from the parent project.

The trick is to spell it out as follows in the command line:


Yes, that's right. Substitute underscores for the plus signs!

NB: according to the ./configure --help output of GCC 5.1, it's possible the --disable-libstdcxx option will also have the same effect. However, it's not clear when this was introduced and I didn't check.

Voluntary reading ;)

Here's my theory based on this bug report over at the GCC tracker.

Your command line, like mine, suggests you were using the GMP that is either already linked into place inside the GCC source tree or the one downloaded by the script contrib/download_prerequisites from inside the GCC tarball (that is the method I used) - which does the symlinking.

Let's assume that case for the moment. As listed on this documentation page GMP, MPFR and MPC are prerequisites to GCC. See the Wiki page section Support libraries for a more detailed explanation of this "built-in" method.

Aforementioned script hard-codes (as of GCC 5.1) gmp-4.3.2 to be downloaded from the GNU FTP server.

Curiously 4.3.2 is mentioned on the old releases page in the scope of the 4.3.1 release:

Issues with GMP 4.3.1 (see also info about 4.3.2 above):

but does in fact not get its own listing (nor a date/time).

In the bug report, over on the GCC tracker, Ralf notes:

This error is from the Autoconf code that parses arguments, it currently disallows characters other than alphanumeric, minus, dot, or underscore in --enable/--disable/--with/--without arguments. I suppose this should be fixed in Autoconf.

However, there is also a bug in configure.ac, and with that fixed, you will be able to use


(i.e., with the plus signs converted to underscore). Once GCC switches to a fixed Autoconf version, the plus sign conversion will not be needed any more.

Now, since we're getting the packages already prepared with whatever Autoconf version was available on the package maintainer's machine and we're using a relatively old GMP version, it stands to reason that the generated configure script inside the GMP tarball is prone to the defect noted by Ralf in the above mentioned ticket.

Hence you need to work around the silly bug, due to a dependency that is somewhat older than perhaps necessary.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .