[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HEAD: support IBM xl* compilers on GNU/Linux/ppc
From: |
Ralf Wildenhues |
Subject: |
HEAD: support IBM xl* compilers on GNU/Linux/ppc |
Date: |
Sun, 19 Aug 2007 20:00:11 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Hello libtool patches,
The patch at the end adds partial support to Libtool CVS HEAD for the
IBM compiler suite on GNU/Linux/ppc. Partial here means that I
currently need a small hack to ltmain.m4sh (see other patch below) to
get tests to work properly. There is an issue somewhere wrt.
shlibpath_overrides_runpath treatment which I haven't fully understood
yet. Anyway I don't ask to apply the hack, just the proper part of the
patch.
Note there are two pieces of the main patch that touch code also used in
other setups: I needed to reorder the linux $tmp_sharedflag code
slightly, and I fixed a quoting error wrt. output_verbose_link_cmd.
As far as I can see, this fix allows to omit the no_glob_subst mangling
of output_verbose_link_cmd. I haven't actually tried other setups yet
though, merely some consistency tests. Please say so if you think it
needed before commit.
FWIW (so I remember later ;-), here's an output_verbose_link_cmd that
works for the compiler I used during some testing:
output_verbose_link_cmd='$CC -qmkshrobj $CFLAGS -v conftest.$objext 2>&1 |
$SED -n "/ld(/{
s/^[^(]*(//
s/)[^)]*$//
s/,/ /g
p
}"'
I don't think it's needed here, though.
OK to apply the main patch?
Cheers,
Ralf
--- libltdl/config/ltmain.m4sh 23 Jul 2007 17:46:28 -0000 1.89
+++ libltdl/config/ltmain.m4sh 19 Aug 2007 17:40:31 -0000
@@ -2427,7 +2427,8 @@
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n
"$shlibpath_var" && test -n "$temp_rpath"; then
+ #if test "$shlibpath_overrides_runpath" = yes && test -n
"$shlibpath_var" && test -n "$temp_rpath"; then
+ if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2007-08-19 Ralf Wildenhues <address@hidden>
* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
(_LT_LANG_CXX_CONFIG) [ linux ]: Add support for IBM XL 8.0
C/C++ (xlc*, xlC*) and IBM XL Fortran 10.1 (xlf*) on GNU/Linux,
tested on ppc.
(_LT_SYS_HIDDEN_LIBDEPS): Double-quote $output_verbose_link_cmd
properly during evaluation, obsoleting $no_glob_subst mangling.
* NEWS: Update.
Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.205
diff -u -r1.205 NEWS
--- NEWS 24 Jun 2007 20:46:45 -0000 1.205
+++ NEWS 19 Aug 2007 17:55:35 -0000
@@ -73,8 +73,8 @@
- Improved support for UnixWare.
- Initial support for RDOS.
- Initial Support for FC (modern Fortran).
- - Support for Portland Group compiler and the Sun compiler suite on
- GNU/Linux.
+ - Support for Portland Group compiler, the Sun compiler suite on
+ GNU/Linux, and the IBM compiler suite on GNU/Linux/ppc.
- Support for linux-dietlibc (`diet' as well as `diet-dyn', separately).
- Building libltdl with a C++ compiler has been undusted.
- On (AIX?,) HP-UX, and OpenBSD, hardcoding has been changed to prefer
Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.116
diff -u -r1.116 libtool.m4
--- libltdl/m4/libtool.m4 18 Aug 2007 09:18:44 -0000 1.116
+++ libltdl/m4/libtool.m4 19 Aug 2007 17:40:34 -0000
@@ -3578,6 +3578,12 @@
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
@@ -3845,6 +3851,12 @@
# All Alpha code is PIC.
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
@@ -4196,6 +4208,7 @@
&& test "$tmp_diet" = no
then
tmp_addflag=
+ tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
_LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for
conv in $convenience\"\"; do test -n \"$conv\" &&
new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"`
${wl}--no-whole-archive'
@@ -4210,6 +4223,9 @@
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf
below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
@@ -4218,8 +4234,6 @@
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
esac
_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"'
$libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
@@ -4229,6 +4243,22 @@
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs
$compiler_flags ${wl}-soname $wl$soname ${wl}-version-script
${wl}$output_objdir/$libname.ver -o $lib'
fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience
--no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs
$compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" >
$output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >>
$output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname
-version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -5869,6 +5899,18 @@
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v
conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e
"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 "X$list" | $Xsed'
;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs
$compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" >
$output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >>
$output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname
$wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
@@ -6317,12 +6359,7 @@
# the conftest object file.
pre_test_object_deps_done=no
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$ECHO "X$output_verbose_link_cmd" | $Xsed -e
"$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
+ for p in `eval "$output_verbose_link_cmd"`; do
case $p in
-L* | -R* | -l*)
- HEAD: support IBM xl* compilers on GNU/Linux/ppc,
Ralf Wildenhues <=