unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Alex Vong <alexvong1995@gmail.com>
To: help-guix@gnu.org
Cc: alexvong1995@gmail.com
Subject: How to run guix on replicant / android with linux 3.0?
Date: Sun, 17 Feb 2019 05:51:08 +0800	[thread overview]
Message-ID: <87zhqvjtbn.fsf@gmail.com> (raw)

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

Hello,

I've a phone with replicant installed. It runs linux 3.0.x which is too
old for guix glibc (which requires linux 3.2.x). Using the hint at the
bottom of 'cross-base.scm', I successfully build cross-gcc with
cross-glibc 2.23 (configured with '--enable-kernel=3.0.0') for
armhf. Using them, I can cross-compile a statically linked hello world.

Is there an easy way to make relocatable guix pack with glibc 2.23
(configured with '--enable-kernel=3.0.0') for armhf? (My phone doesn't
connect to the internet, so I can't use 'guix pull' and 'guix
manifest'.) Right now, I have to manually set the '-B', '-I', '-L' and
'-sysroot' paths to cross-gcc to make it build hello world (which is
wrong and very tedious).

The snippet is copied below for reference, but please don't use it, it's
only a proof-of-concept. Thanks for help!

Cheers,
Alex


(use-modules (guix packages)
             (guix utils)
             (gnu packages)
             (gnu packages base)
             (gnu packages cross-base))


(let* ((triplet "arm-linux-gnueabihf")

       (cross-linux (@@ (gnu packages cross-base) cross-kernel-headers))
       (cross-linux* (cross-linux triplet))

       (cross-binutils* (cross-binutils triplet))
       
       (cross-glibc (cross-libc triplet))
       (cross-glibc-version "2.23")

       (cross-glibc*
        (package
          (inherit cross-glibc)
          (version cross-glibc-version)
          (source (origin
                    (inherit (package-source glibc))
                    (uri (string-append "mirror://gnu/glibc/glibc-"
                                        cross-glibc-version ".tar.xz"))
                    (sha256
                     (base32
                      "1s8krs3y2n6pzav7ic59dz41alqalphv7vww4138ag30wh0fpvwl"))
                    (patches
                     (search-patches "glibc-ldd-x86_64.patch"
                                     "glibc-versioned-locpath.patch"
                                     "glibc-vectorized-strcspn-guards.patch"
                                     "glibc-CVE-2015-5180.patch"
                                     "glibc-CVE-2016-3075.patch"
                                     "glibc-CVE-2016-3706.patch"
                                     "glibc-CVE-2016-4429.patch"
                                     "glibc-CVE-2017-1000366-pt1.patch"
                                     "glibc-CVE-2017-1000366-pt2.patch"
                                     "glibc-CVE-2017-1000366-pt3.patch"))
                    (modules '((guix build utils)))
                                  (snippet
                                   '(begin
                                      (substitute* "misc/regexp.c"
                                        (("char \\*loc1;")
                                         "char *loc1 __attribute__ ((nocommon));")
                                        (("char \\*loc2;")
                                         "char *loc2 __attribute__ ((nocommon));")
                                        (("char \\*locs;")
                                         "char *locs __attribute__ ((nocommon));"))
                                      #t))))
          (arguments
           (substitute-keyword-arguments
               (package-arguments cross-glibc)
             ((#:configure-flags flags)
              `(append ,flags (list "--enable-kernel=3.0.0")))))))

       (cross-gcc* (cross-gcc triplet
                              #:xbinutils (cross-binutils triplet)
                              #:libc cross-glibc*)))

  (list cross-linux* cross-binutils* cross-glibc* cross-gcc*))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

             reply	other threads:[~2019-02-16 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16 21:51 Alex Vong [this message]
2019-02-17  7:37 ` How to run guix on replicant / android with linux 3.0? Julien Lepiller
2019-02-20 20:56   ` Alex Vong

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=87zhqvjtbn.fsf@gmail.com \
    --to=alexvong1995@gmail.com \
    --cc=help-guix@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.
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).