Skip to content
Snippets Groups Projects
Commit c94cc48f authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Copy more libtool patches from YAXT.

parent ab6a5508
No related branches found
No related tags found
1 merge request!11Consolidation with CDI-PIO (1.8.x)
Showing with 113 additions and 259 deletions
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
autoreconf -fvi || exit $? autoreconf -fvi || exit $?
# Patch libtool.m4:
for patch in \
; do
echo "applying $patch"
patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
# The program 'patch' exits with exitcode=1 if the patch has already been applied.
# Consider this a normal scenario:
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
done
# The following is not needed as long as we do not patch libtool.m4: # The following is not needed as long as we do not patch libtool.m4:
# # Patch libtool.m4:
# for patch in \
# ; do
# echo "applying $patch"
# patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
# # The program 'patch' exits with exitcode=1 if the patch has already been applied.
# # Consider this a normal scenario:
# exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
# done
# autoconf -f || exit $? # autoconf -f || exit $?
# # Reset libtool.m4 timestamps to avoid confusing make: # # Reset libtool.m4 timestamps to avoid confusing make:
# touch -r m4/ltversion.m4 m4/libtool.m4 || exit $? # touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
...@@ -20,8 +20,12 @@ done ...@@ -20,8 +20,12 @@ done
# Patch the rest of the files: # Patch the rest of the files:
for patch in \ for patch in \
contrib/00nagfor-libtool-patch/nagfor-libtool-2.4.6.patch \ contrib/00nagfor-libtool-patch/nagfor-libtool-2.4.6.patch \
contrib/01aix-deplib-rpath-patch/aix-deplib-libtool.patch \
contrib/03ltmain-ld-groups-patch/ltmain-ld-groups-libtool-2.4.6.patch \
contrib/04ltmain-xlinker-patch/ltmain-xlinker-patch.patch \
contrib/05macos-nagfor-patch/macos-nagfor.patch \ contrib/05macos-nagfor-patch/macos-nagfor.patch \
contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread.patch \ contrib/06ltmain_nag_pthread-patch/ltmain_nag_pthread.patch \
contrib/07ltmain-early-xcompile-patch/ltmain-early-xcompile-libtool-2.4.6.patch \
contrib/08ltmain-parallel-printf-patch/ltmain-parallel-printf.patch \ contrib/08ltmain-parallel-printf-patch/ltmain-parallel-printf.patch \
; do ; do
echo "applying $patch" echo "applying $patch"
......
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_stripname "$wl" '' "$arg"
+ func_append new_inherited_linker_flags " -Wl,$func_stripname_result"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ func_quote_for_eval "$1"
+ func_append libtool_args " $func_quote_for_eval_result"
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -9515,6 +9562,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
@@ -10247,6 +10298,10 @@
*) func_append new_libs " $deplib" ;;
esac
;;
+ -Wl,*)
+ func_stripname -Wl, '' "$deplib"
+ func_append new_libs " $wl$func_stripname_result"
+ ;;
*) func_append new_libs " $deplib" ;;
esac
done
--- a/config/ltmain.sh 2012-06-12 00:20:43.000000000 +0200
+++ b/config/ltmain.sh 2014-08-19 16:34:48.161235251 +0200
@@ -3229,6 +3229,25 @@
test "$opt_mode" = install && func_mode_install ${1+"$@"}
+func_add2xrpath ()
+{
+ dir="$1"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+}
# func_generate_dlsyms outputname originator pic_p
# Extract symbols from dlprefiles and create ${outputname}S.o with
@@ -5727,20 +5746,7 @@
func_stripname '-R' '' "$arg"
dir=$func_stripname_result
# We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
+ func_add2xrpath "$dir"
continue
;;
@@ -5801,18 +5807,58 @@
;;
-Wl,*)
+ wlprefix=`expr x"$wl" : '.*' - 1`
+ wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
+ if test x"$wlprefix" = x"$wl" -a x"$wl" != x"-Wl,"; then
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ if expr "x$arg" : '^x'"$wl"'-rpath,,' >/dev/null ; then
+ func_stripname "$wl"'-rpath,,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ elif expr "x$arg" : '^x'"$wl"'-rpath$' >/dev/null ; then
+ func_stripname "$wl" '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x'"$wl" >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error "$wl"'-rpath must be followed by '"$wl"'-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ else
+ func_append new_inherited_linker_flags " $arg"
+ fi
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath,' >/dev/null ; then
+ func_stripname '-Wl,-rpath,' '' "$arg"
+ dir=$func_stripname_result
+ func_add2xrpath "$dir"
+ continue
+ elif expr "x$arg" : '^x-Wl,-rpath$' >/dev/null ; then
+ func_stripname '-Wl,' '' "$1"
+ dir=$func_stripname_result
+ if ! expr "x$1" : '^x-Wl,' >/dev/null \
+ || ! test -d "$dir" ; then
+ func_fatal_error '-Wl,-rpath must be followed by -Wl-escaped directory'
+ fi
+ shift
+ func_add2xrpath "$dir"
+ continue
+ fi
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
This patch changes ltmain.sh to add directories found in -R options of
dependent libraries to the final link command, such that non-libtool
dynamic libraries (which are a shared object inside the .a file on AIX) are
handled appropriately.
patching file /tmp/tmp.fUvdRDtWV1
--- /tmp/tmp.fUvdRDtWV1 2012-11-16 13:56:40.799501409 +0100
+++ b/config/ltmain.sh 2012-11-16 13:27:39.657253614 +0100
@@ -7171,7 +7171,10 @@
# practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
+ -R*)
+ func_stripname '-R' '' "$deplib"
+ func_add2xrpath "$func_stripname_result"
+ ;;
*)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
This patch changes ltmain.sh to keep the GNU ld library grouping options
-- -(, --start-group, -), and --end-group -- in the list of dependency
libraries so that the desired behaviour is retained (i.e. libraries with
cyclic dependencies can be linked).
--- a/config/ltmain.sh 2016-10-27 18:24:46.464521224 +0200
+++ b/config/ltmain.sh 2016-10-27 18:25:41.837607694 +0200
@@ -7226,6 +7226,11 @@
arg=$func_stripname_result
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ func_append deplibs " $arg"
+ continue
+ ;;
+
-Wl,*)
wlprefix=`expr x"$wl" : '.*' - 1`
wlprefix=`expr x"$arg" : 'x\(.\{'"$wlprefix"'\}\)'`
@@ -7879,6 +7884,15 @@
alldeplibs=:
continue
;;
+ -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\))
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
esac # case $deplib
$found || test -f "$lib" \
This patch allows having -Xlinker and -XCClinker command line options in
libtool --mode=compile invocations.
This is crucial because linker flags are different for nagfor and gcc.
--- a/config/ltmain.sh 2019-06-13 14:57:30.333358936 +0200
+++ b/config/ltmain.sh.new 2019-06-13 14:56:02.639520965 +0200
@@ -3310,6 +3310,12 @@
continue
;;
+ skip )
+ lastarg=
+ arg_mode=normal
+ continue
+ ;;
+
normal )
# Accept any command-line options.
case $arg in
@@ -3335,6 +3341,11 @@
continue
;;
+ -Xlinker | -XCClinker)
+ arg_mode=skip # the next one is ignored for compile mode
+ continue
+ ;;
+
-Xcompiler)
arg_mode=arg # the next one goes into the "base_compile" arg list
continue # The current "srcfile" will either be retained or
This patch fixes a bug in libtool that leads to a fault when
-Xcompiler is used as first option of compiler flag variables like
CFLAGS and FCLAGS.
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -3300,7 +3300,8 @@ func_mode_compile ()
case $arg_mode in
arg )
# do not "continue". Instead, add this to base_compile
- lastarg=$arg
+ lastarg=$srcfile
+ srcfile=$arg
arg_mode=normal
;;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment