PDA

View Full Version : Resin 4 wrong ELF class: ELFCLASS64


skippopotamus
04-15-2010, 06:13 PM
Hi everyone. I am compiling Resin 4.0.4 on Solaris 10 and I'm getting some ld fatal errors during make. I'm just going ./configure, make. Resin 3x compiles and makes just fine on the same machine.
We're going to deploy this at a customer so it needs to compile perfectly or they are going to be nervous about the install and it'll always come into question.
Has anyone seen these and gotten around them?

ld: fatal: file boot.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresin_os.so
collect2: ld returned 1 exit status
make[2]: *** [libresin_os.so] Error 1

ld: fatal: file ../resin_os/std.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresin.so
collect2: ld returned 1 exit status
make[2]: *** [libresin.so] Error 1

ld: fatal: file ssl_stub.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresinssl.so
collect2: ld returned 1 exit status

emil
04-15-2010, 09:25 PM
Hi skippopotamus,

Sounds like configure may have generated a bogus Makefile. Are you running on a 64 or 32-bit machine?

Thanks,
Emil

skippopotamus
04-15-2010, 09:39 PM
Hi Emil. I'm running on a 64 bit machine. A t5120.
SunOS hostname-a 5.10 Generic_142900-01 sun4v sparc SUNW,SPARC-Enterprise-T5120

emil
04-16-2010, 12:47 AM
Hi skippopotamus,

Can you try running "make distclean" and then rerunning configure with the "--enable-64bit" flag? It sounds like some of the object files are being produced incorrectly.

If that doesn't work, can you post the Resin configuration summary that configure prints out at the end? It should look something like this:


Resin Configuration summary:

RESIN_HOME: /home/emil/support/resin-pro-4.0.5
root: /home/emil/support/resin-pro-4.0.5
conf: /home/emil/support/resin-pro-4.0.5/conf
log : /home/emil/support/resin-pro-4.0.5/log
init: /etc/init.d/resin

JAVA_HOME: /usr/lib/jvm/java-6-sun

+ 32-bit JNI in -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux
+ JNI CFLAGS: -g -O2 -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI
+ epoll() for keepalives
+ OpenSSL 0.9.8g 19 Oct 2007
OpenSSL include: /usr/include
OpenSSL lib: /usr/lib
OpenSSL libraries: -lssl -lcrypto


Thanks,
Emil

skippopotamus
04-16-2010, 05:45 PM
Sure I can. I ran make distclean.
Then I used ./configure --disable-ssl --prefix=/appservers/resin-pro-4.0.4 --enable-64bit --with-java-home=/usr/jdk/jdk1.6.0_18

Resin Configuration summary:

RESIN_HOME: /appservers/resin-pro-4.0.4
root: /var/www
conf: /etc/resin
log : /var/log/resin
init: /etc/init.d/resin

JAVA_HOME: /usr/jdk/jdk1.6.0_18

+ 64-bit JNI in -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris
+ JNI CFLAGS: -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI
+ poll() for keepalives
+ not using OpenSSL

