GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 42750 - OpenMP/gcc build fails with /usr/local/lib/libgmp.so: could not read symbols: File in wrong format
Summary: OpenMP/gcc build fails with /usr/local/lib/libgmp.so: could not read symbols:...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 53583 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-14 21:35 UTC by David Biesack
Modified: 2012-06-05 19:44 UTC (History)
4 users (show)

See Also:
Host: x86_64-redhat-linux
Target: x86_64-redhat-linux
Build: x86_64-redhat-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Biesack 2010-01-14 21:35:21 UTC
I did a svn checkout of the GOMP/OpenMP source
  dir
  155860
  svn://gcc.gnu.org/svn/gcc/trunk
  svn://gcc.gnu.org/svn/gcc

and build/installed recent versions of gmp, mpfr, mpc:
gmp-4.3.2	mpc-0.8.1  mpfr-2.4.2
in /usr/local

I configured gcc with 
 $ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local

My current gcc is 

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)

I also did:

export LD_LIBRARY_PATH=/usr/local/lib
export LIBRARY_PATH=/usr/local/lib

I then started building gcc and it failed after a while:

/bin/sh ../../../libtool --tag=CC   --mode=compile /usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include  -m32 -DHAVE_CONFIG_H -I. -I../../../../../../.././libjava/classpath/native/jni/java-math -I../../../include  -I../../../../../../.././libjava/classpath/include -I../../../../../../.././libjava/classpath/native/jni/classpath -I../../../../../../.././libjava/classpath/native/jni/native-lib  -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long  -I/usr/include -g -O2  -m32 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c -o gnu_java_math_GMP.lo ../../../../../../.././libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c
libtool: compile:  /usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -m32 -DHAVE_CONFIG_H -I. -I../../../../../../.././libjava/classpath/native/jni/java-math -I../../../include -I../../../../../../.././libjava/classpath/include -I../../../../../../.././libjava/classpath/native/jni/classpath -I../../../../../../.././libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -m32 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c ../../../../../../.././libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c  -fPIC -DPIC -o .libs/gnu_java_math_GMP.o
mv -f .deps/gnu_java_math_GMP.Tpo .deps/gnu_java_math_GMP.Plo
/bin/sh ../../../libtool --tag=CC   --mode=link /usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include  -m32 -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long  -I/usr/include -g -O2  -m32 -module -version-info 0:0:0 -no-undefined -lgmp -avoid-version -m32 -o libjavamath.la -rpath /usr/local/lib/../lib/gcj-4.5.0-11 gnu_java_math_GMP.lo ../../../native/jni/classpath/jcl.lo 
libtool: link: /usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/usr/local/src/gomp/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include  -m32 -shared  .libs/gnu_java_math_GMP.o ../../../native/jni/classpath/.libs/jcl.o   -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib /usr/local/lib/libgmp.so -lc  -m32 -m32 -m32   -Wl,-soname -Wl,libjavamath.so -o .libs/libjavamath.so
/usr/local/lib/libgmp.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[8]: *** [libjavamath.la] Error 1
make[8]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni/java-math'
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/32/libjava/classpath/native'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/32/libjava/classpath'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/32/libjava'
make[3]: *** [multi-do] Error 1
make[3]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/libjava'
make[2]: *** [all-multi] Error 2
make[2]: Leaving directory `/usr/local/src/gomp/x86_64-unknown-linux-gnu/libjava'
make[1]: *** [all-target-libjava] Error 2
make[1]: Leaving directory `/usr/local/src/gomp'
make: *** [all] Error 2

However, 'make check' when I built libgmp worked, so I believe the
libgmp.so is valid. checking the installed version shows:

# ldd /usr/local/lib/libgmp.so
	libc.so.6 => /lib64/libc.so.6 (0x00002b8f69b5d000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003a05c00000)
# nm /usr/local/lib/libgmp.so
00000000002515a0 d Linear_Congruential_Generator
00000000002516a0 d Mersenne_Twister_Generator
0000000000251680 d Mersenne_Twister_Generator_Noseed
0000000000251740 a _DYNAMIC
00000000002519d0 a _GLOBAL_OFFSET_TABLE_
                 U _IO_getc@@GLIBC_2.2.5
                 U _IO_putc@@GLIBC_2.2.5
                 w _Jv_RegisterClasses
....
00000000000477d0 t step
0000000000047940 t step
                 U strchr@@GLIBC_2.2.5
                 U strcpy@@GLIBC_2.2.5
                 U strlen@@GLIBC_2.2.5
0000000000048a20 r table.4538
0000000000047970 t unget
                 U ungetc@@GLIBC_2.2.5
                 U vfprintf@@GLIBC_2.2.5
                 U vsnprintf@@GLIBC_2.2.5
                 U vsprintf@@GLIBC_2.2.5
000000000004b720 r x.4549
000000000004b6c0 r x.4551
000000000004b7a0 r x.4551

So I'm not sure why this gcc build step failed, unable to read symbols.
Comment 1 Andrew Pinski 2010-01-14 21:39:20 UTC
This is related to PR 39747.  The issue is that you need both 32bit and 64bit libgmp for the target if you are compiling libjava also.
Comment 2 Feng Chen 2011-05-26 19:17:33 UTC
Would some1 be able to point to me how to build (and keep) both 32bit and 64bit version of libgmp in my system so the gcc can be built?
btw, I do not have root access for this particular machine so I always use "./configure --prefix=$HOME/local"

(In reply to comment #1)
> This is related to PR 39747.  The issue is that you need both 32bit and 64bit
> libgmp for the target if you are compiling libjava also.
Comment 3 Andrew Pinski 2012-06-05 19:44:29 UTC
*** Bug 53583 has been marked as a duplicate of this bug. ***