| From | Sent On | Attachments |
|---|---|---|
| md...@FreeBSD.org | Mar 29, 2011 2:20 pm | |
| John Baldwin | Mar 30, 2011 4:59 am | |
| Arnaud Lacombe | Mar 30, 2011 8:04 am | |
| Dimitry Andric | Mar 30, 2011 8:23 am | |
| Nathan Whitehorn | Mar 30, 2011 8:26 am | |
| Dimitry Andric | Mar 30, 2011 8:45 am | |
| Warner Losh | Mar 30, 2011 10:53 am | |
| Robert Watson | Apr 2, 2011 11:29 am | |
| Warner Losh | Apr 2, 2011 11:47 am | |
| Robert N. M. Watson | Apr 2, 2011 12:09 pm | |
| Warner Losh | Apr 2, 2011 3:48 pm | |
| Arnaud Lacombe | May 22, 2011 8:47 pm | |
| Warner Losh | May 31, 2011 9:23 am | |
| Arnaud Lacombe | Jun 6, 2011 2:37 pm | |
| Arnaud Lacombe | Jun 25, 2011 11:00 am | |
| Arnaud Lacombe | Jul 8, 2011 2:16 pm | |
| Arnaud Lacombe | Sep 14, 2011 8:23 pm | |
| Garrett Cooper | Nov 16, 2011 10:43 am |
| Subject: | Re: Include file search path | |
|---|---|---|
| From: | John Baldwin (jh...@freebsd.org) | |
| Date: | Mar 30, 2011 4:59:48 am | |
| List: | org.freebsd.freebsd-hackers | |
On Tuesday, March 29, 2011 5:20:30 pm md...@freebsd.org wrote:
I thought I knew something about how the compiler looks for include files, but now I think maybe I don't know much. :-)
So here's what I'm pondering. When I build a library, like e.g. libc, where do the include files get pulled from? They can't (shouldn't) be the ones in /usr/include, but I don't see a -nostdinc like for the kernel. There are -I directives in the Makefile for -I${.CURDIR}/include -I${.CURDIR}/../../include, etc., but that won't remove /usr/include from the search path.
I see in the gcc documentation that -I paths are searched before the standards paths. But isn't the lack of -nostdinc a bug (not just for libc, but for any library in /usr/src/lib)? It somewhat feels to me that all of the libraries and binaries in the source distribution should use -nostdinc and include only from the source distribution itself. This isn't always an issue, but for source upgrades it seems crucial, and for a hacker it saves difficulties with having to install headers before re-building.
Is that the intent, and it's not fully implemented? How badly would things break if -nostdinc was included in e.g. bsd.lib.mk? (This would break non-base libraries, yes? But as a thought experiment for the base, how far off are we?)
If you are building a library by hand you do want to use the includes from /usr/include. I am not sure how we accomplish during buildworld (but we do). I think we actually build the compiler in the cross-tools stage such that it uses the /usr/include directory under {WORLDTMP} in place of /usr/include in the default search path.
Some other folks might be able to verify that (perhaps ru@?).
-- John Baldwin
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "free...@freebsd.org"





