libtool-patches
[Top][All Lists]
Advanced

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

better support for AIX 5.1


From: jedwards
Subject: better support for AIX 5.1
Date: Wed, 04 Jun 2003 15:09:20 -0600
User-agent: Mozilla/5.0 (X11; U; AIX 0006844C4C00; en-US; rv:1.4a) Gecko/20000125

Attached is a patch to the current cvs of libtool which I believe provides improved support for the AIX 5.1 OS and for AIX style shared libraries using native compilers. The patch contains changes for files libtool.m4 and ltmain.in.

It builds both AIX style and SYSV style libraries by default.
It does not require a special case for run time link support thus the size of libtool.m4 is reduced by about 82 lines.

It provides support for the 64-bit ABI on AIX5

You should be able to test all the changes except the 64-bit support on an AIX4.3.3 system. I've spent some time writing and testing this patch - I do hope that you will give it more than passing consideration. I would be glad to address any concerns that you have, especially with respect to the libtool tests which still fail and how they might be addressed.

FAIL: hardcode.test

PASS: tagdemo-shared.test
FAIL: tagdemo-make.test
SKIP: tagdemo-exec.test
====================================
2 of 104 tests failed
(1 tests were not run)
Please report to address@hidden
====================================




--
Jim Edwards             address@hidden
IBM Applications Analyst
NCAR SCD
BOULDER CO  303-497-1842
Index: libtool.m4
===================================================================
RCS file: /home/jedwards/.cvsroot/libtool/libtool.m4,v
retrieving revision 1.1
retrieving revision 1.4
diff -r1.1 -r1.4
1155,1165c1155,1156
<     if test "$aix_use_runtimelinking" = yes; then
<       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
<       # instead of lib<name>.a to let people know that these are not
<       # typical AIX shared libraries.
<       library_names_spec='${libname}${release}${shared_ext}$versuffix 
${libname}${release}${shared_ext}$major $libname${shared_ext}'
<     else
<       # We preserve .a as extension for shared libraries through AIX4.2
<       # and later when we are not doing run time linking.
<       library_names_spec='${libname}${release}.a $libname.a'
<       soname_spec='${libname}${release}${shared_ext}$major'
<     fi
---
>     library_names_spec='${libname}${release}${shared_ext}$versuffix 
> ${libname}${release}${shared_ext}$major $libname${shared_ext}'
>     postinstall_cmds="if test \$build_old_libs = yes ; then \$install_prog 
> \$dir/\$old_library \$destdir/\$old_library ; fi"
2548,2552d2538
< aix4*)
<   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
<     test "$enable_shared" = yes && enable_static=no
<   fi
<   ;;
2745,2760d2730
<       aix_use_runtimelinking=no
< 
<       # Test if we are trying to use run time linking or normal
<       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
<       # need to do runtime linking.
<       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
<       for ld_flag in $LDFLAGS; do
<         case $ld_flag in
<         *-brtl*)
<           aix_use_runtimelinking=yes
<           break
<           ;;
<         esac
<       done
<       esac
< 
2805,2809c2775,2778
<       if test "$aix_use_runtimelinking" = yes; then
<         shared_flag='${wl}-G'
<       else
<         shared_flag='${wl}-bM:SRE'
<       fi
---
>         # 
>         # The -qmkshrobj flag correctly exports mangeled c++ names
>         #
>         shared_flag='${wl}-G -qmkshrobj'
2815,2830d2783
<     _LT_AC_TAGVAR(always_export_symbols, $1)=yes
<     if test "$aix_use_runtimelinking" = yes; then
<       # Warning - without using the other runtime loading flags (-brtl),
<       # -berok will link without error, but may produce a broken library.
<       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
<       # Determine the default libpath from the value encoded in an empty 
executable.
<       _LT_AC_SYS_LIBPATH_AIX
<       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, 
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
< 
<       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags `if test 
"x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; 
else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols 
$shared_flag"
<      else
<       if test "$host_cpu" = ia64; then
<       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R 
$libdir:/usr/lib:/lib'
<       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
<       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags 
${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag 
\${wl}$exp_sym_flag:\$export_symbols"
<       else
2834c2787
<       # Warning - without using the other run time loading flags,
---
>       # Warning - without using the other run time loading flags, (-brtl) 
2836,2839c2789,2792
<       _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
<       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
<       # -bexpall does not export symbols beginning with underscore (_)
<       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
---
>       _LT_AC_TAGVAR(no_undefined_flag, $1)='-bernotok'
>       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
> 
> 
2842a2796,2797
>         # AIX wont look for the .so library without the -brtl flag
>         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=' ${wl}-brtl'
2844,2846c2799
<       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags 
${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS 
$output_objdir/$libname$release.a $output_objdir/$soname'
<       fi
<     fi
---
>       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
> $output_objdir/$soname $libobjs $deplibs $compiler_flags 
> ${wl}-bE:$export_symbols ${wl}-bnoentry ${wl}${allow_undefined_flag}'
3681,3683d3633
< aix4*)
<   test "$enable_shared" = yes && enable_static=no
<   ;;
5196,5209d5145
<       aix_use_runtimelinking=no
< 
<       # Test if we are trying to use run time linking or normal
<       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
<       # need to do runtime linking.
<       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
<         for ld_flag in $LDFLAGS; do
<         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
<           aix_use_runtimelinking=yes
<           break
<         fi
<         done
<       esac
< 
5254,5258c5190
<       if test "$aix_use_runtimelinking" = yes; then
<           shared_flag='${wl}-G'
<         else
<           shared_flag='${wl}-bM:SRE'
<       fi
---
>         shared_flag='${wl}-G '
5262,5278d5193
<       # It seems that -bexpall does not export symbols beginning with
<       # underscore (_), so it is better to generate a list of symbols to 
export.
<       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
<       if test "$aix_use_runtimelinking" = yes; then
<       # Warning - without using the other runtime loading flags (-brtl),
<       # -berok will link without error, but may produce a broken library.
<       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
<        # Determine the default libpath from the value encoded in an empty 
executable.
<        _LT_AC_SYS_LIBPATH_AIX
<        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, 
$1)='${wl}-blibpath:$libdir:'"$aix_libpath"
<       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags `if test 
"x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; 
else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols 
$shared_flag"
<        else
<       if test "$host_cpu" = ia64; then
<         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R 
$libdir:/usr/lib:/lib'
<         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
<         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags 
${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag 
\${wl}$exp_sym_flag:\$export_symbols"
<       else
5284,5285c5199,5200
<         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
<         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
---
> #       _LT_AC_TAGVAR(no_undefined_flag, $1)='-bernotok'
> #       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5290a5206,5207
>           # AIX wont look for the .so library without the -brtl flag
>           _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=' ${wl}-brtl'
5292,5294c5209
<         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
$output_objdir/$soname $libobjs $deplibs $compiler_flags 
${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS 
$output_objdir/$libname$release.a $output_objdir/$soname'
<       fi
<       fi
---
>         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o 
> $output_objdir/$soname $libobjs $deplibs $compiler_flags 
> ${wl}-bE:$export_symbols ${wl}-bnoentry '
Index: ltmain.in
===================================================================
RCS file: /home/jedwards/.cvsroot/libtool/ltmain.in,v
retrieving revision 1.1
diff -r1.1 ltmain.in
1472,1473c1472,1486
<       ;;
< 
---
>         # Support for 32-bit and 64-bit ABI in AIX 5
>         # if the user specifies a particular ABI with a compiler flag
>         # use the AIX defined environment variable OBJECT_MODE to export that
>         # setting to NM and AR
>         case $host in
>           powerpc-*aix5*)
>           if test "$arg" = -q64 ; then
>               export OBJECT_MODE=64 ;
>             else
>             if test "$arg" = -q32 ; then
>                 export OBJECT_MODE=32 ;
>               fi
>             fi
>         esac
>         ;;
1662c1675,1683
< 
---
> #
> # On AIX if the old_libs are not built all links require the -brtl flag 
> #
>     case $host in
>       *aix4.3* | *aix5*)
>         if test "$build_old_libs" = no ; then
>           export_dynamic=yes
>         fi
>     esac


reply via email to

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