unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org>
To: mekeor@posteo.de, 63258@debbugs.gnu.org
Cc: "Josselin Poiret" <dev@jpoiret.xyz>, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#63258: [PATCH] gnu: gcc-toolchain: Add empty librt.a.
Date: Thu,  4 May 2023 21:50:37 +0200	[thread overview]
Message-ID: <a7e33ea2f29b930d4782932ea733ccf9ca7f76da.1683229790.git.dev@jpoiret.xyz> (raw)
In-Reply-To: <87ttwscuow.fsf@posteo.de>

From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/packages/commencememnt.scm (make-gcc-toolchain): Add empty librt.a.
* gnu/packages/base.scm (gcc): Add a warning regarding the missing librt.a.
---
Hi,

This patch should be enough for -lrt to work with gcc-toolchain.  This doesn't
fix the underlying issue for the gcc package though, as it would incur a world
rebuild.

Best,
Josselin

 gnu/packages/base.scm         | 4 ++++
 gnu/packages/commencement.scm | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 6911ea78be..4350fd4041 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -945,6 +945,10 @@ (define-public glibc
                      ;; 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)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 25e96b1aa6..26d5eb3819 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3452,6 +3452,13 @@ (define* (make-gcc-toolchain gcc
                        (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))))
 
       (native-search-paths

base-commit: f14d3944cc699d1426c31b304fb49b72a579666a
-- 
2.39.2





  reply	other threads:[~2023-05-04 19:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  9:16 bug#63258: GCC package lacks librt.so (and instead only provides versioned librt.so.1) Mekeor Melire
2023-05-04 19:50 ` Josselin Poiret via Bug reports for GNU Guix [this message]
2023-08-25 16:36   ` bug#63258: [PATCH] gnu: gcc-toolchain: Add empty librt.a Josselin Poiret via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7e33ea2f29b930d4782932ea733ccf9ca7f76da.1683229790.git.dev@jpoiret.xyz \
    --to=bug-guix@gnu.org \
    --cc=63258@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=ludo@gnu.org \
    --cc=mekeor@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).