From: Maxime Devos <maximedevos@telenet.be>
To: raingloom <raingloom@riseup.net>, 47648@debbugs.gnu.org
Subject: bug#47648: cc-for-target makes --with-c-toolchain unusable for some packages
Date: Mon, 12 Apr 2021 11:47:31 +0200 [thread overview]
Message-ID: <0139952bd05c10e068ce564d7982a90b032d9874.camel@telenet.be> (raw)
In-Reply-To: <20210408023329.4e6d48d7@riseup.net>
[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]
On Thu, 2021-04-08 at 02:33 +0200, raingloom wrote:
> I tried compiling lua with clang on a whim and found out about
> cc-for-target. Not sure if that's the only instance of hardcoded gcc,
> but it's certainly a prominent one.
A little more information:
this is not specific to cc-for-target. Try searching for "CC=gcc".
Most uses of "CC=gcc" are incorrect when cross-compiling. When
cross-compiling, these should be "CC=ARCHITECTURE-linux-gnu-gcc" or
something like that. The "cc-for-target" procedure outputs the correct
string.
> What would be the idiomatic way to fix it? Detect clang dynamically? Or
> move cc-for-target inside the build system module and make it available
> at build time?
To avoid massive rebuilds, perhaps the procedure "cc-for-target" could be
replaced with a macro "cc-for-target" that accesses the native-inputs of
this-package to determine whether it should output "CC=gcc" /
"CC=ARCHITECTURE-linux-gnu-gcc" or "CC=clang" / "CC=ARCHITECTURE-linux-gnu-clang"?
Also, moving cc-for-taget to the build system module would require changing
existing package definitions:
,(string-append "CC=" (cc-for-target)) --> (string-append "CC=" (cc-for-target))
(string-append "CC=" ,(cc-for-target)) --> (string-append "CC=" (cc-for-targt))
Warning: I haven't tested whether this approach works with --with-c-toolchain.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
prev parent reply other threads:[~2021-04-12 10:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 0:33 bug#47648: cc-for-target makes --with-c-toolchain unusable for some packages raingloom
2021-04-12 9:47 ` Maxime Devos [this message]
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=0139952bd05c10e068ce564d7982a90b032d9874.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=47648@debbugs.gnu.org \
--cc=raingloom@riseup.net \
/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.