bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LIBTOOL not detecting f77 workshop 6.0 compiler shared capabilities on


From: Eric FAYOLLE
Subject: LIBTOOL not detecting f77 workshop 6.0 compiler shared capabilities on solaris2.6 sparc SUNW,Ultra-250
Date: Wed, 21 Jan 2004 11:26:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.5) Gecko/20031007

I'm porting my project on solaris 2.6 with native C & f77 workshop 6.0 compiler. I use Automake1.7.9 & libtool1.5 & autoconf 2.58 to generate Makefiles & configure .. and do the make dist on a Woody system. The project compile correctly with GNU compiler but not native workshop 6.0 compilers. The problem first appear at link time when I generate my dynamic library, the compiler said something like : "ld: fatal: relocations remain against allocatable but non-writable sections". The reason wy I get this message is in fact the f77 flags where not set with -DPIC -KPIC, so I looked for specific shared capabilities messages at configure time.

"
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.6 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for f77 option to produce PIC... -KPIC
checking if f77 PIC flag -KPIC works... no <---------------------------------- That is the problem
checking if f77 supports -c -o file.o... no
checking whether the f77 linker (/usr/ccs/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.6 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking for ANSI C header files... (cached) yes
checking malloc.h usability...
"

When appending configuration tag "F77" to libtool "checking if f77 PIC flag -KPIC works... no" dosen't work corrctly.
config.log says : "

......
configure:13668: result: -KPIC
configure:13676: checking if f77 PIC flag -KPIC works
configure:13694: f77 -c -g -KPIC conftest.f >&5
conftest.f:
      t:
configure:13698: $? = 0
configure:13709: result: no
configure:13733: checking if f77 supports -c -o file.o
configure:13761: f77 -c -g -o out/conftest2.o conftest.f >&5
....
"

The returned code is 0 but the result is no.
I added some echo to see what configure is doing :

"#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic_F77"; then

echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_prog_compiler_pic_works_F77=no
ac_outfile=conftest.$ac_objext
 printf "$lt_simple_compile_test_code" > conftest.$ac_ext
echo =======                        <-------------------- FIRST ECHO
cat conftest.$ac_ext
echo =======
 lt_compiler_flag="$lt_prog_compiler_pic_F77"
 # Insert the option either (1) after the last *FLAGS variable, or
 # (2) before a word containing "conftest.", or (3) at the end.
 # Note that $ac_compile itself does not contain backslashes and begins
 # with a dollar sign (not a hyphen), so the echo should work correctly.
 # The option is referenced via a variable to avoid confusing sed.
 lt_compile=`echo "$ac_compile" | $SED \
 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
 -e 's:$: $lt_compiler_flag:'`
 (eval echo "\"\$as_me:13694: $lt_compile\"" >&5)
 (eval "$lt_compile" 2>conftest.err)
eval echo "\"\$as_me:13812: $lt_compile\"" <------------- SECOND ONE
echo "ac_outfile = $ac_outfile"
echo ========
cat conftest.err
echo ========
 ac_status=$?
 cat conftest.err >&5
 echo "$as_me:13698: \$? = $ac_status" >&5
 if (exit $ac_status) && test -s "$ac_outfile"; then
   # The compiler can only warn and ignore the option if not recognized
   # So say no if there are warnings
   if test ! -s conftest.err; then
     lt_prog_compiler_pic_works_F77=yes
   fi
 fi
 $rm conftest*
"

The result is :

CC=cc F77=f77 ./configure
.......
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for f77 option to produce PIC... -KPIC
checking if f77 PIC flag -KPIC works... =======
    subroutine t
    return
    end
=======
configure:13812: f77 -c -g -KPIC conftest.f >&5
ac_outfile = conftest.o
========
conftest.f:         <--- conftest.err contains compiler information
  t:
========
no
checking if f77 supports -c -o file.o... no
checking whether the f77 linker (/usr/ccs/bin/ld) supports shared libraries... yes

Well, It seems the f77 echo the name of the file it is processing and the name of the subroutine in &2 !!
SO the line in configure --------------------->
      if test ! -s conftest.err; then

simply doesn't works because  conftest.err; is not an empty file !!!

In order to confirm I launch :

CC=cc F77=f77 FFLAGS="-silent" ./configure

The result is :

checking for f77 option to produce PIC... -KPIC
checking if f77 PIC flag -KPIC works... =======
    subroutine t
    return
    end
=======
configure:13812: f77 -c -silent -KPIC conftest.f >&5
ac_outfile = conftest.o
========               <------------ The contest.err is empty
========
yes                              <----------- OK
checking if f77 supports -c -o file.o... yes
checking whether the f77 linker (/usr/ccs/bin/ld) supports shared libraries... yes


Is there a correction for this ?

Thanks.
Eric Fayolle.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]