Commit Graph

48 Commits

Author SHA1 Message Date
Tuomas Tynkkynen 4814341494 Add '--allowed-rpath-prefixes' option to '--shrink-rpath'
Fixes #97. In essence, the problem is that some packages in Nixpkgs have
RPATHs pointing to both $NIX_BUILD_TOP and $out, e.g.:

/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/libldap_r/.libs
/tmp/nix-build-openldap-2.4.44.drv-0/openldap-2.4.44/libraries/liblber/.libs
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib
/nix/store/bfkmdxmv3a3f0g3d2q8jkdz2wam93c5z-openldap-2.4.44/lib64

Currently, running `patchelf --shrink-rpath` does the wrong thing by
keeping the /tmp/ paths and deleting the /nix/store ones. Now we can fix
the problem by using

patchelf --shrink-rpath --allowed-rpath-prefixes $NIX_STORE_DIR

in the Nixpkgs fixupPhase instead.
2016-06-04 00:25:02 +03:00
Felipe Sateler bb04c06a66 no-rpath-prebuild: force pagesize to 4096 on prebuilt binaries
They all have that page size, and the host-detected one might be
different.
2016-02-29 17:38:07 -03:00
Eelco Dolstra b202ad239e PR #40 had the side-effect of fixing the ia64 test 2015-07-24 01:36:39 +02:00
darealshinji d4720dcb72 soname test: set an initial DT_SONAME entry 2015-07-13 19:54:30 +02:00
darealshinji 453660e7db tests: build libsimple without soname 2015-07-13 19:53:38 +02:00
Eelco Dolstra bf4b579d63 Fix build on Linux
http://hydra.nixos.org/build/13337912
2014-08-18 12:40:05 +02:00
Eelco Dolstra 2ca39b8060 no-rpath-prebuild.sh: Don't run resulting binary
This leads to numerous build failures:

  http://hydra.nixos.org/eval/1136585

because ELF interpreter names are not unique (e.g. ld-linux.so.2 is
used on systems other than i686-linux).
2014-07-18 12:40:15 +02:00
Eelco Dolstra 1090b56a0a Merge branch 'master' of github.com:vdanjean/patchelf
Conflicts:
	tests/Makefile.am
2014-04-24 16:58:45 +02:00
Chingis Dugarzhapov 02c185ff69 Added tests for --print-soname and --set-soname 2014-04-19 10:05:56 +00:00
Vincent Danjean c4220eaf0f rewrite no-rpath test
* compile locally this test in the no-rpath test
* add tests for prebuilt no-rpath binaries on various ELF platforms
  => ia64 does not work, probably a bug in patchelf. Marking it as XFAIL for now
2012-07-11 10:10:32 +02:00
Vincent Danjean 00b2fa4f77 Rewrite tests in automake
- add options in AM_INIT_AUTOMAKE to be more strict
  and to enable more advanced features (color-tests and parallel-tests)
- rewrite tests/Makefile.am to use automake rules for building program and libraries

=> we can now do:
./bootstrap.sh && mkdir build && cd build && ../configure && make -j distcheck
2012-07-10 18:16:24 -04:00
Vincent Danjean 3226dea361 Allow parallel execution of tests
Each test use its own subdirectory in scratch/
2012-07-10 18:16:24 -04:00
Vincent Danjean 4f66601450 fix build *and check* out of tree
- use Makefile variables $< (and $@) so that sources are found correctly
- use ${srcdir} in test scripts to find the sources

This allows "make distcheck" to successfully pass
2012-07-10 18:16:24 -04:00
Vincent Danjean 102237983e Rewrite tests in automake
- add options in AM_INIT_AUTOMAKE to be more strict
  and to enable more advanced features (color-tests and parallel-tests)
- rewrite tests/Makefile.am to use automake rules for building program and libraries

=> we can now do:
./bootstrap.sh && mkdir build && cd build && ../configure && make -j distcheck
2012-06-21 11:50:48 +02:00
Vincent Danjean 8d6a477b99 Allow parallel execution of tests
Each test use its own subdirectory in scratch/
2012-06-21 11:43:57 +02:00
Vincent Danjean a479665158 fix build *and check* out of tree
- use Makefile variables $< (and $@) so that sources are found correctly
- use ${srcdir} in test scripts to find the sources

This allows "make distcheck" to successfully pass
2012-06-21 10:03:31 +02:00
Eelco Dolstra 2b52ef1cdc * Test whether the patched no-rpath executable works on i686-linux. 2010-08-26 11:36:31 +00:00
Eelco Dolstra 3955ec926c * On FreeBSD, running a program by calling the ELF interpreter
directly (e.g. “/libexec/ld-elf.so.1 /bin/ls”) hangs, and on OpenBSD
  the interpreter is not executable.  Let’s assume that it only works
  on Linux.
