diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 11 | ||||
-rwxr-xr-x | tests/soname.sh | 21 |
2 files changed, 28 insertions, 4 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index fb98023..7922783 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,12 +21,12 @@ XFAIL_TESTS = no-rpath-ia64.sh src_TESTS = \ plain-fail.sh plain-run.sh shrink-rpath.sh set-interpreter-short.sh \ set-interpreter-long.sh set-rpath.sh no-rpath.sh big-dynstr.sh \ - set-rpath-library.sh + set-rpath-library.sh soname.sh build_TESTS = \ $(no_rpath_arch_TESTS) -TESTS= $(src_TESTS) $(build_TESTS) +TESTS = $(src_TESTS) $(build_TESTS) EXTRA_DIST = no-rpath-prebuild $(src_TESTS) no-rpath-prebuild.sh @@ -44,6 +44,7 @@ AM_CFLAGS = -fpic LDFLAGS_local = -Wl,--disable-new-dtags -Wl,-rpath-link=. -L. $(AM_LDFLAGS) LDFLAGS_sharedlib = -Wl,--disable-new-dtags -shared -L. $(AM_LDFLAGS) export NIX_DONT_SET_RPATH=1 +export NIX_LDFLAGS= simple_SOURCES = simple.c # no -fpic for simple.o @@ -72,7 +73,7 @@ big_dynstr_LDFLAGS = $(LDFLAGS_local) # - without libtool, only archives (static libraries) can be built by automake # - with libtool, it is difficult to control options # - with libtool, it is not possible to compile convenience *dynamic* libraries :-( -check_PROGRAMS += libfoo.so libfoo-scoped.so libbar.so libbar-scoped.so +check_PROGRAMS += libfoo.so libfoo-scoped.so libbar.so libbar-scoped.so libsimple.so libfoo_so_SOURCES = foo.c libfoo_so_LDADD = -lbar $(AM_LDADD) @@ -90,7 +91,9 @@ libbar_so_LDFLAGS = $(LDFLAGS_sharedlib) -Wl,-rpath,`pwd`/no-such-path libbar_scoped_so_SOURCES = bar.c libbar_scoped_so_LDFLAGS = $(LDFLAGS_sharedlib) +libsimple_so_SOURCES = simple.c +libsimple_so_LDFLAGS = $(LDFLAGS_sharedlib) -Wl,-soname,libsimple.so.1.0 + no_rpath_SOURCES = no-rpath.c # no -fpic for no-rpath.o no_rpath_CFLAGS = - diff --git a/tests/soname.sh b/tests/soname.sh new file mode 100755 index 0000000..f81e8ed --- /dev/null +++ b/tests/soname.sh @@ -0,0 +1,21 @@ +#! /bin/sh -e +SCRATCH=scratch/$(basename $0 .sh) + +rm -rf ${SCRATCH} +mkdir -p ${SCRATCH} + +cp libsimple.so ${SCRATCH}/ + +# print and set DT_SONAME +soname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so) +if test "$soname" != libsimple.so.1.0; then + echo "failed --print-soname test. Expected soname: libsimple.so.1.0, got: $soname" + exit 1 +fi + +../src/patchelf --set-soname libsimple.so.1.1 ${SCRATCH}/libsimple.so +newSoname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so) +if test "$newSoname" != libsimple.so.1.1; then + echo "failed --set-soname test. Expected newSoname: libsimple.so.1.1, got: $newSoname" + exit 1 +fi |