From: Greg Hogan <code@greghogan.com>
To: 53925@debbugs.gnu.org
Subject: [bug#53925] [PATCH 0/2] gnu: clang: Build and link as shared libraries.
Date: Thu, 10 Feb 2022 14:46:23 -0500 [thread overview]
Message-ID: <CA+3U0Z=1ce49BYG2nqu5VBvsH2ATe2wd37rGkWbN9iL0__+RSQ@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 3018 bytes --]
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@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@1.7.2
gtkd@3.9.0
icedove-wayland@91.5
itk-snap@3.8.0
java-pep-adapter-2.1.23
rdmd@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
[-- Attachment #1.2: Type: text/html, Size: 4135 bytes --]
[-- Attachment #2: 0002-gnu-c-vise-Fix-linkage.patch --]
[-- Type: application/x-patch, Size: 981 bytes --]
[-- Attachment #3: 0001-gnu-clang-Build-and-link-as-shared-libraries.patch --]
[-- Type: application/x-patch, Size: 4729 bytes --]
next reply other threads:[~2022-02-10 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 19:46 Greg Hogan [this message]
2022-02-16 15:56 ` bug#53925: [PATCH 0/2] gnu: clang: Build and link as shared libraries Ludovic Courtès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+3U0Z=1ce49BYG2nqu5VBvsH2ATe2wd37rGkWbN9iL0__+RSQ@mail.gmail.com' \
--to=code@greghogan.com \
--cc=53925@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.