Re: SunStudio compilers
Hello Dmitri, Please keep the mailing list in Cc: so this information is conserved, thanks. * Dmitri Chubarov wrote on Mon, May 14, 2007 at 03:27:57PM CEST: > > That's right. The most recent version of libtool handles > AC_LIBTOOL_PROG_COMPILER_PIC with Sun 5.9 C/C++ compilers correctly. > > Although, there was one failed test: > 29: C++ subdir-objects FAILED (am-subdir.at:160) > > I attach the testsuite.log Thanks. I quote below the interesting part of the log. The line containing RUNPATH gives a clue. Please post (from the build tree) the output of ./libtool --tag=CXX --config cat tests/testsuite.dir/29/subdir/subdemo Are you using Gentoo? Alternatively, which ld is used by sunCC, and why does it have different hardcoding characteristics as suncc? The former seems to set only DT_RPATH, while the latter also sets DT_RUNPATH. (I think `sunCC -v' should cause verbose output; otherwise, try `-#'). Let's see cd tests/testsuite.dir/29 /bin/sh ./libtool --tag=CXX --mode=link sunCC -v -g -o subdir/subdemo subdir/main.o subdir/libsub.la -ldl Libtool currently assumes that the different compilers (C, C++, Fortran) it was configured for have the same behavior wrt. the setting of shlibpath_overrides_runpath. It seems that is not the case for you. I wonder whether we need to make this a per-tag variable. :-/ Thanks, Ralf [...] > am-subdir.at:158: CONFIG_SHELL=$SHELL $SHELL ./configure $configure_options > stderr: > stdout: > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for gcc... suncc > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... no > checking whether suncc accepts -g... yes > checking for suncc option to accept ANSI C... none needed > checking for style of include used by make... GNU > checking dependency style of suncc... none > checking whether suncc and cc understand -c and -o together... yes > checking whether we are using the GNU C++ compiler... no > checking whether sunCC accepts -g... yes > checking dependency style of sunCC... none > checking how to run the C++ preprocessor... sunCC -E > checking build system type... x86_64-suse-linux > checking host system type... x86_64-suse-linux > checking for a sed that does not truncate output... /usr/bin/sed > checking for egrep... grep -E > checking for fgrep... grep -F > checking for non-GNU ld... /usr/bin/ld -m elf_x86_64 > checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > checking the name lister (/usr/bin/nm -B) interface... BSD nm > checking whether ln -s works... yes > checking the maximum length of command line arguments... 32768 > checking whether the shell understands some XSI constructs... yes > checking whether the shell understands "+="... yes > checking for /usr/bin/ld -m elf_x86_64 option to reload object files... -r > checking how to recognize dependent libraries... pass_all > checking for ar... ar > checking for strip... strip > checking for ranlib... ranlib > checking command to parse /usr/bin/nm -B output from suncc object... ok > checking how to run the C preprocessor... suncc -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking for dlfcn.h... yes > checking whether we are using the GNU C++ compiler... (cached) no > checking whether sunCC accepts -g... (cached) yes > checking dependency style of sunCC... (cached) none > checking how to run the C++ preprocessor... sunCC -E > checking for objdir... .libs > checking for suncc option to produce PIC... -KPIC -DPIC > checking if suncc PIC flag -KPIC -DPIC works... yes > checking if suncc static flag -Bstatic works... no > checking if suncc supports -c -o file.o... yes > checking if suncc supports -c -o file.o... (cached) yes > checking whether the suncc linker (/usr/bin/ld -m elf_x86_64 -m elf_x86_64) > supports shared libraries... yes > checking dynamic linker characteristics... RUNPATH /foo > GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking whether the sunCC linker (/usr/bin/ld -m elf_x86_64 -m elf_x86_64) > supports shared
Re: SunStudio compilers
Hello Dmitri, Thanks for the report. * Dmitri Chubarov wrote on Sat, May 12, 2007 at 12:06:23PM CEST: > When defining AC_LIBTOOL_PROG_COMPILER_PIC, the values libtool assigns > for SunStudio 11 and 12 compilers on Linux are not correct. The values > should be > lt_prog_compiler_wl='-Wl,' > lt_prog_compiler_pic='-Kpic' > lt_prog_compiler_static='-Bstatic' > > I attach a patch that should fix this problem. Applies to libtool 1.5.22. This doesn't match my experience with Sun C/C++ 5.9 (I think it was that version). Libtool CVS HEAD has support for this on GNU/Linux, it uses -KPIC as PIC flag, and `-Qoption ld ' for C++, `-Wl,' for C, and an empty wl flag for Fortran; also it avoids matching for the compiler name, as IIRC the suite uses multiple aliases. It would be helpful if you could download and build a nightly snapshot of CVS HEAD (see URL on the Libtool homepage) with your Sun compiler suite, and send verbose testsuite output for both the old and the new testsuite, as explained in README, for failures you encounter. Thanks, Ralf ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
SunStudio compilers
When defining AC_LIBTOOL_PROG_COMPILER_PIC, the values libtool assigns for SunStudio 11 and 12 compilers on Linux are not correct. The values should be lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-Bstatic' I attach a patch that should fix this problem. Applies to libtool 1.5.22. Best regards, Dmitri Chubarov -- Siberian Branch of the Russian Academy of Sciences Institute of Computational Technologies 630090 Novosibirsk, Russia *** libtool.m4.orig 2007-05-12 15:18:02.0 +0700 --- libtool.m4 2007-05-12 16:42:10.0 +0700 *** *** 4833,4838 --- 4833,4844 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; + sunCC*) +# SunStudio C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; *) ;; esac *** *** 5077,5082 --- 5083,5094 # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; + suncc* | sunf77* | sunf90*) + # SunStudio compilers + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; esac ;; ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool