Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Condarelli <mc5686@mclink.it>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Fix config.mak.uname to allow cross-compilation
Date: Sun, 22 May 2016 22:24:02 +0200	[thread overview]
Message-ID: <1463948643-21344-1-git-send-email-mc5686@mclink.it> (raw)

This patch is part of a patchset for BuildRoot (https://buildroot.org/)
needed to correctly cross-compile GIT.

Git compilation relies on "uname" program to determine several system
charcteristics, but that does not work well in a cross-compilation
environment because "uname" will run on host, while we are interested
in information concerning target.

The file "config.mak.uname" unconditionally assigns variables using
":=", this prevents changing their value from the command line.
This minimal patch changes the flavor of the variable and assigns it
only if not already assigned, opening the road to spcify target-consistent
values on the command line (which is done in the other patches for
BuildRoot, but are not relevant here).

We are sending this patch upstream because we feel this might be
useful in other cross-compilation contexts.

Note this patch also changes variable "flavor" thus incurring in a
computational overhead; Makefile perusal doesn't seem to indicate
this as a problem, but it is possible to overcome this problem,
if deemed relevant, by using the construct:

  ifeq ($(origin uname_X), undefined)
    uname_X := $(shell sh -c 'uname -x 2>/dev/null || echo not')
  endif

If required I will submit another patch to this effect.

Regards
Mauro

             reply	other threads:[~2016-05-22 20:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-22 20:24 Mauro Condarelli [this message]
2016-05-22 20:24 ` [Buildroot] [PATCH 1/1] Fix config.mak.uname to allow cross-compilation Mauro Condarelli
2016-05-22 20:29   ` Thomas Petazzoni
2016-05-22 20:40     ` Mauro Condarelli
2016-05-22 20:45       ` Thomas Petazzoni

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=1463948643-21344-1-git-send-email-mc5686@mclink.it \
    --to=mc5686@mclink.it \
    --cc=buildroot@busybox.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox