pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Improve AIX/XLC support based on discussions with J...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2476cd847047
branches:  trunk
changeset: 550056:2476cd847047
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Nov 14 14:04:12 2008 +0000

description:
Improve AIX/XLC support based on discussions with Jens Rehsack:
- Add cc_r/xlc_r wrapper using the same rules as xlc itself.
  It is used for example by Perl.
- Improve the RPATH emulation:
  - Always set -blibpath, use /usr/lib:/lib as default
  - If -blibpath is exlicitly given, add to the default
  - Additionally append any -Wl,-rpath given.

diffstat:

 mk/compiler/xlc.mk          |   9 ++++++++-
 mk/wrapper/bsd.wrapper.mk   |  10 +++++++++-
 mk/wrapper/cmd-sink-aix-cc  |  23 +++++++++++++++++++----
 mk/wrapper/cmd-sink-aix-ld  |  18 ++++++++++++++----
 mk/wrapper/cmd-sink-aix-xlc |  22 ++++++++++++++++++----
 5 files changed, 68 insertions(+), 14 deletions(-)

diffs (211 lines):

diff -r 522be5517938 -r 2476cd847047 mk/compiler/xlc.mk
--- a/mk/compiler/xlc.mk        Fri Nov 14 11:26:43 2008 +0000
+++ b/mk/compiler/xlc.mk        Fri Nov 14 14:04:12 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: xlc.mk,v 1.17 2008/02/07 20:59:05 rillig Exp $
+# $NetBSD: xlc.mk,v 1.18 2008/11/14 14:04:12 joerg Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -82,6 +82,13 @@
 CXXPATH=               ${XLCBASE}/bin/xlc++
 PKG_CXX:=              ${_XLC_CXX}
 .endif
+.if exists(${XLCBASE}/bin/xlc)
+_XLC_VARS+=            CC_R
+_XLC_CC_R=             ${_XLC_DIR}/bin/cc_r
+_ALIASES.CC_R=         cc_r xlc_r
+CC_RPATH=              ${XLCBASE}/bin/xlc_r
+PKG_CC_R:=             ${_XLC_CC_R}
+.endif
 _COMPILER_STRIP_VARS+= ${_XLC_VARS}
 _COMPILER_RPATH_FLAG=  -Wl,-R
 _LINKER_RPATH_FLAG=    -R
diff -r 522be5517938 -r 2476cd847047 mk/wrapper/bsd.wrapper.mk
--- a/mk/wrapper/bsd.wrapper.mk Fri Nov 14 11:26:43 2008 +0000
+++ b/mk/wrapper/bsd.wrapper.mk Fri Nov 14 14:04:12 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.78 2008/11/06 21:34:16 joerg Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.79 2008/11/14 14:04:12 joerg Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -139,6 +139,11 @@
 .endif
 WRAPPEES+=     LD
 
+.if !empty(PKGSRC_COMPILER:Mxlc) && ${OPSYS} == "AIX"
+CC_R?=         ${_XLC_DIR}/bin/cc_r
+WRAPPEES+=     CC_R
+.endif
+
 _WRAPPEE_UNIQUE_CMDS=  # empty
 .for _wrappee_ in ${WRAPPEES}
 _WRAPPEES+=            ${_wrappee_}
@@ -283,6 +288,7 @@
 .if !empty(PKGSRC_COMPILER:Mxlc)
 .  if ${OPSYS} == "AIX"
 _WRAP_CMD_SINK.CC=     ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc
+_WRAP_CMD_SINK.CC_R=   ${WRAPPER_TMPDIR}/cmd-sink-aix-xlc
 _WRAP_CMD_SINK.CXX=    ${_WRAP_CMD_SINK.CC}
 _WRAP_CMD_SINK.LD=     ${_WRAP_CMD_SINK.CC}
 .  elif ${OPSYS} == "Darwin"
@@ -346,7 +352,9 @@
 _WRAP_CMD_SINK.CXX?=   ${_WRAP_CMD_SINK.CC}
 _WRAP_CMD_SINK.LD?=    ${WRAPPER_TMPDIR}/cmd-sink-aix-ld
 _WRAP_CACHE_BODY.CC?=  ${WRAPPER_TMPDIR}/cache-body-aix-cc
+_WRAP_CACHE_BODY.CC_R?=        ${WRAPPER_TMPDIR}/cache-body-aix-cc
 _WRAP_TRANSFORM.CC?=   ${WRAPPER_TMPDIR}/transform-aix-cc
+_WRAP_TRANSFORM.CC_R?= ${WRAPPER_TMPDIR}/transform-aix-cc
 _WRAP_CACHE_BODY.CXX?= ${_WRAP_CACHE_BODY.CC}
 _WRAP_TRANSFORM.CXX?=  ${_WRAP_TRANSFORM.CC}
 .elif ${OPSYS} == "IRIX"
diff -r 522be5517938 -r 2476cd847047 mk/wrapper/cmd-sink-aix-cc
--- a/mk/wrapper/cmd-sink-aix-cc        Fri Nov 14 11:26:43 2008 +0000
+++ b/mk/wrapper/cmd-sink-aix-cc        Fri Nov 14 14:04:12 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-sink-aix-cc,v 1.2 2005/05/16 17:54:51 jlam Exp $
+# $NetBSD: cmd-sink-aix-cc,v 1.3 2008/11/14 14:04:12 joerg Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,12 +36,23 @@
 
 # Empty out the command buffer and build up the command line in $cmd.
 blibpath=
+orig_blibpath=
 dynamic=
 
 while ! queue_is_empty cmdbuf; do
        pop_queue cmdbuf arg
        $debug_log $wrapperlog "    (cmd-sink-aix-cc) pop:  $arg"
        case $arg in
