Add missing $(rpath-link) to /elf/ld.so --library-path

This is notably needed for GNU/Hurd's libmachuser.so and libhurduser.so.
This commit is contained in:
Samuel Thibault 2025-11-08 17:44:05 +01:00
parent ea8e2b96d8
commit 4b5eeec17b
7 changed files with 17 additions and 8 deletions

View File

@ -141,7 +141,7 @@ $(objpfx)test-iconvconfig.out: $(objpfx)iconvconfig
$(objpfx)tst-iconv_prog.out: tst-iconv_prog.sh $(objpfx)iconv_prog
$(BASH) $< $(common-objdir) '$(test-wrapper-env)' \
'$(run-program-env)' > $@; \
'$(run-program-env)' '$(rpath-link)' > $@; \
$(evaluate-test)
$(objpfx)tst-translit-mchar.out: tst-translit-mchar.sh \
@ -168,5 +168,5 @@ $(objpfx)tst-iconv_prog-buffer-large.out: \
$(objpfx)tst-iconvconfig.out: tst-iconvconfig.sh $(objpfx)iconvconfig
$(BASH) $< $(common-objdir) '$(test-wrapper-env)' \
'$(run-program-env)' > $@; \
'$(run-program-env)' '$(rpath-link)' > $@; \
$(evaluate-test)

View File

@ -21,13 +21,15 @@
codir=$1
test_wrapper_env="$2"
run_program_env="$3"
# Remove the last space to allow concatenate extra paths.
library_path="$(echo $4)"
# We have to have some directories in the library path.
LIBPATH=$codir:$codir/iconvdata
# How the start the iconv(1) program. $from is not defined/expanded yet.
ICONV='
$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so
$codir/elf/ld.so --library-path $library_path:$LIBPATH --inhibit-rpath ${from}.so
$codir/iconv/iconv_prog
'
ICONV="$test_wrapper_env $run_program_env $ICONV"

View File

@ -22,12 +22,14 @@ set -e
build_dir=$1
test_wrapper_env="$2"
run_program_env="$3"
# Remove the last space to allow concatenate extra paths.
library_path="$(echo $4)"
# We have to have some directories in the library path.
LIBPATH=$build_dir:$build_dir/iconvdata
ICONVCONFIG="
$build_dir/elf/ld.so --library-path $LIBPATH $build_dir/iconv/iconvconfig
$build_dir/elf/ld.so --library-path $library_path:$LIBPATH $build_dir/iconv/iconvconfig
"
ICONVCONFIG="$test_wrapper_env $run_program_env $ICONVCONFIG"

View File

@ -340,7 +340,7 @@ $(objpfx)iconv-test.out: run-iconv-test.sh \
$(common-objdir)/iconv/iconv_prog TESTS
iconv_modules="$(modules)" \
$(SHELL) $< $(common-objdir) '$(test-wrapper-env)' \
'$(run-program-env)' > $@; \
'$(run-program-env)' '$(rpath-link)' > $@; \
$(evaluate-test)
$(objpfx)tst-tables.out: tst-tables.sh \

View File

@ -22,6 +22,8 @@ set -e
codir=$1
test_wrapper_env="$2"
run_program_env="$3"
# Remove the last space to allow concatenate extra paths.
library_path="$(echo $4)"
# We use always the same temporary file.
temp1=$codir/iconvdata/iconv-test.xxx
@ -33,7 +35,7 @@ trap "rm -f $temp1 $temp2" 1 2 3 15
LIBPATH=$codir:$codir/iconvdata
# How the start the iconv(1) program.
ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
ICONV='$codir/elf/ld.so --library-path $library_path:$LIBPATH --inhibit-rpath ${from}.so \
$codir/iconv/iconv_prog'
ICONV="$test_wrapper_env $run_program_env $ICONV"

View File

@ -180,7 +180,8 @@ lib := locale-programs
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
$(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run-program-env)' > $@; \
$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \
'$(run-program-env)' '$(rpath-link)' > $@; \
$(evaluate-test)
$(objpfx)tst-localedef-path-norm: $(shared-thread-library)

View File

@ -22,6 +22,8 @@ set -ex
common_objpfx=$1
test_wrapper_env=$2
run_program_env=$3
# Remove the last space to allow concatenate extra paths.
library_path="$(echo $4)"
LIBPATH="$common_objpfx"
@ -36,7 +38,7 @@ mkdir -p $testroot
${test_wrapper_env} \
${run_program_env} LANG= LC_ALL=invalid-locale LOCPATH=does-not-exist \
${common_objpfx}elf/ld.so --library-path "$LIBPATH" \
${common_objpfx}elf/ld.so --library-path "$library_path:$LIBPATH" \
"${common_objpfx}locale/locale" \
> "$testroot/stdout" 2> "$testroot/stderr"