git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Support SPARSE in Makefile, better SPARSE_FLAGS

From
PRPavel Roskin <proski@gnu.org>
Date
Sep 30, 2005, 13:41 UTC
Message-ID
<1128087662.14543.14.camel@dv>
In-Reply-To
<7vek779kg0.fsf@assigned-by-dhcp.cox.net>
On Thu, 2005-09-29 at 22:46 -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Pavel Roskin <proski@gnu.org> writes:
> 
> > +# explicitly what architecture to check for.
> > +SPARSE = sparse
> > +SPARSE_FLAGS = -D__$(shell uname -i)__
> 
>         : siamese; uname --version
>         uname (coreutils) 5.2.1
>         Written by David MacKenzie.

Apparently my uname 5.2.1 was heavily patched by Fedora. Note that "uname -m" is not good enough, as it would give us i686 when i386 is really needed.

Show 9 quoted lines
>         Copyright (C) 2004 Free Software Foundation, Inc.
>         This is free software; see the source for copying conditions.
>         There is NO
>         warranty; not even for MERCHANTABILITY or FITNESS FOR A
>         PARTICULAR PURPOSE.
>         : siamese; uname -i
>         Try `uname --help' for more information.
> 
> Better alternatives?

I hate to say that, but a better alternative is to fix sparse to act like the native compiler by default (possibly with options to imitate other architectures or to be fully arch-neutral).

I have some hacks in mind, but I don't really like them:

Not good for i686 with unpatched uname: SPARSE_FLAGS = __$(shell uname -i 2>/dev/null || uname -m)__

gcc specific: SPARSE_FLAGS = __$(shell $CC -dumpmachine | sed 's/-.*//')__

bash specific: SPARSE_FLAGS = __$(shell echo $$HOSTTYPE)__

In any case, having SPARSE variable would be convenient.
-- 
Regards,
Pavel Roskin
Previous: Junio C HamanoNext: H. Peter Anvin
Message 3 of 7 in “Support SPARSE in Makefile, better SPARSE_FLAGS”
  1. Support SPARSE in Makefile, better SPARSE_FLAGSPavel Roskin, Sep 29, 2005
  2. Junio C HamanoSep 30, 2005
  3. Pavel RoskinSep 30, 2005
  4. H. Peter AnvinSep 30, 2005
  5. Pavel RoskinSep 30, 2005
  6. H. Peter AnvinSep 30, 2005
  7. Pavel RoskinOct 1, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.