From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 12:05:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CDD4F8FC; Wed, 17 Apr 2013 12:05:45 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 552632F8; Wed, 17 Apr 2013 12:05:43 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwGABuPblFR8npE/2dsb2JhbABGCoMGNsEMgQQXdIIfAQEEAVYeBQULCxgJFg8JAwIBAgEnHgYNAQcBAReHcwq9P41egTwHCYM9A49VgSmXHIMNOg Received: from 68.122-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.122.68]) by relay.skynet.be with ESMTP; 17 Apr 2013 14:05:36 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.6/8.14.6) with ESMTP id r3HC5ZZ1044288; Wed, 17 Apr 2013 14:05:35 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Message-ID: <516E900B.9090300@FreeBSD.org> Date: Wed, 17 Apr 2013 14:05:31 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tim Kientzle Subject: Re: svn commit: r249484 - head/lib References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> In-Reply-To: <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2MJRKOHIWUDIFGFPCMTRT" Cc: src-committers@FreeBSD.org, Juli Mallett , svn-src-all@FreeBSD.org, Dimitry Andric , Brooks Davis , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 12:05:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2MJRKOHIWUDIFGFPCMTRT Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-04-17 08:26, Tim Kientzle wrote: > On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >> On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: >>> On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: >>>> On 2013-04-14 21:13, Tim Kientzle wrote: >>>>> Modified: head/lib/Makefile >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r2494= 83) >>>>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r2494= 84) >>>>> @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid >>>>> _libusb=3D libusb >>>>> .endif >>>>> >>>>> +afterinstall: >>>>> + ln -fs ../include ${DESTDIR}/usr/lib/include >>>>> + >>>>> .include >>>> >>>> This breaks with -DNO_CLEAN defined, because then >>>> ${DESTDIR}/usr/lib/include/include is created. >>> >>> That's a good point. Would this work better? >>> >>> afterinstall: >>> if [ ! -e $(DESTDIR)/usr/lib/include ]; then >>> ln -fs ../include $(DESTDIR)/usr/lib/include >>> fi Maybe just: ln -fs ../include $(DESTDIR)/usr/lib/ >>>> I'm not that fond of this patch by the way, but I don't fully >>>> understand the problem it's trying to solve so I won't object. >>>> It just looks too much like a hack to me >>> >>> It's a subtle issue and I'm not surprised that it raised some >>> eyebrows. I spent a long time looking for a better solution. >>> >>> In short, both GCC and Clang make some assumptions >>> about the layout of headers used for freestanding compiles. >>> (My earlier commit said these assumptions were "undocumented", >>> but that's not quite true, they're just rather obscure.) >> >> If you're doing a freestanding compile...shouldn't you also be >> specifying both include and library paths explicitly? >=20 > Yes, of course. But the correct directories to use vary somewhat > across platforms, so we would like to have some reasonably > portable way to find the right directory to use for building on > a particular system. >=20 > Both gcc and clang support a -print-file-name=3Dinclude option which > is supposed to print out the directory containing headers used > for freestanding compiles. You can then take that path and > use it as the explicit include directory path for freestanding builds. > >> (Or even better, if you're doing a freestanding >> compile, but want the default include paths, get the compiler to dump >> the default include paths and process that.) >=20 > That's precisely what this is for. I've been working with U-Boot > sources which compile on many systems and use > -print-file-name=3Dinclude to identify the directory containing > the basic freestanding header files. So you compile with -ffreestanding -nostdinc? And then add the include path returned by -print-file-name=3Dinclude? > The -print-file-name=3Dinclude 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 - ) # include_next #else =2E.. #endif In the lang/clang port files/patch-tools_clang_lib_Headers_Makefile should be removed I think. It prevents too many useful headers from being installed (e.g. avxintrin.h) ------enig2MJRKOHIWUDIFGFPCMTRT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlFukA8ACgkQfoCS2CCgtivnDwEAhwB1rOo6vWCU19JorragUE4f l6JggnJGtDZWi5TAccoA/ioO41XLsdwEHl/E5gCrSFA26rrqWjXAcwpkkjbGjtdz =L+uL -----END PGP SIGNATURE----- ------enig2MJRKOHIWUDIFGFPCMTRT--