This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: compiling error for version 4.9.0 and 4.9.2
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Pengcheng Yang <yangpc at mail dot biols dot ac dot cn>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 31 Mar 2015 11:43:12 +0100
- Subject: Re: compiling error for version 4.9.0 and 4.9.2
- Authentication-results: sourceware.org; auth=none
- References: <551A67EC dot 7060703 at mail dot biols dot ac dot cn> <551A742C dot 1080407 at mail dot biols dot ac dot cn>
On 31 March 2015 at 11:17, Pengcheng Yang <yangpc@mail.biols.ac.cn> 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
https://gcc.gnu.org/wiki/FAQ#configure
> --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
https://gcc.gnu.org/wiki/InstallingGCC 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