From 099120d826b9d9bc1a1eec5c7369d22886ebd001 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 18 May 2014 12:44:47 +0200 Subject: [PATCH] clang: fix build * Add soname for libclang and liblto * Force installation path by setting variables for the makefile (configure args are accepted, but ignored) * Several fixes to provides entries. --- sys-devel/clang/clang-3.4.recipe | 24 ++++++++++----- sys-devel/clang/patches/clang-3.4.patchset | 36 +++++++++++++++++----- sys-devel/clang/patches/llvm-3.4.patchset | 32 ++++++++++++++++--- 3 files changed, 72 insertions(+), 20 deletions(-) diff --git a/sys-devel/clang/clang-3.4.recipe b/sys-devel/clang/clang-3.4.recipe index 24fc56b58..ddeac702e 100644 --- a/sys-devel/clang/clang-3.4.recipe +++ b/sys-devel/clang/clang-3.4.recipe @@ -29,13 +29,15 @@ PROVIDES=" cmd:clang = $portVersion cmd:clang++ = $portVersion cmd:c_index_test = $portVersion - lib:libLTO = $portVersion - lib:libclang = $portVersion - lib:libprofile_rt = $portVersion + lib:libLTO$secondaryArchSuffix = $portVersion + lib:libclang$secondaryArchSuffix = $portVersion + devel:libLTO$secondaryArchSuffix = $portVersion + devel:libclang$secondaryArchSuffix = $portVersion " REQUIRES=" haiku$secondaryArchSuffix >= $haikuVersion + lib:libstdc++$secondaryArchSuffix " BUILD_REQUIRES=" @@ -73,15 +75,21 @@ BUILD() # TODO: clang's build system seems to ignore doc / man / shared dirs? runConfigure ./configure --enable-optimized - make $jobArgs + make $jobArgs PROJ_datadir=$dataDir PROJ_docsdir=$docDir \ + PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir } INSTALL() { mkdir -p $developDir mkdir -p $docDir + mkdir -p $binDir - make install-clang + make install-clang PROJ_datadir=$dataDir PROJ_docsdir=$docDir \ + PROJ_mandir=$manDir PROJ_includedir=$includeDir PROJ_libdir=$libDir + + # Remove empty dir that shouldn't be created + rmdir $prefix/include # Install static analysis tools mkdir -p $developDir/tools/clang$secondaryArchSuffix @@ -92,6 +100,8 @@ INSTALL() ln -s $developDir/tools/clang$secondaryArchSuffix/scan-view/scan-view $binDir/scan-view ln -s $binDir/clang $developDir/tools/clang$secondaryArchSuffix/scan-build/clang + prepareInstalledDevelLibs libclang libLTO + # analysis package packageEntries analysis \ $binDir/scan-build \ @@ -110,8 +120,8 @@ TEST() SUMMARY_analysis="Static analysis tools using the clang compiler" PROVIDES_analysis=" clang${secondaryArchSuffix}_analysis = $portVersion - cmd:scan_build = $portVersion - cmd:scan_view = $portVersion + cmd:scan_build$secondaryArchSuffix = $portVersion + cmd:scan_view$secondaryArchSuffix = $portVersion " REQUIRES_analysis=" diff --git a/sys-devel/clang/patches/clang-3.4.patchset b/sys-devel/clang/patches/clang-3.4.patchset index 64545c08a..fe49b7052 100644 --- a/sys-devel/clang/patches/clang-3.4.patchset +++ b/sys-devel/clang/patches/clang-3.4.patchset @@ -1,20 +1,17 @@ -From 33c9dfc71ce4a7cc0a0e5967b9110bcbc3d0a7d7 Mon Sep 17 00:00:00 2001 +From dbc97e44eaeb44908e8e71edd0f6f64f79cfef3e Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 24 Jan 2014 02:22:17 +0000 -Subject: [PATCH] haiku: Fix header search paths +Subject: haiku: Fix header search paths * /boot/develop no longer exists * /boot/common no longer exists * We still need to figure something out for secondary architecture builds. ---- - lib/Frontend/InitHeaderSearch.cpp | 70 +++++++++++++++++++++------------------ - 1 file changed, 38 insertions(+), 32 deletions(-) -diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp +diff --git a/clang-3.4/lib/Frontend/InitHeaderSearch.cpp b/clang-3.4/lib/Frontend/InitHeaderSearch.cpp index d144cbb..e96e329 100644 ---- a/lib/Frontend/InitHeaderSearch.cpp -+++ b/lib/Frontend/InitHeaderSearch.cpp +--- a/clang-3.4/lib/Frontend/InitHeaderSearch.cpp ++++ b/clang-3.4/lib/Frontend/InitHeaderSearch.cpp @@ -272,38 +272,44 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, llvm_unreachable("Include management is handled in the driver."); @@ -95,3 +92,26 @@ index d144cbb..e96e329 100644 -- 1.8.3.4 + +From 67f6c48d61c2350ec3063c373f5c8ad196c456df Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 18 May 2014 12:41:50 +0200 +Subject: libclang: add soname when building on Haiku. + + +diff --git a/clang-3.4/tools/libclang/Makefile b/clang-3.4/tools/libclang/Makefile +index 43ecbd1..837276d 100644 +--- a/clang-3.4/tools/libclang/Makefile ++++ b/clang-3.4/tools/libclang/Makefile +@@ -29,7 +29,7 @@ USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a \ + include $(CLANG_LEVEL)/Makefile + + # Add soname to the library. +-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD)) ++ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD Haiku)) + LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) + endif + +-- +1.8.3.4 + diff --git a/sys-devel/clang/patches/llvm-3.4.patchset b/sys-devel/clang/patches/llvm-3.4.patchset index 9f14d94d8..0f9980987 100644 --- a/sys-devel/clang/patches/llvm-3.4.patchset +++ b/sys-devel/clang/patches/llvm-3.4.patchset @@ -1,11 +1,8 @@ -From 744634aa845c403f5a39b8257bbacd36dc1dd351 Mon Sep 17 00:00:00 2001 +From 9cc674f2aa0f54b900d1e773a6ffd201c23e4c05 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 22 Jan 2014 05:04:31 +0000 -Subject: [PATCH] haiku: fix Host.h for endian.h +Subject: haiku: fix Host.h for endian.h ---- - include/llvm/Support/Host.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/Support/Host.h b/include/llvm/Support/Host.h index 28c4cc7..ab985a4 100644 @@ -23,3 +20,28 @@ index 28c4cc7..ab985a4 100644 -- 1.8.3.4 + +From 577d261e8e74bc442fe75515e043f268db923ed3 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 18 May 2014 12:41:16 +0200 +Subject: libLTO: add soname when building on Haiku. + + +diff --git a/tools/lto/Makefile b/tools/lto/Makefile +index cedbee1..5ce530d 100644 +--- a/tools/lto/Makefile ++++ b/tools/lto/Makefile +@@ -22,6 +22,10 @@ ifdef LLVM_VERSION_INFO + CXX.Flags += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"' + endif + ++ifeq ($(HOST_OS),Haiku) ++ LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-soname=$(SharedPrefix)LTO$(SHLIBEXT) ++endif ++ + ifeq ($(HOST_OS),Darwin) + # Special hack to allow libLTO to have an offset version number. + ifdef LLVM_LTO_VERSION_OFFSET +-- +1.8.3.4 +