unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Carl Dong <contact@carldong.me>
Cc: "37801@debbugs.gnu.org" <37801@debbugs.gnu.org>
Subject: bug#37801: Possible insight into issue #30756 #include_next bug
Date: Sat, 19 Oct 2019 14:53:36 +0200	[thread overview]
Message-ID: <20191019145336.4fb5af37@scratchpost.org> (raw)
In-Reply-To: <H5R52pYX-v7FYakGyXf-DjdVXYEMCTAR211IyaKX1lZ2haUGvm22ZfH8fRu1u8LWJPMCGhmUmvufVp43KseEbK69HVcAWfi0sKpuZkUEA4k=@carldong.me>

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

Hi,

On Fri, 18 Oct 2019 14:02:33 +0000
Carl Dong <contact@carldong.me> wrote:

> Perhaps Ludovic can confirm this, but I believe the reason why Guix is not
> setting up CROSS_CPATH is because it doesn't _know_ it's cross-compiling. 

Ah, that makes a lot of sense!  But the "cross-gcc" returns a cross compiler
that should know that we're cross-compiling (but it sets up SEARCH-PATHS
with CROSS_LIBRARY_PATH and CROSS_CPATH, but not NATIVE-SEARCH-PATHS.  Hmm).

But the fundamental problem remains that guix host-side can't know whether
we are cross compiling from this.  It has its own cross-compiling support
at the toplevel, at the guix command line.

The following is only tangentially related to your issue, so maybe not so
useful to you:

I've also tried

(define (xcross base-package)
  (package
    (inherit base-package)
    (search-paths '())
    (native-search-paths (list
                       (search-path-specification
                         (variable "CROSS_LIBRARY_PATH")
                         (files '("lib" "lib64")))
                       (search-path-specification
                         (variable "CROSS_CPATH")
                         (files '("lib" "lib64")))))))

and 

    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("cross-gcc" , (xcross (cross-gcc "arm-linux-gnueabihf"
                                #:xbinutils (cross-binutils "arm-linux-gnueabihf")
                                #:libc (xcross (cross-libc "arm-linux-gnueabihf")))))))
      ;("cross-libc" ,(xcross (cross-libc "arm-linux-gnueabihf"))) ; header files
       ("cross-libc-static" ,(xcross (cross-libc "arm-linux-gnueabihf")) "static")
       ("libusb" ,libusb)))

for sunxi-tools.

But that didn't work correctly either.

What I'm trying to do is a little different from what you are trying to do.

sunxi-tools has some parts that are supposed to be run on the embedded system in
question and some that are supposed to run on the host (both are GNU systems).
For convenience, I'm (and upstream are) trying to provide both in the
derivation--I think because the tools can send a program via USB to the embedded
system.

So if you compile sunxi-tools on x86_64, you get host tools for x86_64 and target
tools for ARM.

If you compile sunxi-tools on x86_64 for RISC-V, you get host tools for
RISC-V and target tools for ARM.

So it basically has to override the "which cross compiler" setting later in
the compilation process.

The more I think about it the more I'm getting the feeling that I should stop
trying to fit a square peg into a round hole and just add an extra package
for the target tools.

So I did the latter.
See guix-patches patch# 37823 which is now very nice.

Thanks for bringing the cross compilation topic up :)

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

      reply	other threads:[~2019-10-19 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 21:56 bug#37801: Possible insight into issue #30756 #include_next bug Carl Dong
2019-10-18  0:03 ` Danny Milosavljevic
2019-10-18 14:02   ` Carl Dong
2019-10-19 12:53     ` Danny Milosavljevic [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

  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=20191019145336.4fb5af37@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=37801@debbugs.gnu.org \
    --cc=contact@carldong.me \
    /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).