[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of
From: |
Ludovic Courtès |
Subject: |
[bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files. |
Date: |
Thu, 7 Dec 2023 23:54:10 +0100 |
This partially reverts 3b2de6529b9d77c8a74d431859a3ec334e9603c2, itself
a followup to 25b30622b4a77cd4b2965b9d62fa310a22413d54.
* gnu/packages/base.scm (glibc)[arguments]: In ‘move-static-libs’ phase,
remove ‘empty-static-libraries’ variable and rewrite
‘empty-static-library?’ to check file type and size.
* gnu/packages/commencement.scm (make-gcc-toolchain): Remove ‘copy-file’
call to create ‘librt.a’.
Change-Id: I33c6825d5b1e6e790dfff494bac1da07d3389e77
---
gnu/packages/base.scm | 18 ++++++------------
gnu/packages/commencement.scm | 10 +---------
2 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 1144110309..311d598c8e 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -968,19 +968,13 @@ (define-public glibc
;; and as such, it is useful to have these ".a" files in
;; OUT in addition to STATIC.
- ;; XXX: It might be better to determine whether a static
- ;; library is empty by some criterion (such as their file
- ;; size equaling eight bytes) rather than hardcoding them
- ;; by name.
-
- ;; XXX: We forgot librt.a for the current version! In
- ;; the meantime, gcc-toolchain provides it, but remove
- ;; that fix once librt.a is added here.
- (define empty-static-libraries
- '("libpthread.a" "libdl.a" "libutil.a" "libanl.a"))
(define (empty-static-library? file)
- (any (lambda (s)
- (string=? file s)) empty-static-libraries))
+ ;; Return true if FILE is an 'ar' archive with nothing
+ ;; beyond the header.
+ (let ((file (string-append (assoc-ref outputs "out")
+ "/lib/" file)))
+ (and (ar-file? file)
+ (= (stat:size (stat file)) 8))))
(define (static-library? file)
;; Return true if FILE is a static library. The
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 4ccbbb0881..6c0f295f30 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3569,15 +3569,7 @@ (define* (make-gcc-toolchain gcc
"libc-debug")))
(union-build (assoc-ref %outputs "static")
(list (assoc-ref %build-inputs
- "libc-static")))
- ;; XXX Remove once an empty librt.a is added to
- ;; libc:out.
- (copy-file
- (string-append (assoc-ref %outputs "out")
- "/lib/libpthread.a")
- (string-append (assoc-ref %outputs "out")
- "/lib/librt.a"))
- #t))))
+ "libc-static")))))))
(native-search-paths
(append (package-native-search-paths gcc)
--
2.41.0
- [bug#67686] [PATCH core-updates 4/5] gnu: glibc: Install C.UTF-8 locale., (continued)
[bug#67686] [PATCH core-updates 5/5] gnu: glibc: Ensure C.UTF-8 locale is always found., Ludovic Courtès, 2023/12/07
[bug#67686] [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available, Ludovic Courtès, 2023/12/07
[bug#67686] [PATCH core-updates v2 7/7] gnu: glibc: Improve handling of empty .a files.,
Ludovic Courtès <=
[bug#67686] [PATCH core-updates v2 2/7] gnu: glibc-utf8-locales: Generalize and use gexps., Ludovic Courtès, 2023/12/07
[bug#67686] [PATCH core-updates v2 6/7] gnu: glibc: Ensure C.UTF-8 locale is always found., Ludovic Courtès, 2023/12/07
[bug#67686] [PATCH core-updates v2 5/7] gnu: glibc: Install C.UTF-8 locale., Ludovic Courtès, 2023/12/07
[bug#67686] [PATCH core-updates v2 3/7] gnu: mpfr: Update to 4.2.1., Ludovic Courtès, 2023/12/07
bug#67686: [PATCH core-updates v2 0/7] Update glibc to 2.38; make C.UTF-8 always available, Ludovic Courtès, 2023/12/09