From owner-svn-src-all@FreeBSD.ORG Sun Aug 22 20:42:55 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61CEA106564A; Sun, 22 Aug 2010 20:42:55 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B0C3C8FC0A; Sun, 22 Aug 2010 20:42:54 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4BE889CB0DB; Sun, 22 Aug 2010 22:23:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DW8ISbQKcKle; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 269439CB43A; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id o7MKNogk031175; Sun, 22 Aug 2010 22:23:50 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 22 Aug 2010 22:23:50 +0200 From: Roman Divacky To: Rui Paulo Message-ID: <20100822202350.GA30039@freebsd.org> References: <201008211546.o7LFkY83073894@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008211546.o7LFkY83073894@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211573 - in head: contrib/llvm/tools/clang/lib/Driver contrib/llvm/tools/clang/lib/Frontend lib/clang X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 22 Aug 2010 20:42:55 -0000 are they interested in this upstream? I think they can be and it would save us some effort on the next merge On Sat, Aug 21, 2010 at 03:46:34PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Sat Aug 21 15:46:33 2010 > New Revision: 211573 > URL: http://svn.freebsd.org/changeset/base/211573 > > Log: > Modify clang so that when TOOLS_PREFIX is defined we register the > CLANG_PREFIX macro. This changes the default header search path when we > are building clang as part of cross-tools. > > Submitted by: Dimitry Andric > Reviewed by: freebsd-current > > Modified: > head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp > head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp > head/lib/clang/clang.build.mk > > Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp > ============================================================================== > --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 15:39:06 2010 (r211572) > +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 15:46:33 2010 (r211573) > @@ -26,6 +26,10 @@ > > #include // ::getenv > > +#ifndef CLANG_PREFIX > +#define CLANG_PREFIX > +#endif > + > using namespace clang::driver; > using namespace clang::driver::toolchains; > > @@ -869,11 +873,9 @@ FreeBSD::FreeBSD(const HostInfo &Host, c > getProgramPaths().push_back(getDriver().Dir + "/../libexec"); > getProgramPaths().push_back("/usr/libexec"); > if (Lib32) { > - getFilePaths().push_back(getDriver().Dir + "/../lib32"); > - getFilePaths().push_back("/usr/lib32"); > + getFilePaths().push_back(CLANG_PREFIX "/usr/lib32"); > } else { > - getFilePaths().push_back(getDriver().Dir + "/../lib"); > - getFilePaths().push_back("/usr/lib"); > + getFilePaths().push_back(CLANG_PREFIX "/usr/lib"); > } > } > > > Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp > ============================================================================== > --- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 21 15:39:06 2010 (r211572) > +++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 21 15:46:33 2010 (r211573) > @@ -30,6 +30,9 @@ > #define WIN32_LEAN_AND_MEAN 1 > #include > #endif > +#ifndef CLANG_PREFIX > +#define CLANG_PREFIX > +#endif > using namespace clang; > using namespace clang::frontend; > > @@ -408,9 +411,10 @@ static bool getWindowsSDKDir(std::string > > void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, > const HeaderSearchOptions &HSOpts) { > -#if 0 /* Remove unneeded include paths. */ > // FIXME: temporary hack: hard-coded paths. > - AddPath("/usr/local/include", System, true, false, false); > +#ifndef __FreeBSD__ > + AddPath(CLANG_PREFIX "/usr/local/include", System, true, false, false); > +#endif > > // Builtin includes use #include_next directives and should be positioned > // just prior C include dirs. > @@ -421,7 +425,6 @@ void InitHeaderSearch::AddDefaultCInclud > P.appendComponent("include"); > AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true); > } > -#endif > > // Add dirs specified via 'configure --with-c-include-dirs'. > llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS); > @@ -518,13 +521,15 @@ void InitHeaderSearch::AddDefaultCInclud > case llvm::Triple::MinGW32: > AddPath("c:/mingw/include", System, true, false, false); > break; > + case llvm::Triple::FreeBSD: > + AddPath(CLANG_PREFIX "/usr/include/clang/" CLANG_VERSION_STRING, > + System, false, false, false); > + break; > default: > break; > } > > - AddPath("/usr/include/clang/" CLANG_VERSION_STRING, > - System, false, false, false); > - AddPath("/usr/include", System, false, false, false); > + AddPath(CLANG_PREFIX "/usr/include", System, false, false, false); > } > > void InitHeaderSearch:: > @@ -726,8 +731,10 @@ AddDefaultCPlusPlusIncludePaths(const ll > case llvm::Triple::FreeBSD: > // FreeBSD 8.0 > // FreeBSD 7.3 > - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); > - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2/backward", "", "", "", triple); > + AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2", > + "", "", "", triple); > + AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2/backward", > + "", "", "", triple); > break; > case llvm::Triple::Minix: > AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3", > > Modified: head/lib/clang/clang.build.mk > ============================================================================== > --- head/lib/clang/clang.build.mk Sat Aug 21 15:39:06 2010 (r211572) > +++ head/lib/clang/clang.build.mk Sat Aug 21 15:46:33 2010 (r211573) > @@ -28,6 +28,10 @@ LLVM_REQUIRES_RTTI= > CFLAGS+=-fno-rtti > .endif > > +.ifdef TOOLS_PREFIX > +CFLAGS+=-DCLANG_PREFIX=\"${TOOLS_PREFIX}\" > +.endif > + > .PATH: ${LLVM_SRCS}/${SRCDIR} > > TBLGEN=tblgen ${CFLAGS:M-I*}