multiple definition error when compiling gcc-4.4.2

xinsan Chen xinsan.chen@gmail.com
Wed Nov 25 02:50:00 GMT 2009


2009/11/22 xinsan Chen <xinsan.chen@gmail.com>:
> 2009/11/21 Andi Hellmund <mail@andihellmund.com>:
>> xinsan Chen wrote:
>>>  hi, all
>>>     Now I meet new problem during compiling gcc-4.4.2.
>>>     after installing gmp and mpfr,
>>>     ./configure --prefix=/home/cj/gcc-4.4.2
>>> --enable_languages=c,c++,fortran --with-gmp=/usr/local
>>> --with-mpfr=/usr/local
>>>     make
>>>
>>>     .libs/compile_options.o: In function 'feof_unlocked'
>>>     /usr/include/bits/stdio.h:123: multiple definition of 'feof_unlocked'
>>>    .libs/backtrace.o:/usr/include/bits/stdio.h:123: first defined here
>>>    .libs/compile_options.o: In function 'ferror_unlocked':
>>>    /usr/include/bits/stdio.h:130: multiple definition of 'ferror_unlocked'
>>>    .libs/backtrace.o:/usr/include/bits/stdio.h:130: first defined here
>>>    ...
>>>
>>>     How to solve this? Thanks.
>>>
>>>
>
> Firstly, Thank you for your reply.
>
>
>> first of all, you should conform to the recommendations on
>> http://gcc.gnu.org/install/configure.html
>>
>> "First, we *highly* recommend that GCC be built into a separate
>> directory from the sources which does *not* reside within the source tree."
>>
>> Andi
>>
>
> But I don't think noting building GCC into a separate directory will
> lead to errors.
>

I do:
    GCC is built into a separate directory from the sources.

     mkdir gcc-442
     cd gcc-442   (source directory)
     /home/cj/gcc-4.4.2/configure --prefix=/home/cj/gcc-442
--enable-languages=c,c++,fortran --with-gmp=/usr/local
--with-mpfr=/usr/local
     make

     make[3]: Leaving directory `/home/cj/gcc-442/gcc'
mkdir -p -- x86_64-unknown-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-unknown-linux-gnu/libgcc
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for x86_64-unknown-linux-gnu-ar... ar
checking for x86_64-unknown-linux-gnu-lipo... lipo
checking for x86_64-unknown-linux-gnu-nm... /home/cj/gcc-442/./gcc/nm
checking for x86_64-unknown-linux-gnu-ranlib... ranlib
checking for x86_64-unknown-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for x86_64-unknown-linux-gnu-gcc... /home/cj/gcc-

442/./gcc/xgcc -B/home/cj/gcc-442/./gcc/ -B/home/cj/gcc-442/x86_64-

unknown-linux-gnu/bin/ -B/home/cj/gcc-442/x86_64-unknown-linux-gnu/lib/

-isystem /home/cj/gcc-442/x86_64-unknown-linux-gnu/include -isystem

/home/cj/gcc-442/x86_64-unknown-linux-gnu/sys-include
checking for suffix of object files... configure: error: in

`/home/cj/gcc-442/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/cj/gcc-442'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/cj/gcc-442'
make: *** [all] Error 2



More information about the Gcc-help mailing list