Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Fix config.mak.uname to allow cross-compilation
@ 2016-05-22 20:24 Mauro Condarelli
  2016-05-22 20:24 ` Mauro Condarelli
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Condarelli @ 2016-05-22 20:24 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-22 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-22 20:24 [Buildroot] [PATCH 1/1] Fix config.mak.uname to allow cross-compilation Mauro Condarelli
2016-05-22 20:24 ` Mauro Condarelli
2016-05-22 20:29   ` Thomas Petazzoni
2016-05-22 20:40     ` Mauro Condarelli
2016-05-22 20:45       ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox