From: "Jörn Engel" <joern@logfs.org>
To: linux-sparse@vger.kernel.org
Cc: 505177@bugs.debian.org
Subject: Hard-coded gcc header path
Date: Tue, 11 Nov 2008 14:58:17 +0100 [thread overview]
Message-ID: <20081111135816.GA25986@logfs.org> (raw)
Sparse doesn't work for me when compiling userspace code. Others have
experienced the same, so I refer to someone else's description of the
symptom:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505177
On my system, sparse tries several headers in order, neither of which
exists:
open("/usr/include/stddef.h", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/include/stddef.h", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/gcc/i486-linux-gnu/4.1.2/include/stddef.h", O_RDONLY) = -1 ENOENT (No such file or directory)
Not a big surprise when looking at the headers that do exist:
Galway:/usr/lib/gcc/i486-linux-gnu# ll
total 20
drwxr-xr-x 4 root root 4096 2008-07-01 08:42 3.4.6
drwxr-xr-x 4 root root 4096 2007-09-23 17:59 4.0.4
drwxr-xr-x 3 root root 4096 2008-06-26 00:20 4.1
lrwxrwxrwx 1 root root 3 2007-09-23 20:57 4.1.3 -> 4.1
drwxr-xr-x 3 root root 4096 2008-07-13 11:06 4.2
lrwxrwxrwx 1 root root 3 2008-07-01 08:42 4.2.4 -> 4.2
drwxr-xr-x 4 root root 4096 2008-09-30 16:27 4.3
lrwxrwxrwx 1 root root 3 2008-07-01 08:42 4.3.1 -> 4.3
lrwxrwxrwx 1 root root 3 2008-08-08 18:18 4.3.2 -> 4.3
So why does sparse try 4.1.2 and not 4.1.3 or 4.3.2 or any other
variant?
joern@Galway:/usr/src/kernel/sparse$ cat pre-process.h
#define GCC_INTERNAL_INCLUDE "/usr/lib/gcc/i486-linux-gnu/4.1.2/include"
Ah, it is hard-coding the path.
So what is the right solution to this problem? Call "gcc --version" and
parse the (deliberately hard) output? Or make a copy of the gcc headers
and ship them as /usr/lib/sparse/0.4.1/...?
Jörn
--
But this is not to say that the main benefit of Linux and other GPL
software is lower-cost. Control is the main benefit--cost is secondary.
-- Bruce Perens
--
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
next reply other threads:[~2008-11-11 13:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-11 13:58 Jörn Engel [this message]
2008-11-11 14:01 ` Hard-coded gcc header path 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
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=20081111135816.GA25986@logfs.org \
--to=joern@logfs.org \
--cc=505177@bugs.debian.org \
--cc=linux-sparse@vger.kernel.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 NNTP newsgroup(s).