From owner-svn-src-head@FreeBSD.ORG Wed Apr 17 06:06:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29334F49 for ; Wed, 17 Apr 2013 06:06:57 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx1.freebsd.org (Postfix) with ESMTP id AE86ED19 for ; Wed, 17 Apr 2013 06:06:56 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id q13so1265132lbi.37 for ; Tue, 16 Apr 2013 23:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=uhqQe3Scbl8WoatEqsl/fKPVLF8UQAAzO+cRhyd3L/4=; b=Zcv7dsfZRS1zDZnQMIa/dY1w+Swln0/zqofnTkTnh8OvpNA52N8doQH2bxxOITgvED cTKjEWP6bwD9IdpreiESQ+pvix38Q7v2/gtIr/+fvYW97XQrAmxBB+fIGxwnTgO3B+B5 saNFEQ35HADxUKf14T321JGVfGtmyzZPPqwoO4xRuQXrQPcQlLOJLaZDMU3u+kLCwxqW hFZjaGgPd779cG8XK6fjYbUYv2TrJg9lBo3OQbaWt8DX0otHezaGdgQX3kssJ9Guo7JK KS9x9L0JLGK4KyBhqbZDtXKnoi9gf9Ffnz61yKvjljEUHxMZgGXElYQXG3fFi8M3K7Lj P/bg== X-Received: by 10.112.61.6 with SMTP id l6mr2827815lbr.57.1366178815229; Tue, 16 Apr 2013 23:06:55 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 16 Apr 2013 23:06:34 -0700 (PDT) In-Reply-To: <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> From: Juli Mallett Date: Tue, 16 Apr 2013 23:06:34 -0700 X-Google-Sender-Auth: P2_tWqfPNmFwukTQGb9eVulKWRU Message-ID: Subject: Re: svn commit: r249484 - head/lib To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnpix6gdUuODHGw87I6iXn7zZcUMIUqhZEkanotINUHg65ZikXBuBxXvTq6Fg7ilvAf37Bw Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:06:57 -0000 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: >>> Author: kientzle >>> Date: Sun Apr 14 19:13:51 2013 >>> New Revision: 249484 >>> URL: http://svnweb.freebsd.org/changeset/base/249484 >>> >>> Log: >>> Install a symlink >>> /usr/lib/include ==> /usr/include >>> >>> This fixes -print-file-name=include in clang (and is >>> arguably a better way to fix the same issue in GCC than >>> the change I made in r231336). >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/lib/Makefile >>> >>> Modified: head/lib/Makefile >>> ============================================================================== >>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) >>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) >>> @@ -252,4 +252,7 @@ _libusbhid= libusbhid >>> _libusb= 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 > >> 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? I just feel more confused by this explanation. Why not just specify -I/usr/include? (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.) /usr/lib/include is just badly and plainly wrong unless it's absolutely, absolutely necessary. > This symlink is the simplest way I've found to reconcile those > assumptions with the FreeBSD directory layout. I'm happy to > consider alternatives. > > Tim >