public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-devel/llvm/files: llvm-3.4-gentoo-install.patch llvm-3.3-gentoo-install.patch clang-3.3-gentoo-install.patch
@ 2013-07-21 10:00 Michal Gorny (mgorny)
  0 siblings, 0 replies; only message in thread
From: Michal Gorny (mgorny) @ 2013-07-21 10:00 UTC (permalink / raw
  To: gentoo-commits

mgorny      13/07/21 10:00:50

  Added:                llvm-3.4-gentoo-install.patch
                        llvm-3.3-gentoo-install.patch
                        clang-3.3-gentoo-install.patch
  Log:
  Include the improved ebuild from ::mgorny. Integrate clang, introduce multilib support, fix rpath issues. Bug #477432.
  
  (Portage version: 2.2.0_alpha188/cvs/Linux x86_64, signed Manifest commit with key 9627F456F9DA7643!)

Revision  Changes    Path
1.1                  sys-devel/llvm/files/llvm-3.4-gentoo-install.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch?rev=1.1&content-type=text/plain

Index: llvm-3.4-gentoo-install.patch
===================================================================
From be2ee7ba7ab4c1aec86d3d9e49e1be241afd8abd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
Date: Fri, 19 Jul 2013 10:10:52 +0200
Subject: [PATCH 1/2] gentoo install fixes

---
 Makefile.config.in                      | 6 +++---
 Makefile.rules                          | 7 +++----
 tools/gold/Makefile                     | 2 +-
 tools/llvm-config/BuildVariables.inc.in | 2 ++
 tools/llvm-config/Makefile              | 4 ++++
 tools/llvm-config/llvm-config.cpp       | 5 +++--
 utils/FileCheck/Makefile                | 2 +-
 7 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/Makefile.config.in b/Makefile.config.in
index dcca45f..e75ae2e 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
 endif
 
 PROJ_bindir     := $(PROJ_prefix)/bin
-PROJ_libdir     := $(PROJ_prefix)/lib
+PROJ_libdir     := $(PROJ_prefix)/$(GENTOO_LIBDIR)/llvm
 PROJ_datadir    := $(PROJ_prefix)/share
-PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
-PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
+PROJ_docsdir    := $(PROJ_prefix)/share/doc/@PF@
+PROJ_etcdir     := @EPREFIX@/etc/llvm
 PROJ_includedir := $(PROJ_prefix)/include
 PROJ_infodir    := $(PROJ_prefix)/info
 PROJ_mandir     := $(PROJ_prefix)/share/man
diff --git a/Makefile.rules b/Makefile.rules
index 1bc78f1..60cd228 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -277,7 +277,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
   ifneq ($(HOST_OS),FreeBSD)
   ifneq ($(HOST_OS),GNU/kFreeBSD)
   ifneq ($(HOST_OS),Darwin)
-    OmitFramePointer := -fomit-frame-pointer
+    OmitFramePointer :=
   endif
   endif
   endif
@@ -605,7 +605,6 @@ endif
 ifdef SHARED_LIBRARY
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
 ifneq ($(HOST_OS),Darwin)
-  LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
 endif
 endif
 endif
@@ -643,11 +642,11 @@ endif
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
   ifneq ($(HOST_OS), Darwin)
     ifdef TOOLNAME
-      LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' $(DynamicFlag)
+      LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)' $(DynamicFlag)
     endif
   else
     ifneq ($(DARWIN_MAJVERS),4)
-      LD.Flags += $(RPATH) -Wl,@executable_path/../lib
+      LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)'
     endif
     ifeq ($(RC_XBS),YES)
       TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX)
diff --git a/tools/gold/Makefile b/tools/gold/Makefile
index 496e31c..d36b340 100644
--- a/tools/gold/Makefile
+++ b/tools/gold/Makefile
@@ -24,7 +24,7 @@ include $(LEVEL)/Makefile.config
 # Because off_t is used in the public API, the largefile parts are required for
 # ABI compatibility.
 CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-LDFLAGS += -L$(SharedLibDir)/$(SharedPrefix)
+LDFLAGS += -L$(PROJ_libdir)
 
 include $(LEVEL)/Makefile.common
 
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
index fe87afb..fd9f2c6 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
@@ -25,3 +25,5 @@
 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_RPATH "@LLVM_RPATH@"
+#define LLVM_LIBDIR "@LLVM_LIBDIR@"
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index b20b6bf..fc56781 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -55,6 +55,10 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
 	  >> temp.sed
 	$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
 	  >> temp.sed
+	$(Verb) $(ECHO) 's/@LLVM_RPATH@/$(subst /,\/,$(RPATH))/' \
+	  >> temp.sed
+	$(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
+	  >> temp.sed
 	$(Verb) $(SED) -f temp.sed < $< > $@
 	$(Verb) $(RM) temp.sed
 
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 3924e2e..f439c60 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
     ActivePrefix = CurrentExecPrefix;
     ActiveIncludeDir = ActivePrefix + "/include";
     ActiveBinDir = ActivePrefix + "/bin";
-    ActiveLibDir = ActivePrefix + "/lib";
+    ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR "/llvm";
     ActiveIncludeOption = "-I" + ActiveIncludeDir;
   }
 
