distro: gcc: Patch `lib' spec to add `-rpath' for each `-L'.

* distro/base.scm (gcc-4.7): Patch `LIB_SPEC' to add `-rpath' for each
  `-L'.  Spec string suggested by Marc Glisse <marc.glisse@inria.fr>.
  (libtool): Add `libtool-skip-tests.patch'.

* distro/patches/libtool-skip-tests.patch: New file.
* Makefile.am (dist_patch_DATA): Add it.
This commit is contained in:
Ludovic Courtès 2012-09-14 00:49:39 +02:00
parent 457dd86d66
commit dc8907d8e3
3 changed files with 58 additions and 1 deletions

View File

@ -46,6 +46,7 @@ dist_patch_DATA = \
distro/patches/binutils-ld-new-dtags.patch \
distro/patches/diffutils-gets-undeclared.patch \
distro/patches/guile-1.8-cpp-4.5.patch \
distro/patches/libtool-skip-tests.patch \
distro/patches/m4-gets-undeclared.patch \
distro/patches/m4-readlink-EINVAL.patch \
distro/patches/m4-s_isdir.patch \

View File

@ -765,6 +765,18 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
;; Tell where to find libstdc++, libc, and `?crt*.o', except
;; `crt{begin,end}.o', which come with GCC.
;;
;; The `%{L*:-rpath %*}' rule adds a `-rpath LIBDIR' argument
;; for each occurrence of `-L LIBDIR'. We could avoid
;; `-rpath' altogether and instead use the `LD_RUN_PATH'
;; environment variable, but that would tend to include more
;; than needed in the RPATH; for instance, given a package
;; with `libfoo' as an input, all its binaries would have
;; libfoo in their RPATH, regardless of whether they actually
;; NEED it. See
;; <http://gcc.gnu.org/ml/gcc-help/2012-09/msg00110.html> for
;; details.
;; XXX: For crt*.o, use `STANDARD_STARTFILE_PREFIX' instead? See
;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html>.
(substitute* ("gcc/config/gnu-user.h"
@ -772,7 +784,7 @@ BFD (Binary File Descriptor) library, `gprof', `nm', `strip', etc.")
"gcc/config/i386/gnu-user64.h")
(("#define LIB_SPEC (.*)$" _ suffix)
(format #f "#define LIB_SPEC \"-L~a/lib -rpath=~a/lib \
-rpath=~a/lib64 -rpath=~a/lib \" ~a~%"
-rpath=~a/lib64 -rpath=~a/lib %{L*:-rpath %*}\" ~a~%"
libc libc out out suffix))
(("([^ ]*)crt([^\\.])\\.o" _ prefix suffix)
(string-append libc "/lib/" prefix "crt" suffix ".o"))))
@ -998,6 +1010,11 @@ modification.")
(build-system gnu-build-system)
(native-inputs `(("m4" ,m4)
("perl" ,perl)))
(arguments
;; TODO: Use `TESTSUITEFLAGS=-jN' for tests.
`(#:patches (list (assoc-ref %build-inputs "patch/skip-tests"))))
(inputs `(("patch/skip-tests"
,(search-patch "libtool-skip-tests.patch"))))
(description "GNU Libtool, a generic library support script")
(long-description
"GNU libtool is a generic library support script. Libtool hides the
@ -1668,6 +1685,8 @@ exec ~a/bin/~a-gcc -B~a/lib -Wl,-dynamic-linker -Wl,~a/lib/~a \"$@\"~%"
(define-public %final-inputs
;; Final derivations used as implicit inputs by `gnu-build-system'.
;; FIXME: Build bash before the others, otherwise patch-shebangs uses it in
;; bzip2, for instance.
(let ((finalize (cut package-with-explicit-inputs <> %boot3-inputs
(current-source-location))))
`(,@(map (match-lambda

View File

@ -0,0 +1,37 @@
Because our GCC `lib' spec automatically adds `-rpath' for each `-L'
and a couple more `-rpath, there are two test failures:
demo-hardcode.test, and destdir.at. Disable these.
--- libtool-2.4.2/Makefile.in 2011-10-17 12:18:55.000000000 +0200
+++ libtool-2.4.2/Makefile.in 2012-09-13 23:50:37.000000000 +0200
@@ -909,7 +908,7 @@ COMMON_TESTS = \
# but they depend on the other tests being run beforehand.
INTERACTIVE_TESTS = tests/demo-shared.test tests/demo-shared-make.test \
tests/demo-shared-exec.test tests/demo-shared-inst.test \
- tests/demo-hardcode.test tests/demo-relink.test \
+ tests/demo-relink.test \
tests/demo-noinst-link.test tests/demo-shared-unst.test \
tests/depdemo-shared.test tests/depdemo-shared-make.test \
tests/depdemo-shared-exec.test tests/depdemo-shared-inst.test \
@@ -2580,8 +2579,7 @@ tests/cdemo-static-make.log: tests/cdemo
tests/demo-shared-unst.log: tests/demo-noinst-link.log
tests/demo-noinst-link.log: tests/demo-relink.log
-tests/demo-relink.log: tests/demo-hardcode.log
-tests/demo-hardcode.log: tests/demo-shared-inst.log
+tests/demo-relink.log: tests/demo-shared-inst.log
tests/demo-shared-inst.log: tests/demo-shared-exec.log
tests/demo-shared-exec.log: tests/demo-shared-make.log
tests/demo-shared-make.log: tests/demo-shared.log
--- libtool-2.4.2/tests/testsuite 2011-10-17 12:19:52.000000000 +0200
+++ libtool-2.4.2/tests/testsuite 2012-09-14 00:28:45.000000000 +0200
@@ -14443,6 +14443,6 @@ read at_status <"$at_status_file"
#AT_START_69
at_fn_group_banner 69 'destdir.at:75' \
"DESTDIR with in-package deplibs" " " 4
-at_xfail=no
+at_xfail=yes
eval `$LIBTOOL --config | grep '^fast_install='`
case $fast_install in no) :;; *) false;; esac && at_xfail=yes