-bash-3.00$ make
Makefile:282: warning: overriding commands for target `modules/c/src/Makefile'
Makefile:272: warning: ignoring old commands for target `modules/c/src/Makefile'
(cd modules/c/src; make)
make[1]: Entering directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src'
for dir in common resin_os resin resinssl; do (cd $dir; make); done
make[2]: Entering directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/common'
gcc -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI stream.c
stream.c: In function `select_host':
stream.c:1394: warning: cast from pointer to integer of different size
gcc -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI config.c
gcc -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI memory.c
/export/home/nbbs/resin-pro-4.0.4/libtool --silent --mode=compile gcc -o stream.lo -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI stream.c
stream.c: In function `select_host':
stream.c:1394: warning: cast from pointer to integer of different size
/export/home/nbbs/resin-pro-4.0.4/libtool --silent --mode=compile gcc -o config.lo -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI config.c
/export/home/nbbs/resin-pro-4.0.4/libtool --silent --mode=compile gcc -o memory.lo -c -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI memory.c
make[2]: Leaving directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/common'
make[2]: Entering directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resin_os'
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o boot.o boot.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o java.o java.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o jni_os.o jni_os.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o jni_jvmti.o jni_jvmti.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o jni_socket.o jni_socket.c
jni_socket.c: In function `Java_com_caucho_vfs_JniServerSocketImpl_bindPort' :
jni_socket.c:691: warning: passing arg 2 of `getsockname' from incompatible pointer type
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o memory.o memory.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -m64 -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -c -o std.o std.c
gcc -G -fPIC -o libresin_os.so boot.o java.o jni_os.o jni_jvmti.o jni_socket.o memory.o std.o -lnsl -lsocket -lthread
ld: fatal: file boot.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresin_os.so
collect2: ld returned 1 exit status
make[2]: *** [libresin_os.so] Error 1
make[2]: Leaving directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resin_os'
make[2]: Entering directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resin'
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o jni_vfs.o jni_vfs.c
jni_vfs.c:1344:8: warning: extra tokens at end of #endif directive
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o profile.o profile.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o heap.o heap.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o lru.o lru.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o symbol.o symbol.c
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o stat.o stat.c
gcc -G -fPIC -o libresin.so ../resin_os/std.o ../resin_os/memory.o ../resin_os/java.o jni_vfs.o profile.o heap.o lru.o symbol.o crc64.o stat.o -lnsl -lsocket -lthread
ld: fatal: file ../resin_os/std.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresin.so
collect2: ld returned 1 exit status
make[2]: *** [libresin.so] Error 1
make[2]: Leaving directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resin'
make[2]: Entering directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resinssl'
gcc -g -O2 -DPOLL -D_POSIX_PTHREAD_SEMANTICS -DB64 -m64 -D__SOLARIS__ -DHAS_JVMTI -DRESIN_HOME=\"/appservers/resin-pro-4.0.4\" -I/usr/jdk/jdk1.6.0_18/include -I/usr/jdk/jdk1.6.0_18/include/solaris -I../common -I../resin -DCPU=\"sparcv9\" -DOS= -m64 -fPIC -c -o ssl_stub.o ssl_stub.c
gcc -G -fPIC -o libresinssl.so ssl_stub.o ../resin_os/memory.o ../resin_os/std.o ../resin_os/java.o -lnsl -lsocket -lthread
ld: fatal: file ssl_stub.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to libresinssl.so
collect2: ld returned 1 exit status
make[2]: *** [libresinssl.so] Error 1
make[2]: Leaving directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src/resinssl'
make[1]: *** [plugins] Error 2
make[1]: Leaving directory `/export/home/nbbs/resin-pro-4.0.4/modules/c/src'
make: *** [all] Error 2

emil
04-19-2010, 05:46 PM
Hi skippopotamus,

I've filed a bug for it here:

http://bugs.caucho.com/view.php?id=4004

I don't see anything obvious at the moment, but once I get a chance to try this on a solaris box, I suspect it's just a CFLAGS issue. Can you also give me the output of "uname -a" just to make sure I test on the same version of Solaris?

Thanks,
Emil

skippopotamus
04-19-2010, 06:01 PM
Hi Emil, I tried it on another Solaris 10 box just to make sure and I did get the same error.
Here's uname -a from both machines:

-bash-3.00$ uname -a
SunOS mbbs-app1 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V215

-bash-3.00$ uname -a
SunOS hostname-a 5.10 Generic_142900-01 sun4v sparc SUNW,SPARC-Enterprise-T5120

emil
04-19-2010, 09:01 PM
Hi skippopotamus,

Thanks, I've updated the bug report with the additional info.

Emil

skippopotamus
05-24-2010, 04:53 PM
Hiya. This is resolved in 4.0.7.

emil
05-24-2010, 11:39 PM
Thanks for letting us know it worked!

Emil