@@ -277,7 +277,8 @@ int main(int argc, char **argv) {
       } else if (Arg == "--cxxflags") {
         OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
       } else if (Arg == "--ldflags") {
-        OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS
+        OS << "-L" << ActiveLibDir << ' '
+           << LLVM_RPATH << " -Wl," << ActiveLibDir << ' ' << LLVM_LDFLAGS
            << ' ' << LLVM_SYSTEM_LIBS << '\n';
       } else if (Arg == "--libs") {
         PrintLibs = true;
diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
index 268b7bc..e7674f9 100644
--- a/utils/FileCheck/Makefile
+++ b/utils/FileCheck/Makefile
@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
 TOOL_NO_EXPORTS = 1
 
 # Don't install this utility
-NO_INSTALL = 1
+#NO_INSTALL = 1
 
 include $(LEVEL)/Makefile.common
 
-- 
1.8.3.2




1.1                  sys-devel/llvm/files/llvm-3.3-gentoo-install.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.3-gentoo-install.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/llvm-3.3-gentoo-install.patch?rev=1.1&content-type=text/plain

Index: llvm-3.3-gentoo-install.patch
===================================================================
From 378109dbae7e4772d9b096384904c638a6a34028 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
Date: Fri, 19 Jul 2013 10:10:52 +0200
Subject: [PATCH 1/2] gentoo install fixes

---
 Makefile.config.in                      | 6 +++---
 Makefile.rules                          | 7 +++----
 tools/gold/Makefile                     | 2 +-
 tools/llvm-config/BuildVariables.inc.in | 2 ++
 tools/llvm-config/Makefile              | 4 ++++
 tools/llvm-config/llvm-config.cpp       | 5 +++--
 utils/FileCheck/Makefile                | 2 +-
 7 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/Makefile.config.in b/Makefile.config.in
index fd4f6ef..5634ecc 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
 endif
 
 PROJ_bindir     := $(PROJ_prefix)/bin
-PROJ_libdir     := $(PROJ_prefix)/lib
+PROJ_libdir     := $(PROJ_prefix)/$(GENTOO_LIBDIR)/llvm
 PROJ_datadir    := $(PROJ_prefix)/share
-PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
-PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
+PROJ_docsdir    := $(PROJ_prefix)/share/doc/@PF@
+PROJ_etcdir     := @EPREFIX@/etc/llvm
 PROJ_includedir := $(PROJ_prefix)/include
 PROJ_infodir    := $(PROJ_prefix)/info
 PROJ_mandir     := $(PROJ_prefix)/share/man
diff --git a/Makefile.rules b/Makefile.rules
index f0c542b..db252f7 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -276,7 +276,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
   # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
   ifneq ($(HOST_OS),FreeBSD)
   ifneq ($(HOST_OS),Darwin)
-    OmitFramePointer := -fomit-frame-pointer
+    OmitFramePointer :=
   endif
   endif
 
@@ -601,7 +601,6 @@ endif
 ifdef SHARED_LIBRARY
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
 ifneq ($(HOST_OS),Darwin)
-  LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
 endif
 endif
 endif
@@ -639,7 +638,7 @@ endif
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
   ifneq ($(HOST_OS), Darwin)
     ifdef TOOLNAME
-      LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
+      LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)'
       ifdef EXAMPLE_TOOL
         LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
       else
@@ -648,7 +647,7 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
   endif
 else
   ifneq ($(DARWIN_MAJVERS),4)
-    LD.Flags += $(RPATH) -Wl,@executable_path/../lib
+    LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)'
   endif
   ifeq ($(RC_XBS),YES)
     TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX)
diff --git a/tools/gold/Makefile b/tools/gold/Makefile
index 496e31c..d36b340 100644
--- a/tools/gold/Makefile
+++ b/tools/gold/Makefile
@@ -24,7 +24,7 @@ include $(LEVEL)/Makefile.config
 # Because off_t is used in the public API, the largefile parts are required for
 # ABI compatibility.
 CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-LDFLAGS += -L$(SharedLibDir)/$(SharedPrefix)
+LDFLAGS += -L$(PROJ_libdir)
 
 include $(LEVEL)/Makefile.common
 
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
index fe87afb..fd9f2c6 100644
--- a/tools/llvm-config/BuildVariables.inc.in
+++ b/tools/llvm-config/BuildVariables.inc.in
@@ -25,3 +25,5 @@
 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_RPATH "@LLVM_RPATH@"
