This is the mail archive of the mailing list for the GCC 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: compiling error for version 4.9.0 and 4.9.2

On 31 March 2015 at 11:17, Pengcheng Yang <> wrote:
> Hi all,
> I have compiled gcc-4.9.2, but the same error reoccurred.
> the command is:
> ./configure --prefix=/panfs/home/kang/yangpc/soft/lib/gcc-4.9.2/

Firstly, don't use ./configure to build GCC, see

> --with-gmp=/panfs/home/kang/yangpc/soft/lib/gmp-5.1.3/
> --with-mpfr=/panfs/home/kang/yangpc/soft/lib/packages/mpfr-3.1.2/
> --with-mpc=/panfs/home/kang/yangpc/soft/lib/mpc/ --disable-multilib

Secondly, it is much easier to build gmp, mpfr and mpc directly in the
GCC tree, instead of installing them separately, see for how to use the
contrib/download_prerequisites script that means you don't need to use
--with-gmp and --with-mpfr and --with-mpc.

Thirdly, your paths look suspicious. The prefix for gcc, gmp and mpc
is .../soft/lib/ but the prefix for mpfr is .../soft/lib/packages ...
which is also the build path shown below. Make sure you are not trying
to build in the source tree, and are not trying to build in the
install location specified with --prefix.

> g++: braced spec '%:sanitize(address):%{!shared:libasan_preinit%O%s}
> %{static-libasan:%{!shared:-Bstatic --whole-archive -lasan
> --no-whole-archive -Bdynamic}}%{!static-libasan:-lasan}}
> %{%:sanitize(thread):%{static-libtsan:%{!shared:-Bstatic --whole-archive
> -ltsan --no-whole-archive -Bdynamic}}%{!static-libtsan:-ltsan}}
> %{%:sanitize(leak):%{static-liblsan:%{!shared:-Bstatic --whole-archive
> -llsan --no-whole-archive -Bdynamic}}%{!static-liblsan:-llsan}}' is invalid
> at '%'
> make[3]: *** [xg++] Error 1
> make[3]: Leaving directory
> `/panfs/home/kang/yangpc/soft/lib/packages/gcc-4.9.2/host-x86_64-unknown-linux-gnu/gcc'
> make[2]: *** [all-stage1-gcc] Error 2
> make[2]: Leaving directory
> `/panfs/home/kang/yangpc/soft/lib/packages/gcc-4.9.2'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory
> `/panfs/home/kang/yangpc/soft/lib/packages/gcc-4.9.2'
> make: *** [all] Error 2

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