From owner-svn-src-head@FreeBSD.ORG Wed Apr 17 07:12:40 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 2D1D2981 for ; Wed, 17 Apr 2013 07:12:38 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1.freebsd.org (Postfix) with ESMTP id 2957DFCF for ; Wed, 17 Apr 2013 07:12:37 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id x11so1310186lbi.15 for ; Wed, 17 Apr 2013 00:12:31 -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=pCCpcaet8DJKgGEyxJNMRmvcu07Izj+cO0TIUHOljPM=; b=pCjO2Y+ESzp2CO9LMXrmUsgXfjSaMn74VuCbG0qj5gPg6bsmS81OWs58wcRN/bQ2XT PJE3WsfxjNzZyt6Y6iX18uuXbr+83bjq92E2tFnTMp9J0xTl8VJU/805Khf4z83XVIvY bv298vI6BSlxVMwJqgNCS+jBNuOOhqrdeSaernst97hRx28m4kXwQfhopVcRaTn+94Mm 8GUOOULR6cGABJkfN3Q3nG51unDmk62n+BJLNMFGxH4dwbft9xl4Eet1wZHgdcrMn2v4 f93J2DZbcFIbEDZ1MykM0Gwcimy6mjhcIOLxyNl7Gss32PPC/UwvOvS2spTjM/O/P2sY JDVQ== X-Received: by 10.112.61.6 with SMTP id l6mr2931088lbr.57.1366182750843; Wed, 17 Apr 2013 00:12:30 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Wed, 17 Apr 2013 00:12:09 -0700 (PDT) In-Reply-To: <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> From: Juli Mallett Date: Wed, 17 Apr 2013 00:12:09 -0700 X-Google-Sender-Auth: KmWgIraiG5fMn9H-95_DiqmEZNI Message-ID: Subject: Re: svn commit: r249484 - head/lib To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkatcOzNSQWrp2idbE2130A97zUGO9WJAwvL9mCg+exWs7GG10tc7s1RkNhWve0PKC0DeMc 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 07:12:40 -0000 On Tue, Apr 16, 2013 at 11:26 PM, Tim Kientzle wrote: > > On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >> If you're doing a freestanding compile...shouldn't you also be >> specifying both include and library paths explicitly? > > 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. > > Both gcc and clang support a -print-file-name=include 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. Right... >> (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.) > > 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=include to identify the directory containing > the basic freestanding header files. > > 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. I'm confused as to how it wasn't working, and am not convinced that it shouldn't be fixed otherwise. It seems like for clang the user ought to get /usr/include/clang/{version}, except for the problem that we don't put some headers there that some software might expect; so maybe we should just install copies of things like stddef.h into the compiler-specific directory as well? I'm not sure I'm fully understanding your needs, or what you're seeing in practice. Certainly none of those systems have a /usr/lib/include AFAIK; this seems like we're just not deploying our compilers configured in the way that some software (perhaps rightly) expects. And -print-file-name=include doesn't give you the full search path; shouldn't it just give the compiler-specific include directory? You really want something like: % clang -E -Xpreprocessor -v -x c /dev/null For C, and -x c++ for C++. What are the headers you are expecting to find? stddef.h, stdbool.h, stdarg.h? I think I'd rather just see those installed in the compiler-specific dirs, and if we're not spitting those out with our stock-built compilers, we should fix that to match behaviour on other systems. Other systems' -print-file-name=include doesn't expose all of /usr/include, as far as I can tell. That seem excessive and wrong for a freestanding build.