2009-11-04 15:26:57 +00:00
Eelco Dolstra ecb2b0c96f * Regression test for NIXPKGS-98: patchelf barfs on dynamic libraries
that contain an .interp section.
2009-06-16 15:26:30 +00:00
Eelco Dolstra fbaddb9b47 * Regression test: Doing "/lib/ld-linux-x86-64.so.2 <program>" should
work on a patched executable (it doesn't right now on x86_64).
2009-01-30 13:49:58 +00:00
Eelco Dolstra 0500f6d677 2008-05-28 15:50:07 +00:00
Eelco Dolstra ef42c45d0c * Fix a broken test. 2008-05-28 15:32:03 +00:00
Eelco Dolstra 94886c4baf * Fix make dist. 2008-05-28 14:39:10 +00:00
Eelco Dolstra dd00c21227 * A test for setting the rpath on a library. 2008-05-28 12:29:23 +00:00
Eelco Dolstra 704c22c6a8 * Support DT_RUNPATH (in fact, prefer DT_RUNPATH over DT_RPATH unless
--force-rpath is set).
2008-05-27 16:23:21 +00:00
Eelco Dolstra 26f47987c5 * Fix the tests on FreeBSD. On FreeBSD, the RPATH is scoped: adding a
directory to the RPATH of an executable doesn't cause it to be used
  for resolving dependencies of libraries, only the dependencies of
  the executable itself.  So don't rely on that.  A better fix would
  be to support --set-rpath on libraries, but that's a lot harder.
2008-05-09 15:46:54 +00:00
Eelco Dolstra 94f38d26bc * .rel.plt is called .rela.plt on x86_64-linux. 2007-01-31 15:08:42 +00:00
Eelco Dolstra 56cae84500 * Instantiate the right template depending on whether the file is 32
or 64 bits.  (This is done at runtime, so patchelf can patch 32
  *and* 64-bit executables on both 32 and 64-bit platforms).
2007-01-31 14:48:19 +00:00
Eelco Dolstra c246daeeea * `--interpreter' -> `--set-interpreter'. 2005-10-11 13:05:08 +00:00
Eelco Dolstra 37cd5c8d04 * A `--debug' flag. 2005-10-04 13:11:16 +00:00
Eelco Dolstra b60d8d3ef2 * Add a test for programs that crash when .dynstr etc. are moved. 2005-10-03 18:22:32 +00:00
Eelco Dolstra dd77b20708 * Handle the case where no RPATH is present, so the .dynamic table has
to be increased.
2005-10-01 01:05:50 +00:00
Eelco Dolstra 2369d8b2de * Handle `--set-rpath' for the growing case. 2005-09-30 23:59:40 +00:00
Eelco Dolstra 58ec67927f * `patchelf --set-rpath': short case. 2005-09-30 23:04:25 +00:00
Eelco Dolstra d5afac8e03 * Revert. 2005-09-30 21:28:34 +00:00
Eelco Dolstra 460e117720 * Refactoring continued: `--set-interpreter' works again. 2005-09-30 21:22:27 +00:00
Eelco Dolstra 1587dc98e2 * Doh! 2005-09-30 15:44:47 +00:00
Eelco Dolstra 774bdc0d5e * Also try a interpreter with a long name. 2005-09-30 15:43:10 +00:00
Eelco Dolstra 8d7076e8cf * Set a interpreter with a short name. 2005-09-30 15:38:42 +00:00
Eelco Dolstra 5349440827 * C++-ify. 2005-09-30 11:40:20 +00:00
Eelco Dolstra 3dd9c1ffca * Don't use an impure test path. 2005-09-29 16:16:20 +00:00
Eelco Dolstra 3b4fd53eec * Debug. 2005-09-29 16:01:32 +00:00
Eelco Dolstra 64e3c5d087 * Add an operation `--print-rpath' to print the RPATH of the library
or executable and exit.
2005-09-29 15:58:41 +00:00
Eelco Dolstra a49db8e569 * Put in a highly Nix-specific hack to make the tests work. 2005-09-29 15:46:07 +00:00
Eelco Dolstra 190a60c025 * Add a failing test for `--set-rpath'. Test-driven development! 2005-09-29 15:41:04 +00:00
Eelco Dolstra 4f3658be12 * Added some real tests. 2005-09-29 14:21:40 +00:00
Eelco Dolstra 8685534261 * Add dist files. 2005-09-29 12:17:56 +00:00
Eelco Dolstra 0da4ea8b65 * Add tests. 2005-09-29 12:03:56 +00:00