unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 64929@debbugs.gnu.org
Cc: Attila Lendvai <attila@lendvai.name>
Subject: [bug#64929] [PATCH] gnu: gcc-toolchain: Create a 'bin/cc' symlink.
Date: Mon, 21 Aug 2023 15:40:57 +0200	[thread overview]
Message-ID: <bbbb030f-d73b-e8e1-1790-5cd577236495@telenet.be> (raw)
In-Reply-To: <dd5d375b64b71dd138fb37fc1714628f029e85f3.1690631428.git.attila@lendvai.name>


[-- Attachment #1.1.1: Type: text/plain, Size: 1796 bytes --]

 > There are many projects that don't have a configure script that finds 
gcc.

> +                       ;; Create 'cc' so that one can use it as a drop-in
> +                       ;; replacement for the default tool chain and have
> +                       ;; configure scripts find the compiler.  Note that
> +                       ;; 'c++' is already present, no need to symlink it.
> +                       (symlink "gcc" (string-append out "/bin/cc"))

That doesn't work.  Sure, those configure scripts will find _a_ 
compiler, but it will be the _wrong_ compiler when cross-compiling, so 
for such packages you need to set CC=(cc-for-target) instead, which 
eliminates the need for 'cc'.  Furthermore, the lack of a ‘cc’ binary 
ensures that those configure scripts fail, which helps 
detecting/preventing this cross-compilation issue.

IOW, I think the true issue is the use of 'cc' in those configure 
scripts, not the lack of 'cc' in Guix.

(I have a patch at https://issues.guix.gnu.org/65426 for detecting this 
kind of compilation issue, albeit in #:make-flags instead instead of 
#:configure-flags and it doesn't look inside configure scripts.)

Also see <https://issues.guix.gnu.org/28629>, though that one is pretty 
useless because it doesn't _why_ the decision was made.

 > [...] Also makes it more symmetric with the clang-toolchain, that 
also does this.

If you are aiming for symmetry, I would instead propose removing 'cc' 
from clang-toolchain.  OTOH, cross-compilation in clang works somewhat 
differently (extra arguments instead of a separate binary IIUC), so 
perhaps Clang's cc is fine (assuming that the (equivalents of) Makefiles 
actually bother passing those extra arguments, which I doubt ...)

Best regards,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2023-08-21 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-29 11:50 [bug#64929] [PATCH] gnu: gcc-toolchain: Create a 'bin/cc' symlink Attila Lendvai
2023-08-21 13:40 ` Maxime Devos [this message]
2023-08-21 14:30   ` Attila Lendvai
2023-08-21 15:08     ` Maxime Devos
2024-02-28 20:59 ` John Kehayias via Guix-patches via

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=bbbb030f-d73b-e8e1-1790-5cd577236495@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=64929@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /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).