svn commit: r249484 - head/lib

Tijl Coosemans tijl at FreeBSD.org
Wed Apr 17 19:39:07 UTC 2013


On 2013-04-17 19:33, Dimitry Andric wrote:
> On Apr 17, 2013, at 17:58, Tim Kientzle <kientzle at freebsd.org> wrote:
>> On Apr 17, 2013, at 5:05 AM, Tijl Coosemans wrote:
>>> So you compile with -ffreestanding -nostdinc?
>>> And then add the include path returned by -print-file-name=include?
>>
>> That's what the U-Boot sources do, yes.
> 
> Why would U-Boot want to build for a freestanding environment, then
> include standard headers?  Isn't that a bit backwards? :-)

There's a list of headers in the standard that freestanding
programs are allowed to include. If they drop -nostdinc it
should build on FreeBSD. I suppose they use it to prevent
accidental use of non-freestanding stuff in the headers.

>>>> The -print-file-name=include option works on Linux, works
>>>> on MacOS, and --- with this one symlink --- can work on
>>>> FreeBSD as well.  I've been using it to cross-build U-Boot
>>>> using the FreeBSD xdev toolchain with both GCC and Clang.
>>>
>>> "clang -E -v - </dev/null" shows it passes "-resource-dir
>>> /usr/bin/../lib/clang/3.3" to cc1 stage which then complains about
>>> nonexistent directory "/usr/bin/../lib/clang/3.3/include".
>>>
>>> So how about moving /usr/include/clang/3.3 to
>>> /usr/lib/clang/3.3/include? That seems to be the location clang
>>> expects and what lang/clang port uses (in /usr/local).
>>
>> I would certainly like to see that.  I presumed that there
>> was some reason this wasn't done in the initial import.
> 
> Probably because headers belong under /usr/include, not in a library
> directory?  I do not really agree with upstream's decision to place
> their internal headers in that location.  Third-party software depending
> on their exact location is just a little braindead IMHO.

It doesn't really depend on the exact location. It relies on
-print-file-name=include to return the location which our clang
doesn't.

I agree that headers don't belong under lib/, but that's something
to discuss upstream. FreeBSD doing little things like this
differently than everybody else just makes it harder to use imho.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130417/0b010f6c/attachment.sig>


More information about the svn-src-head mailing list