All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Morten Welinder <mwelinder@gmail.com>
Cc: Pierre Habouzit <madcoder@debian.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-sparse@vger.kernel.org, 505177@bugs.debian.org
Subject: Re: Hard-coded gcc header path
Date: Tue, 11 Nov 2008 23:32:15 +0100	[thread overview]
Message-ID: <20081111223215.GA30224@logfs.org> (raw)
In-Reply-To: <118833cc0811111300q4e7571f5o2a56a652f9a941e9@mail.gmail.com>

On Tue, 11 November 2008 16:00:21 -0500, Morten Welinder wrote:
> 
> The problem is not the header files, but that we need to ensure that the
> proper include path is set up.
> 
> This is needed because sparse currently tries to mimic some
> indeterminate gcc version in terms of predefines.  A similar solution
> would be needed to mimic any other compiler.  We obviously need
> a default path for system headers somehow.
> 
> In this case, we could probably get away with accepting a definition
> of GCC_INTERNAL_INCLUDE on the command line and use that in
> preference over whatever is in pre-process.h

That doesn't strike me as an improvement.  I have a workaround, which is
to create a symlink in /usr/lib/gcc/i486-linux-gnu/ that matches what
sparse expects.  If I had to set GCC_INTERNAL_INCLUDE on every
invocation, I'd consider that worse than my current workaround.

Either sparse gets smart enough to find the headers [1] or it ships its
own set.  Anything else will continue to fail on one machine or another.

[1] Bernd Petrovitsch sent me this neat one-liner in a private mail:
gcc -v -E - </dev/null 2>&1 >/dev/null | sed -n -e '/^#include <\.\.\.> search starts here:/,/^End of search list\./s/^ \(.*\)/\1/p

We could add that to cgcc to set additional include paths.

Jörn

-- 
Public Domain  - Free as in Beer
General Public - Free as in Speech
BSD License    - Free as in Enterprise
Shared Source  - Free as in "Work will make you..."
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-11-11 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 13:58 Hard-coded gcc header path Jörn Engel
2008-11-11 14:01 ` Johannes Berg
2008-11-11 14:15   ` Jörn Engel
2008-11-11 20:13     ` Bug#505177: " Pierre Habouzit
2008-11-11 20:28       ` Jörn Engel
2008-11-11 21:00         ` Morten Welinder
2008-11-11 22:32           ` Jörn Engel [this message]
2008-11-11 23:10             ` Bernd Petrovitsch
2008-11-11 14:41 ` Bernd Petrovitsch

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=20081111223215.GA30224@logfs.org \
    --to=joern@logfs.org \
    --cc=505177@bugs.debian.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-sparse@vger.kernel.org \
    --cc=madcoder@debian.org \
    --cc=mwelinder@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.