+#define LLVM_LIBDIR "@LLVM_LIBDIR@"
diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
index b20b6bf..fc56781 100644
--- a/tools/llvm-config/Makefile
+++ b/tools/llvm-config/Makefile
@@ -55,6 +55,10 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
 	  >> temp.sed
 	$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
 	  >> temp.sed
+	$(Verb) $(ECHO) 's/@LLVM_RPATH@/$(subst /,\/,$(RPATH))/' \
+	  >> temp.sed
+	$(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
+	  >> temp.sed
 	$(Verb) $(SED) -f temp.sed < $< > $@
 	$(Verb) $(RM) temp.sed
 
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 7edf5ec..4541c28 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
     ActivePrefix = CurrentExecPrefix;
     ActiveIncludeDir = ActivePrefix + "/include";
     ActiveBinDir = ActivePrefix + "/bin";
-    ActiveLibDir = ActivePrefix + "/lib";
+    ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR "/llvm";
     ActiveIncludeOption = "-I" + ActiveIncludeDir;
   }
 
@@ -277,7 +277,8 @@ int main(int argc, char **argv) {
       } else if (Arg == "--cxxflags") {
         OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
       } else if (Arg == "--ldflags") {
-        OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS
+        OS << "-L" << ActiveLibDir << ' '
+           << LLVM_RPATH << " -Wl," << ActiveLibDir << ' ' << LLVM_LDFLAGS
            << ' ' << LLVM_SYSTEM_LIBS << '\n';
       } else if (Arg == "--libs") {
         PrintLibs = true;
diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile
index 268b7bc..e7674f9 100644
--- a/utils/FileCheck/Makefile
+++ b/utils/FileCheck/Makefile
@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a
 TOOL_NO_EXPORTS = 1
 
 # Don't install this utility
-NO_INSTALL = 1
+#NO_INSTALL = 1
 
 include $(LEVEL)/Makefile.common
 
-- 
1.8.3.2




1.1                  sys-devel/llvm/files/clang-3.3-gentoo-install.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/clang-3.3-gentoo-install.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/llvm/files/clang-3.3-gentoo-install.patch?rev=1.1&content-type=text/plain

Index: clang-3.3-gentoo-install.patch
===================================================================
From 1a539a8868070e49966c6b5f5e4b9f1257acd7dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
Date: Fri, 19 Jul 2013 10:23:57 +0200
Subject: [PATCH] clang gentoo install

---
 tools/clang/lib/Driver/Tools.cpp        | 4 ++--
 tools/clang/tools/scan-build/scan-build | 4 ++--
 tools/clang/tools/scan-view/scan-view   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
index e014980..6e60513 100644
--- a/tools/clang/lib/Driver/Tools.cpp
+++ b/tools/clang/lib/Driver/Tools.cpp
@@ -219,7 +219,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args,
   // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is
   // not supported by old linkers.
   std::string ProfileRT =
-    std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a";
+    std::string(TC.getDriver().Dir) + "/../@libdir@/llvm/libprofile_rt.a";
 
   CmdArgs.push_back(Args.MakeArgString(ProfileRT));
 }
@@ -6177,7 +6177,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
   // forward.
   if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) {
     CmdArgs.push_back("-plugin");
-    std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
+    std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/llvm/LLVMgold.so";
     CmdArgs.push_back(Args.MakeArgString(Plugin));
 
     // Try to pass driver level flags relevant to LTO code generation down to
diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
index 22d5289..dcb4822 100755
--- a/tools/clang/tools/scan-build/scan-build
+++ b/tools/clang/tools/scan-build/scan-build
@@ -410,7 +410,7 @@ sub CopyFiles {
 
   my $Dir = shift;
 
-  my $JS = Cwd::realpath("$RealBin/sorttable.js");
+  my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
   
   DieDiag("Cannot find 'sorttable.js'.\n")
     if (! -r $JS);  
@@ -420,7 +420,7 @@ sub CopyFiles {
   DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
     if (! -r "$Dir/sorttable.js");
     
-  my $CSS = Cwd::realpath("$RealBin/scanview.css");
+  my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
   
   DieDiag("Cannot find 'scanview.css'.\n")
     if (! -r $CSS);
diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
index fb27da6..1f8ddb8 100755
--- a/tools/clang/tools/scan-view/scan-view
+++ b/tools/clang/tools/scan-view/scan-view
@@ -54,7 +54,7 @@ def start_browser(port, options):
     webbrowser.open(url)
 
 def run(port, options, root):
-    import ScanView
+    from clang import ScanView
     try:
         print 'Starting scan-view at: http://%s:%d'%(options.host,
                                                      port)
-- 
1.8.3.2






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-21 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-21 10:00 [gentoo-commits] gentoo-x86 commit in sys-devel/llvm/files: llvm-3.4-gentoo-install.patch llvm-3.3-gentoo-install.patch clang-3.3-gentoo-install.patch Michal Gorny (mgorny)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox