GNU bug report logs - #53925
[PATCH 0/2] gnu: clang: Build and link as shared libraries.

Previous Next

Package: guix-patches;

Reported by: Greg Hogan <code <at> greghogan.com>

Date: Thu, 10 Feb 2022 19:47:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53925 in the body.
You can then email your comments to 53925 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53925; Package guix-patches. (Thu, 10 Feb 2022 19:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Greg Hogan <code <at> greghogan.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 10 Feb 2022 19:47:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Greg Hogan <code <at> greghogan.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/2] gnu: clang: Build and link as shared libraries.
Date: Thu, 10 Feb 2022 14:46:23 -0500
[Message part 1 (text/plain, inline)]
clang-tools-extra has been moved to a separate "extra" output due to the
size of the statically linked binaries. Unfortunately, this prevents tools
from finding the header files stored in the default clang "out" output:

--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 1 Feb 08 2022 14:30:38 (current)
  guix 59892f1
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 59892f105585a98bcaaa4abc99142944cb171acf

$ cat main.cpp
#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

$ guix shell clang clang:extra

$ clang-tidy main.cpp --
1776 warnings and 1 error generated.
Error while processing /efs/devel/hello/src/main.cpp.
/gnu/store/i86pbiqnnz0c2313616jdbsbdgp7qvav-profile/include/wchar.h:35:10:
error: 'stddef.h' file not found [clang-diagnostic-error]
#include <stddef.h>
         ^~~~~~~~~~
Suppressed 1776 warnings (1776 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
Found compiler error(s).
--8<---------------cut here---------------end--------------->8---

After applying the attached patch the tool does find the necessary header
file (at /gnu/store/*-clang-13.0.1/lib/clang/13.0.1/include/stddef.h):

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix shell clang

$ clang-tidy main.cpp --
1971 warnings generated.
Suppressed 1971 warnings (1971 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use
-system-headers to display errors from system headers as well.
--8<---------------cut here---------------end--------------->8---

The patch builds clang with dynamic linkage and removes the separate
output. The new size of the full complement of dynamically linked libraries
and binaries is one-third the size of the original clang with extras
excluded.

--8<---------------cut here---------------start------------->8---
$ guix size clang
store item                                                       total
 self
/gnu/store/ylbcqp3yjha97g450g33cz9grsg0ic2w-clang-13.0.1          1247.5
628.0  50.3%
...
total: 1247.5 MiB

$ ./pre-inst-env guix size clang
store item                                                       total
 self
/gnu/store/fxf9gyx7c790kbbzhyyamdf27g8yjb9v-clang-13.0.1           842.1
222.6  26.4%
...
total: 842.1 MiB
--8<---------------cut here---------------end--------------->8---

I successfully built all dependent packages of the affected clang versions
(clang <at> 10 through 13) except c-vise-2.4.0, for which I have included a
patch, and the following packages currently failing on master:
  clang-toolchain-8.0.0
  dub <at> 1.7.2
  gtkd <at> 3.9.0
  icedove-wayland <at> 91.5
  itk-snap <at> 3.8.0
  java-pep-adapter-2.1.23
  rdmd <at> 2.077.1
  rust-aom-sys-0.3.0
  rust-bindgen-0.52.0
  rust-bindgen-0.55.1
  rust-clang-sys-0.26.4
  rust-sequoia-openpgp-0.9.0
  scregseg-0.1.1

Greg
[Message part 2 (text/html, inline)]
[0002-gnu-c-vise-Fix-linkage.patch (application/x-patch, attachment)]
[0001-gnu-clang-Build-and-link-as-shared-libraries.patch (application/x-patch, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 16 Feb 2022 15:57:01 GMT) Full text and rfc822 format available.

Notification sent to Greg Hogan <code <at> greghogan.com>:
bug acknowledged by developer. (Wed, 16 Feb 2022 15:57:01 GMT) Full text and rfc822 format available.

Message #10 received at 53925-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Greg Hogan <code <at> greghogan.com>
Cc: 53925-done <at> debbugs.gnu.org
Subject: Re: bug#53925: [PATCH 0/2] gnu: clang: Build and link as shared
 libraries.
Date: Wed, 16 Feb 2022 16:56:50 +0100
Hi,

Greg Hogan <code <at> greghogan.com> skribis:

> The patch builds clang with dynamic linkage and removes the separate
> output. The new size of the full complement of dynamically linked libraries
> and binaries is one-third the size of the original clang with extras
> excluded.

That’s indeed much better than the extra output, in addition to fixing
bugs (also reported at <https://issues.guix.gnu.org/52054>).

Pushed as 6481dbda5100e9b0ff9c5221280d2c0cadd663b7.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Mar 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.