| 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: | Nathan Whitehorn (nwhi...@freebsd.org) | |
| Date: | Mar 30, 2011 8:26:21 am | |
| List: | org.freebsd.freebsd-hackers | |
On 03/30/11 10:23, Dimitry Andric wrote:
On 2011-03-29 23:20, md...@FreeBSD.org wrote:
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.
During the bootstrap stage, a copy of gcc (or clang) is built, that has all default search paths for headers, libraries, etc, set relative to ${WORLDTMP}, usually /usr/obj/usr/src/tmp.
E.g:
$ /usr/obj/usr/src/tmp/usr/bin/gcc -v -E -x c /dev/null -o /dev/null Using built-in specs. Target: amd64-undermydesk-freebsd Configured with: FreeBSD/amd64 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD] /usr/obj/usr/src/tmp/usr/libexec/cc1 -E -quiet -v -D_LONGLONG /dev/null -o /dev/null #include "..." search starts here: #include <...> search starts here: /usr/obj/usr/src/tmp/usr/include/gcc/4.2 /usr/obj/usr/src/tmp/usr/include End of search list.
and:
$ /usr/obj/usr/src/tmp/usr/bin/gcc -print-search-dirs install: /usr/obj/usr/src/tmp/usr/libexec/ programs: =/usr/obj/usr/src/tmp/usr/bin/:/usr/obj/usr/src/tmp/usr/bin/:/usr/obj/usr/src/tmp/usr/libexec/:/usr/obj/usr/src/tmp/usr/libexec/:/usr/obj/usr/src/tmp/usr/libexec/ libraries: =/usr/obj/usr/src/tmp/usr/lib/:/usr/obj/usr/src/tmp/usr/lib/
This is a rather nasty hack, though. If we can make it work, we should probably try using --sysroot instead, or alternatively, -nostdinc and adding include dirs by hand. The same for executable and library search paths, although I am not sure if there is a way to completely reset those with the current options.
Since you need to build two compilers anyway (one for the current system, to build the new one, and one to live in the new one, linked against new libraries), I don't see that it's such a nasty hack. -Nathan
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "free...@freebsd.org"