+       -blibpath:*)
+               orig_blibpath=${arg#-blibpath:}
+               $debug_log $wrapperlog "    (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]"
+               dynamic=yes
+               ;;
+       -Wl,-blibpath:*)
+               orig_blibpath=${arg#-Wl,-blibpath:}
+               $debug_log $wrapperlog "    (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]"
+               dynamic=yes
+               ;;
        ##############################################################
        # AIX ld(1) doesn't support -Wl,-rpath,* but accumulate them
        # into a path collection we can later append to command line
@@ -70,11 +81,15 @@
 done
 
 # AIX ld(1) uses -blibpath to set the runtime library search path.
+arg="-Wl,-blibpath:/usr/usr/lib:/lib"
+if $test -n "$orig_blibpath"; then
+       arg="$arg:$orig_blibpath"
+fi
 if $test -n "$blibpath"; then
-       arg="-Wl,-blibpath:/lib:/usr/lib:$blibpath"
-       $debug_log $wrapperlog "    (cmd-sink-aix-cc) pop: $arg"
-       . $buildcmd
+        arg="$arg:$blibpath"
 fi
+$debug_log $wrapperlog "    (cmd-sink-aix-cc) pop: $arg"
+. $buildcmd
 
 # If we are dynamically linking, make sure the runtime linker is used.
 if $test -n "$dynamic"; then
diff -r 522be5517938 -r 2476cd847047 mk/wrapper/cmd-sink-aix-ld
--- a/mk/wrapper/cmd-sink-aix-ld        Fri Nov 14 11:26:43 2008 +0000
+++ b/mk/wrapper/cmd-sink-aix-ld        Fri Nov 14 14:04:12 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-sink-aix-ld,v 1.2 2005/05/16 17:54:51 jlam Exp $
+# $NetBSD: cmd-sink-aix-ld,v 1.3 2008/11/14 14:04:12 joerg Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,6 +35,7 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 # Empty out the command buffer and build up the command line in $cmd.
+orig_blibpath=
 blibpath=
 dynamic=
 
@@ -42,6 +43,11 @@
        pop_queue cmdbuf arg
        $debug_log $wrapperlog "    (cmd-sink-aix-ld) pop:  $arg"
        case $arg in
+       -blibpath:*)
+               orig_blibpath=${arg#-blibpath:}
+               $debug_log $wrapperlog "    (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]"
+               dynamic=yes
+               ;;
        ##############################################################
        # AIX ld(1) doesn't support -Wl,-rpath,* but accumulate them
        # into a path collection we can later append to command line
@@ -70,11 +76,15 @@
 done
 
 # AIX ld(1) uses -blibpath to set the runtime library search path.
+arg="-blibpath:/usr/usr/lib:/lib"
+if $test -n "$orig_blibpath"; then
+       arg="$arg:$orig_blibpath"
+fi
 if $test -n "$blibpath"; then
-        arg="-blibpath:/lib:/usr/lib:$blibpath"
-        $debug_log $wrapperlog "    (cmd-sink-aix-ld) pop: $arg"
-        . $buildcmd
+       arg="$arg:$blibpath"
 fi
+$debug_log $wrapperlog "    (cmd-sink-aix-ld) pop: $arg"
+. $buildcmd
 
 # If we are dynamically linking, make sure the runtime linker is used.
 if $test -n "$dynamic"; then
diff -r 522be5517938 -r 2476cd847047 mk/wrapper/cmd-sink-aix-xlc
--- a/mk/wrapper/cmd-sink-aix-xlc       Fri Nov 14 11:26:43 2008 +0000
+++ b/mk/wrapper/cmd-sink-aix-xlc       Fri Nov 14 14:04:12 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-sink-aix-xlc,v 1.4 2007/10/05 18:19:45 joerg Exp $
+# $NetBSD: cmd-sink-aix-xlc,v 1.5 2008/11/14 14:04:12 joerg Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,10 +36,19 @@
 
 # Empty out the command buffer and build up the command line in $cmd.
 blibpath=
+orig_blibpath=
 while ! queue_is_empty cmdbuf; do
        pop_queue cmdbuf arg
        $debug_log $wrapperlog "    (cmd-sink-aix-xlc) pop:  $arg"
        case $arg in
+       -blibpath:*)
+               orig_blibpath=${arg#-blibpath:}
+               $debug_log $wrapperlog "    (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]"
+               ;;
+       -Wl,-blibpath:*)
+               orig_blibpath=${arg#-Wl,-blibpath:}
+               $debug_log $wrapperlog "    (cmd-sink-aix-ld) drop: $dir [setting orig_blibpath]"
+               ;;
        ##############################################################
        # AIX xlC doesn't support -Wl,-rpath,* but accumulate them
        # into a path collection we can later append to command line
@@ -67,11 +76,16 @@
 done
 
 # AIX xlc uses -blibpath to set the runtime library search path.
+arg="-Wl,-blibpath:/usr/usr/lib:/lib"
+if $test -n "$orig_blibpath"; then
+       arg="$arg:$orig_blibpath"
+fi
 if $test -n "$blibpath"; then
-       arg="-blibpath:$blibpath"
-       $debug_log $wrapperlog "    (cmd-sink-aix-xlc) pop: $arg"
-       . $buildcmd
+        arg="$arg:$blibpath"
 fi
+$debug_log $wrapperlog "    (cmd-sink-aix-xlc) pop: $arg"
+. $buildcmd
+
 # Force dynamic linkage on AIX to get preference of dynamic libraries
 # over library archives.
 if $test "$dont_link" != "yes"; then



Home | Main Index | Thread Index | Old Index