summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-11-18 14:06:47 +0100
committerLudovic Courtès <ludo@gnu.org>2013-11-18 14:06:47 +0100
commita7bf595fffd3db97b14ab3d5a5703497de266cb9 (patch)
treebd69f1f5c8b6cd91b1aa4ab54e4f499913865511
parent0129c94832a9fdd8c901848dd9e963e7c20063eb (diff)
gnu: gcc: Really always link against libgcc_s.so.
* gnu/packages/gcc.scm (gcc-4.7): Add snippet to add -lgcc_s to the "lib" spec. Remove --as-needed trick from 65d3b7c: it had no effect in cases where we have !static-libgcc && !shared-libgcc.
-rw-r--r--gnu/packages/gcc.scm23
1 files changed, 7 insertions, 16 deletions
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index f11e506bc7..aa3b48692e 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -161,11 +161,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC
(substitute* (find-files "gcc/config"
"^gnu-user.*\\.h$")
(("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
- ;; Note that with this "lib" spec, we may still add a
- ;; RUNPATH to GCC even when `libgcc_s' is not NEEDED.
- ;; There's not much that can be done to avoid it, though.
+ ;; Help libgcc_s.so be found (see also below.) Always use
+ ;; '-lgcc_s' so that libgcc_s.so is always found by those
+ ;; programs that use 'pthread_cancel' (glibc dlopens
+ ;; libgcc_s.so when pthread_cancel support is needed, but
+ ;; having it in the application's RUNPATH isn't enough; see
+ ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
(format #f "#define GNU_USER_TARGET_LIB_SPEC \
-\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a"
+\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib -lgcc_s}} \" ~a"
libc libc out out suffix))
(("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
(format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
@@ -173,18 +176,6 @@ where the OS part is overloaded to denote a specific ABI---into GCC
~a"
libc line))))
- ;; Use '-lgcc_s' rather than '--as-needed -lgcc_s', so that
- ;; libgcc_s.so is always found by those programs that use
- ;; 'pthread_cancel' (glibc dlopens libgcc_s.so when
- ;; pthread_cancel support is needed, but having it in the
- ;; application's RUNPATH isn't enough; see
- ;; <http://sourceware.org/ml/libc-help/2013-11/msg00023.html>.)
- ;; Also, "gcc_cv_ld_as_needed=no" as a configure flag doesn't
- ;; work.
- (substitute* "gcc/gcc.c"
- (("#ifndef USE_LD_AS_NEEDED.*$" line)
- (string-append "#undef USE_LD_AS_NEEDED\n" line)))
-
;; Don't retain a dependency on the build-time sed.
(substitute* "fixincludes/fixincl.x"
(("static char const sed_cmd_z\\[\\] =.*;")