diff options
author | tnn <tnn@pkgsrc.org> | 2007-04-21 01:29:25 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2007-04-21 01:29:25 +0000 |
commit | cf0d723c6f492dbb848af4d4c7041cc4c401131d (patch) | |
tree | 3583a068a686884795a8c36664d3e9d774a05167 /mk/wrapper | |
parent | 6c1669a9456f19424813ffdd4f31da8ba644934a (diff) | |
download | pkgsrc-cf0d723c6f492dbb848af4d4c7041cc4c401131d.tar.gz |
add workaround for ld(1) run path problems and document those
Diffstat (limited to 'mk/wrapper')
-rw-r--r-- | mk/wrapper/cmd-sink-hpux-cc | 16 | ||||
-rw-r--r-- | mk/wrapper/cmd-sink-hpux-ld | 18 |
2 files changed, 33 insertions, 1 deletions
diff --git a/mk/wrapper/cmd-sink-hpux-cc b/mk/wrapper/cmd-sink-hpux-cc index 913d4be683f..5f5bcf1cc74 100644 --- a/mk/wrapper/cmd-sink-hpux-cc +++ b/mk/wrapper/cmd-sink-hpux-cc @@ -2,6 +2,7 @@ # Empty out the command buffer and build up the command line in $cmd. hprunpath= +hprunpathdirs= while ! queue_is_empty cmdbuf; do pop_queue cmdbuf arg $debug_log $wrapperlog " (cmd-sink-hpux-cc) pop: $arg" @@ -13,6 +14,7 @@ while ! queue_is_empty cmdbuf; do +b|-Wl,+b|-rpath) pop_queue cmdbuf dir dir="${dir#-Wl,}" + hprunpathdirs="$hprunpathdirs $dir" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; @@ -29,6 +31,7 @@ while ! queue_is_empty cmdbuf; do -Wl,--rpath,*) R="-Wl,--rpath," ;; esac dir="${arg#$R}" + hprunpathdirs="$hprunpathdirs $dir" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; @@ -45,4 +48,17 @@ if $test -n "$hprunpath"; then arg="-Wl,+b,$hprunpath" $debug_log $wrapperlog " (cmd-sink-hpux-cc) pop: $arg [aggregate]" . $buildcmd +############################################################################## +# Turn paths from the run path into additional -L arguments. This works around +# the braindead HP-UX ld(1) which needs to relink binaries against libraries +# in ${PREFIX} to get run paths correct. +# NB: This is not optimal because it exposes the package to possibly unwanted +# libraries. (Ideally this should be done only in the installation phase.) +############################################################################## + for dir in $hprunpathdirs + do + arg="-L$dir" + $debug_log $wrapperlog " (cmd-sink-hpux-cc) pop: $arg [from run path]" + . $buildcmd + done fi diff --git a/mk/wrapper/cmd-sink-hpux-ld b/mk/wrapper/cmd-sink-hpux-ld index ad40d43a242..3554a670c1f 100644 --- a/mk/wrapper/cmd-sink-hpux-ld +++ b/mk/wrapper/cmd-sink-hpux-ld @@ -1,7 +1,8 @@ -# $NetBSD: cmd-sink-hpux-ld,v 1.1 2007/04/14 14:17:50 tnn Exp $ +# $NetBSD: cmd-sink-hpux-ld,v 1.2 2007/04/21 01:29:25 tnn Exp $ # Empty out the command buffer and build up the command line in $cmd. hprunpath= +hprunpathdirs= while ! queue_is_empty cmdbuf; do pop_queue cmdbuf arg $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg" @@ -13,6 +14,7 @@ while ! queue_is_empty cmdbuf; do +b|-Wl,+b|-rpath) pop_queue cmdbuf dir dir="${dir#-Wl,}" + hprunpathdirs="$hprunpathdirs $dir" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; @@ -29,6 +31,7 @@ while ! queue_is_empty cmdbuf; do -Wl,--rpath,*) R="-Wl,--rpath," ;; esac dir="${arg#$R}" + hprunpathdirs="$hprunpathdirs $dir" case $hprunpath in "") hprunpath="$dir" ;; *) hprunpath="$hprunpath:$dir" ;; @@ -48,4 +51,17 @@ if $test -n "$hprunpath"; then arg=$hprunpath $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg [aggregate]" . $buildcmd +############################################################################## +# Turn paths from the run path into additional -L arguments. This works around +# the braindead HP-UX ld(1) which needs to relink binaries against libraries +# in ${PREFIX} to get run paths correct. +# NB: This is not optimal because it exposes the package to possibly unwanted +# libraries. (Ideally this should be done only in the installation phase.) +############################################################################## + for dir in $hprunpathdirs + do + arg="-L$dir" + $debug_log $wrapperlog " (cmd-sink-hpux-ld) pop: $arg [from run path]" + . $buildcmd + done fi |