mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-15 08:10:07 +02:00
* enable shared library build to reduce binary size. * add llvm_libs subpackage for libLLVM and libLTO.
75 lines
2.8 KiB
Plaintext
75 lines
2.8 KiB
Plaintext
From b08432486912bafc8e058577cb90271b2117eff1 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Wed, 20 Jan 2016 21:13:28 +0000
|
|
Subject: llvm-config: use /develop/headers instead of /include
|
|
|
|
* don't provide obj-root and src-root.
|
|
|
|
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
|
|
index 25344e4..11901bf 100644
|
|
--- a/tools/llvm-config/llvm-config.cpp
|
|
+++ b/tools/llvm-config/llvm-config.cpp
|
|
@@ -332,9 +332,14 @@ int main(int argc, char **argv) {
|
|
("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
|
|
} else {
|
|
ActivePrefix = CurrentExecPrefix;
|
|
+#ifdef __HAIKU__
|
|
+ ActiveIncludeDir = ActivePrefix + "/develop/headers";
|
|
+ ActiveLibDir = ActivePrefix + "/develop/lib" + LLVM_LIBDIR_SUFFIX;
|
|
+#else
|
|
ActiveIncludeDir = ActivePrefix + "/include";
|
|
- ActiveBinDir = ActivePrefix + "/bin";
|
|
ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
|
|
+#endif
|
|
+ ActiveBinDir = ActivePrefix + "/bin";
|
|
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
|
|
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
|
}
|
|
@@ -554,10 +559,16 @@ int main(int argc, char **argv) {
|
|
OS << (LLVM_HAS_GLOBAL_ISEL ? "ON" : "OFF") << '\n';
|
|
} else if (Arg == "--shared-mode") {
|
|
PrintSharedMode = true;
|
|
- } else if (Arg == "--obj-root") {
|
|
- OS << ActivePrefix << '\n';
|
|
- } else if (Arg == "--src-root") {
|
|
- OS << LLVM_SRC_ROOT << '\n';
|
|
+ } else if (Arg == "--obj-root" || Arg == "--src-root") {
|
|
+ if (IsInDevelopmentTree) {
|
|
+ if (Arg == "--obj-root")
|
|
+ OS << ActivePrefix << '\n';
|
|
+ else
|
|
+ OS << LLVM_SRC_ROOT << '\n';
|
|
+ } else {
|
|
+ llvm::errs() << "llvm-config: sources not installed\n";
|
|
+ exit(1);
|
|
+ }
|
|
} else if (Arg == "--ignore-libllvm") {
|
|
LinkDyLib = false;
|
|
LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto;
|
|
--
|
|
2.12.2
|
|
|
|
|
|
From 4c58933420077f3520c2a9348ad560eddcd676a7 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Tue, 4 Jul 2017 20:41:17 +0200
|
|
Subject: --whole-archive also on Haiku for GNU ld.
|
|
|
|
|
|
diff --git a/tools/llvm-shlib/CMakeLists.txt b/tools/llvm-shlib/CMakeLists.txt
|
|
index edadb82..f96b016 100644
|
|
--- a/tools/llvm-shlib/CMakeLists.txt
|
|
+++ b/tools/llvm-shlib/CMakeLists.txt
|
|
@@ -37,7 +37,7 @@ endif()
|
|
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
|
|
|
|
list(REMOVE_DUPLICATES LIB_NAMES)
|
|
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
|
|
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW OR HAIKU) # FIXME: It should be "GNU ld for elf"
|
|
# GNU ld doesn't resolve symbols in the version script.
|
|
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
|
|
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
|
--
|
|
2.12.2
|
|
|