[JIRA] Created: (CPPXT-84) Problems compiling log4shib on Solaris SPARC 10 with Sun Studio 12.1 with 64bit libraries

jm.lopez@idp.protectnetwork.org (JIRA) noreply at shibboleth.net
Wed Jan 18 21:09:26 GMT 2012


Problems compiling log4shib on Solaris SPARC 10 with Sun Studio 12.1 with 64bit libraries
-----------------------------------------------------------------------------------------

                 Key: CPPXT-84
                 URL: https://issues.shibboleth.net/jira/browse/CPPXT-84
             Project: XMLTooling - C++
          Issue Type: Bug
      Security Level: Standard (Standard bug, may impact functionality but does not represent a security vulnerability )
          Components: Other
    Affects Versions: 1.0
         Environment: Solaris 5.10 SPARC-Enterprise-T5220
UltraSPARC-T2 16 virtual processors @1165MHz
Memory size: 32768 Megabytes

Sun Studio 12 Update 1
Native OpenSSL 0.9.7
            Reporter: jm.lopez at idp.protectnetwork.org
            Assignee: Scott Cantor
         Attachments: configure_n_make_32bit.txt, configure_n_make_64bit_SPARC.txt

I've been trying to compile log4shib on Solaris SPARC 10 with Sun Studio 12.1 and the following script:

#!/bin/sh
# Built on Solaris 10 with the native OpenSSL 64Bit libraries
# Using Solaris SPARC 64Bit options and Sun Studio 11.2
# Component: log4shib

PATH=/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin; export PATH    

env  CC="cc" \
     CXX="CC" \
     CFLAGS="-xO2 -m64" \
     CXXFLAGS="-xO2 -m64" \
     LDFLAGS="-m64 -R/usr/sfw/lib/sparcv9" \
     INSTALL=/usr/ucb/install \
     LIBTOOL=/usr/local/bin/libtool \
     ./configure LIBTOOL=/usr/local/bin/libtool \
     --disable-static \
     --prefix=/local/sfw \
     --disable-doxygen
#!/end

The configuration step ends well, however at the moment I start the compilation, it just end with something like the following excerpt (see attached file for more details):

CC -m64 -DHAVE_CONFIG_H -I. -I. -I../include -I../include -I../src     -mt
-D_REENTRANT  -m64 -xO2 -c -o testmain.o testmain.cpp
/bin/bash ../libtool --mode=link CC -m64  -mt -D_REENTRANT  -m64 -xO2
-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9 -o testmain  testmain.o
../src/liblog4shib.la -lpthread -lnsl -lsocket
mkdir .libs
CC -m64 -D_REENTRANT -m64 -xO2 -o .libs/testmain testmain.o  -mt
-L/usr/sfw/lib/sparcv9 ../src/.libs/liblog4shib.so -lpthread -lnsl -lsocket
ld: fatal: file ../src/.libs/liblog4shib.so: open failed: No such file or
directory
ld: fatal: file processing errors. No output written to .libs/testmain
*** Error code 1
make: Fatal error: Command failed for target `testmain'
Current working directory /local/sfw/src/log4shib-1.0.4/tests
*** Error code 1
The following command caused the error:
set fnord $MAKEFLAGS; amf=$2; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='debian msvc6 msvc8 msvc9 bcb5 config src include tests'; for subdir
in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (cd $subdir && make  $local_target) \
   || case "$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'


I searched on the web but didn't find anything relevant so far. It seems that the script cannot have access to the file ../src/.libs/liblog4shib.so. Looking into the directory, the file liblog4shib.so.1.0.4 doesn't exist which is the target of the soft link liblog4shib.so. And there you go, this is my dead-end, I haven't figured it out why's not compiling the liblog4shib.so.1.0.4 library.

log4shib-1.0.4/src/.libs
.
.
.
lrwxrwxrwx   1 root     root          20 Jan 13 15:31 liblog4shib.so.1 -> liblog4shib.so.1.0.4
lrwxrwxrwx   1 root     root          20 Jan 13 15:31 liblog4shib.so -> liblog4shib.so.1.0.4
-rw-r--r--   1 root     root         853 Jan 13 15:31 liblog4shib.lai
lrwxrwxrwx   1 root     root          17 Jan 13 15:31 liblog4shib.la -> ../liblog4shib.la

The fact is that if I don't use "-m64" flag for a 64-bit SPARC architecture it will compile with any trouble but I'll have a 32-bit MSB dynamic lib SPARC32PLUS:

# file liblog4shib.so.1.0.4
liblog4shib.so.1.0.4:   ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped


Which is not the same as other components that I've successfully compiled for a 64-bit SPARC architecture, so eventually I'll get either a ELFCLASS64 or ELFCLASS32 error.

WORKAROUND:

Download the latest version of log4cpp, run the configuration script using the same options as if log4shib. Run the log4shib configuration script and replace libtool file by log4cpp's which is using a newer version of libtool:

src/log4shib-1.0.4> ./libtool-old --version
ltmain.sh (GNU libtool) 1.5.2 (1.1220.2.60 2004/01/25 12:25:08)
Copyright (C) 2003  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

src/log4shib-1.0.4> ./libtool --version
ltmain.sh (GNU libtool) 1.5.24 (1.1220.2.456 2007/06/24 02:25:32)
Copyright (C) 2007  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Run make, make install.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the commits mailing list