all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Tobias Platen <trisquel@platen-software.de>, guix-devel@gnu.org
Subject: Re: Crosscompiling C++ for powerpc64le fails
Date: Wed, 29 May 2019 12:10:16 +0200	[thread overview]
Message-ID: <20190529121016.1c593a7c@scratchpost.org> (raw)
In-Reply-To: <20190528203151.5b87be76@scratchpost.org>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

I've investigated a bit more:

Guix's gcc-4.7 passes

  (string-append "--with-native-system-header-dir=" libc "/include")
  where libc is (assoc-ref %build-inputs "libc")

.

However, further down, there is

                `(let* ((libc        (assoc-ref %build-inputs "libc"))
                       (libc-native (or (assoc-ref %build-inputs "libc-native")
                                        libc)))


which makes me think that "--with-native-system-header-dir=" should use
libc-native if the latter is present.

It would be possible to pass "--with-headers=" to gcc which would make it copy
the specified directory into the gcc installation directory and everything
would work without weird workarounds.

The gcc option "--with-headers=" is deprecated in favor of "--with-sysroot".

Also, the gcc manual says:

> "If the specified directory is a subdirectory of ${exec_prefix}, then it will
> be found relative to the GCC binaries if the installation tree is moved."

Not sure we want that.

The gcc manual says:

>If you specify the --with-native-system-header-dir=dirname option then the
>compiler will search that directory within dirname for native system headers
>rather than the default /usr/include. 

So I guess a quick workaround would be to specify "--with-headers=" libc for
cross-gcc.  That would make the resulting gcc much larger since it would copy
glibc into it.

The right fix would be to specify "--with-sysroot=" or to use our patch.

In any case, what guix master does with

 (string-append "--with-native-system-header-dir=" libc "/include")
  where libc is (assoc-ref %build-inputs "libc")

is seriously bad.  Should replace that by (or libc-native libc) in that order.

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

  reply	other threads:[~2019-05-29 10:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 16:07 Crosscompiling C++ for powerpc64le fails Tobias Platen
2019-05-28 18:31 ` Danny Milosavljevic
2019-05-29 10:10   ` Danny Milosavljevic [this message]
2019-05-31 21:54     ` Ludovic Courtès
2019-06-03 18:30       ` Marius Bakke
2019-06-05 13:04         ` Ludovic Courtès
2019-06-06 18:35           ` Marius Bakke

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=20190529121016.1c593a7c@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=trisquel@platen-software.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 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.