Re: support for SunPRO C/C++ on Linux
Ralf Wildenhues wrote: Yes. HP-UX /bin/sh is known to dump core in case `command that produces more than 1 KB of output` in and I don't know how much output other compilers generate when given the -V option. But say, why is that HP-UX shell issue not listed in the Autoconf portability section? FWIW, I can't reproduce it on some HP-UX systems; the oldest I have access to is an HP-UX 10.20. Then it must be have been in HP-UX 9 (which was in use around 1992 to 1996). It'd be good to know about the impact of this -- do you have pointers to bug reports? (Also note that the shell selection algorithm of Autoconf-2.59c will select /usr/bin/posix/sh there.) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in +$convenience\\; do test -z \$conv\ || new_convenience=\$new_convenience,$conv\; done; $echo \$new_convenience\`+${wl}--no-whole-archive' Are you sure the compiler driver won't reorder arguments here? ... IIRC, on Solaris, this: | _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv | in $convenience\\; do test -n \$conv\ | new_convenience=\$new_convenience,$conv\; done; $echo | \$new_convenience\` ${wl}-z ${wl}defaultextract' caused some problems somewhere; cf. for example this thread: http://lists.gnu.org/archive/html/bug-libtool/2005-10/msg00040.html and note that with C++, your patch sets ${wl} to `-Qoption ld ' as well, not to `-Wl,'. Also, consider this: in a (maybe partially) static linking case, the objects from the convenience archive require some symbol from a library specified later. If the driver reorders, we may be out of luck here, as the needed library may happen to end up listed earlier. OTOH, the driver on Solaris knows '-z allextract' and understands what to do with the following arguments. So that had a chance of actually working across Solaris versions (the driver happens to also reorder differently across versions). Now, if the driver understands --whole-archive/--no-whole-archive on GNU/Linux, I think that should be used plainly, without ${wl}. If it doesn't, then, depending on how it reorders, we should file a bug report. Sun C on Linux appears to put linker options first, before the object files to be linked; therefore the needed libraries will come later - no problem. Bruno ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: support for SunPRO C/C++ on Linux
Ralf Wildenhues wrote: and note that with C++, your patch sets ${wl} to `-Qoption ld ' as well, not to `-Wl,'. Yes. Indeed I don't know whether -Qoption ld arg1,arg2,arg3will pass arg1, arg2, arg3 separately to the linker or glued together. I hope the tests in libtool HEAD will detect whether this makes problems. Bruno ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: support for SunPRO C/C++ on Linux
Hi Bruno, all, + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in +$convenience\\; do test -z \$conv\ || new_convenience=\$new_convenience,$conv\; done; $echo \$new_convenience\`+${wl}--no-whole-archive' Are you sure the compiler driver won't reorder arguments here? I tested this now, this issue seems ok for the time being. Let's hope they don't break it. The CVS HEAD test suite exposed some further issues: - whole_archive_flag_spec needs to be adjusted the way you suggested also for the C compiler. - We can trick the C compiler driver into accepting only whole archives (and no other objects) by adding a dummy /dev/null argument: it will be ignored by GNU binutils ld. :-) - The Fortran compilers need an empty $wl: they'll forward everything they don't understand to the linker. Let's not worry about their overly verbose warnings about them. - This means we need white space separators in whole_archive for Fortran. - For the compiler matching, we need more than the first line: the f77 driver will prepend all output; 5 lines should be sufficient. | NOTICE: Invoking /home/ralf/download/software/sunstudio/sunstudiomars/bin/f90 -f77 -ftrap=%none --version Furthermore, the GCJ convenience test fails, due to insufficient variable resetting done in the Java section of libtool.m4 ($wl in this case). I reported this issue a while ago, but never got around to fixing it yet. So this is where I'm at now. I think the postdeps for Fortran are still wrong, but we can fix that later. It should be noted that currently, newer versions of config.guess and config.sub are needed than the checked-in copies of branch-1-5; in any case they need to be newer than those shipped with Autoconf-2.59, so they will be updated first. On i686-pc-linux-gnu, HEAD passes all tests except the GCJ convenience one, branch-1-5 passes all its tests plus the non-FC HEAD convenience tests; you can test this with overriding $LIBTOOL for the HEAD testsuite (plus my pending patch): make check-local \ TESTSUITE_FLAGS='-v -d 11 LIBTOOL=/tmp/branch-1-5/build-suncc/libtool' Unless anyone has complaints about these patches, I'll probably apply within the couple of days. Cheers, Ralf HEAD: 2006-05-14 Bruno Haible [EMAIL PROTECTED], Ralf Wildenhues [EMAIL PROTECTED] * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS) (_LT_LANG_CXX_CONFIG, _LT_SYS_HIDDEN_LIBDEPS) [ linux ]: Add support for Sun C 5.9, Sun C++ 5.9, and Sun Fortran 8.3 on Linux. * NEWS: Update. branch-1-5: 2006-05-14 Bruno Haible [EMAIL PROTECTED], Ralf Wildenhues [EMAIL PROTECTED] * libtool.m4 [ linux ] (AC_LIBTOOL_LANG_CXX_CONFIG) (AC_LIBTOOL_POSTDEP_PREDEP, AC_LIBTOOL_PROG_COMPILER_PIC) (AC_LIBTOOL_PROG_LD_SHLIBS): Add support for Sun C 5.9, Sun C++ 5.9, and Sun Fortran 8.3 on Linux. * NEWS: Update. 2006-05-14 Bruno Haible [EMAIL PROTECTED], Ralf Wildenhues [EMAIL PROTECTED] * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS) (_LT_LANG_CXX_CONFIG, _LT_SYS_HIDDEN_LIBDEPS) [ linux ]: Add support for Sun C 5.9, Sun C++ 5.9, and Sun Fortran 8.3 on Linux. * NEWS: Update. Index: NEWS === RCS file: /cvsroot/libtool/libtool/NEWS,v retrieving revision 1.193 diff -u -r1.193 NEWS --- NEWS14 May 2006 08:20:11 - 1.193 +++ NEWS14 May 2006 12:41:54 - @@ -33,6 +33,7 @@ * Initial support for RDOS. * Fix error with -version-info on systems with version_type=none, such as BeOS. +* Initial support for the Sun compiler suite on GNU/Linux. * Bug fixes. New in 1.9f: 2004-10-23; CVS version 1.9e, Libtool team: Index: libltdl/m4/libtool.m4 === RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v retrieving revision 1.64 diff -u -r1.64 libtool.m4 --- libltdl/m4/libtool.m4 14 May 2006 08:43:58 - 1.64 +++ libltdl/m4/libtool.m4 14 May 2006 16:01:37 - @@ -3525,6 +3525,14 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) + case `$CC -V 21 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac ;; esac ;; @@ -3779,6 +3787,22 @@ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; + *) + case `$CC -V 21 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' +
Re: support for SunPRO C/C++ on Linux
Hi Bruno, * Bruno Haible wrote on Wed, May 10, 2006 at 02:01:31PM CEST: Here is a revised patch. I changed the recognition of the Sun compilers, and the whole_archive_flag_spec and postdeps, so that now all 112 tests PASS. Cool. With this patch, the FAILs are turned into PASS; all tests PASS or SKIP. Which ones skip? Good question. I had many SKIPs, but this was either because I had forgotten to copy a recent config.guess, or because I did ./configure make make check - not knowing that after modifying libtool.m4, a simple make does not update the aclocal.m4 and configure files in the subdirectories; Yes. This issue has been fixed in CVS HEAD. I won't backport it though. Some notes: *** 3353,3358 --- 3353,3379 # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 21 | grep ld`; templist=`echo $templist | $SED s/\(^.*ld.*\)\( .*ld .*$\)/\1/`; list=; for z in $templist; do case $z in conftest.$objext) list=$list $z;; *.$objext);; *) list=$list $z;;esac; done; echo $list' ;; + *) + if LC_ALL=C $CC -V 21 | sed 1q | grep Sun C /dev/null; then If that LC_ALL=C was really necessary, then that is a bug. Autoconf resets the locale, and many configure tests depend on this. Any reason not to simplify this to something like this? case `$CC -V 21 /dev/null` in *Sun\ C*) (several instances) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in +$convenience\\; do test -z \$conv\ || new_convenience=\$new_convenience,$conv\; done; $echo \$new_convenience\`+${wl}--no-whole-archive' Are you sure the compiler driver won't reorder arguments here? There has been a significant fix for this on Solaris post-1.5.22 (on 2006-02-03, after several tries in the past), and only the CVS HEAD Libtool testsuite exposes the known failures fully. Related question: are you volunteering for the forward-port of the patch? (If not, I can do it, but it'll take longer then.) Rest looks good, except there will be issues mixing C++ libraries compiled with different compilers (as expected). Do you happen to know whether Sun changed their minds and offered this compiler suite for free (as in beer) now? So that I could integrate it into testing.. Cheers, Ralf ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
support for SunPRO C/C++ on Linux
Hi, Here is a patch that adds support for Sun's C and C++ compilers 5.9, ported from Solaris to Linux. They exist for x86 and x86_64; I tested it only on x86. The compiler executable for C is called 'c89' and 'c99' (two slightly different programs); for C++ it is called 'CC'. Without this patch, several tests fail: PASS: cdemo-static.test PASS: cdemo-make.test PASS: cdemo-exec.test PASS: demo-static.test FAIL: demo-make.test FAIL: demo-exec.test FAIL: demo-inst.test PASS: demo-unst.test PASS: depdemo-static.test PASS: depdemo-make.test PASS: depdemo-exec.test PASS: depdemo-inst.test PASS: depdemo-unst.test PASS: mdemo-static.test FAIL: mdemo-make.test SKIP: mdemo-exec.test SKIP: mdemo-inst.test PASS: mdemo-unst.test SKIP: cdemo-conf.test SKIP: cdemo-make.test SKIP: cdemo-exec.test SKIP: demo-conf.test SKIP: demo-make.test SKIP: demo-exec.test SKIP: demo-inst.test SKIP: demo-unst.test SKIP: deplibs.test SKIP: depdemo-conf.test SKIP: depdemo-make.test SKIP: depdemo-exec.test SKIP: depdemo-inst.test SKIP: depdemo-unst.test SKIP: mdemo-conf.test SKIP: mdemo-make.test SKIP: mdemo-exec.test SKIP: mdemo-inst.test SKIP: mdemo-unst.test SKIP: dryrun.test PASS: demo-nofast.test FAIL: demo-make.test FAIL: demo-exec.test FAIL: demo-inst.test PASS: demo-unst.test PASS: demo-pic.test FAIL: demo-make.test FAIL: demo-exec.test PASS: demo-nopic.test FAIL: demo-make.test FAIL: demo-exec.test PASS: depdemo-nofast.test PASS: depdemo-make.test PASS: depdemo-exec.test PASS: depdemo-inst.test PASS: depdemo-unst.test SKIP: cdemo-shared.test SKIP: cdemo-make.test SKIP: cdemo-exec.test SKIP: demo-shared.test SKIP: demo-make.test SKIP: demo-exec.test SKIP: demo-inst.test SKIP: hardcode.test SKIP: build-relink.test SKIP: noinst-link.test SKIP: demo-unst.test SKIP: depdemo-shared.test SKIP: depdemo-make.test SKIP: depdemo-exec.test SKIP: depdemo-inst.test SKIP: build-relink2.test SKIP: depdemo-unst.test SKIP: mdemo-shared.test SKIP: mdemo-make.test SKIP: mdemo-exec.test SKIP: mdemo-inst.test SKIP: mdemo-unst.test PASS: assign.test PASS: link.test PASS: link-2.test PASS: nomode.test PASS: quote.test PASS: sh.test PASS: suffix.test SKIP: pdemo-conf.test SKIP: pdemo-make.test SKIP: pdemo-exec.test SKIP: pdemo-inst.test SKIP: mdemo-conf.test SKIP: mdemo-make.test SKIP: mdemo2-conf.test SKIP: mdemo2-make.test SKIP: mdemo2-exec.test PASS: duplicate_members.test PASS: link-order.test PASS: tagdemo-static.test PASS: tagdemo-make.test PASS: tagdemo-exec.test SKIP: tagdemo-conf.test SKIP: tagdemo-make.test SKIP: tagdemo-exec.test SKIP: tagdemo-shared.test SKIP: tagdemo-make.test SKIP: tagdemo-exec.test PASS: f77demo-static.test PASS: f77demo-make.test PASS: f77demo-exec.test SKIP: f77demo-conf.test SKIP: f77demo-make.test SKIP: f77demo-exec.test SKIP: f77demo-shared.test SKIP: f77demo-make.test SKIP: f77demo-exec.test With this patch, the FAILs are turned into PASS; all tests PASS or SKIP. Additionally, with the corresponding patch to config.rpath, the autoconf-lib-link testsuite passes as well. 2006-05-05 Bruno Haible [EMAIL PROTECTED] * libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG): Add support for Sun C++ 5.9 on Linux. (AC_LIBTOOL_PROG_COMPILER_PIC): Add support for Sun C 5.9 and Sun C++ 5.9. (AC_LIBTOOL_PROG_LD_SHLIBS): Add support for Sun C 5.9. *** libtool-1.5.22/libtool.m4.bak 2005-12-18 22:53:17.0 +0100 --- libtool-1.5.22/libtool.m4 2006-05-07 02:17:19.0 +0200 *** *** 3353,3358 --- 3353,3377 # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 21 | grep ld`; templist=`echo $templist | $SED s/\(^.*ld.*\)\( .*ld .*$\)/\1/`; list=; for z in $templist; do case $z in conftest.$objext) list=$list $z;; *.$objext);; *) list=$list $z;;esac; done; echo $list' ;; + CC*) + # Sun C++ 5,9 + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 21 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # CC -xar, where CC is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; esac
Re: support for SunPRO C/C++ on Linux
Hi Bruno, * Bruno Haible wrote on Mon, May 08, 2006 at 09:44:42PM CEST: Here is a patch that adds support for Sun's C and C++ compilers 5.9, ported from Solaris to Linux. They exist for x86 and x86_64; I tested it only on x86. Thanks! The compiler executable for C is called 'c89' and 'c99' (two slightly different programs); for C++ it is called 'CC'. How unfortunate. Several compilers on GNU/Linux install themselves with links or wrappers named c89 or c99. I don't think all of them understand -KPIC, and none of the others will understand '-Qoption ld'. We should probably do a --version|-V test as well to disambiguate. (To keep the size overhead down, we may want to map version strings to compiler base names somewhere earlier; ugh.) With this patch, the FAILs are turned into PASS; all tests PASS or SKIP. Which ones skip? Cheers, Ralf ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool
Re: support for SunPRO C/C++ on Linux
Hi Bruno, * Bruno Haible wrote on Mon, May 08, 2006 at 10:40:59PM CEST: The compiler executable for C is called 'c89' and 'c99' (two slightly different programs); for C++ it is called 'CC'. How unfortunate. Several compilers on GNU/Linux install themselves with links or wrappers named c89 or c99. I don't think all of them understand -KPIC, and none of the others will understand '-Qoption ld'. We should probably do a --version|-V test as well to disambiguate. Something like this, or test whether $CC -flags /dev/null gives no error... Yes, maybe. Does the same hold also for the name 'CC' of the C++ compiler? I think that is a lot safer. I'll resend a new patch. Thanks. Cheers, Ralf ___ Bug-libtool mailing list Bug-libtool@gnu.org http://lists.gnu.org/mailman/listinfo/bug-libtool