diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-08-21 20:34:41 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-08-21 20:50:44 +0200 |
commit | bf383aa2d04fcd952e797cb872eb08096061c307 (patch) | |
tree | 1c2f10f652dde6362be03e05ad2a23d7cc821177 /sys-devel | |
parent | dev-python/flask-restless: update HOMEPAGE (diff) | |
download | gentoo-bf383aa2d04fcd952e797cb872eb08096061c307.tar.gz gentoo-bf383aa2d04fcd952e797cb872eb08096061c307.tar.bz2 gentoo-bf383aa2d04fcd952e797cb872eb08096061c307.zip |
sys-devel/llvm: Improve llvm-config upstream compatibility, #591690
Improve the llvm-config installed by 3.8.1-r1 (masked) and the live
ebuild to match upstream behavior better, and be more compatible with
packages. Restore --obj-root to return prefix on installed package, and
make --src-root return invalid /dev/null path instead of failing.
Bug: https://bugs.gentoo.org/591690
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch | 73 | ||||
-rw-r--r-- | sys-devel/llvm/files/llvm-3.9-llvm-config.patch | 51 | ||||
-rw-r--r-- | sys-devel/llvm/llvm-3.8.1-r1.ebuild | 2 |
3 files changed, 99 insertions, 27 deletions
diff --git a/sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch b/sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch new file mode 100644 index 000000000000..38505f15b09a --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.8-llvm-config-r1.patch @@ -0,0 +1,73 @@ +From 7422ff662be0daeb3931fde397f1fed8ff86c50d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 20 Aug 2016 23:47:41 +0200 +Subject: [PATCH] llvm-config: Clean up exported values, update for shared + linking + +Gentoo-specific fixup for llvm-config, including: +- wiping build-specific CFLAGS, CXXFLAGS, +- updating library suffixes for shared libs, +- wiping --system-libs for shared linking, +- making --src-root return invalid path (/dev/null), +- making --build-mode return "Release" rather than "Gentoo". + +Thanks to Steven Newbury for the initial patch. + +Bug: https://bugs.gentoo.org/565358 +Bug: https://bugs.gentoo.org/501684 +--- + tools/llvm-config/CMakeLists.txt | 11 ++++++++--- + tools/llvm-config/llvm-config.cpp | 9 +++++++-- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt +index 83794bb..eba6f45 100644 +--- a/tools/llvm-config/CMakeLists.txt ++++ b/tools/llvm-config/CMakeLists.txt +@@ -23,6 +23,10 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR}) + set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR}) + set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") +-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") +-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}") ++# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler ++# specific flags will be set when we don't know what compiler will be used ++# with external project utilising llvm-config. C++ Standard is required. ++# TODO: figure out if we can remove -std=c++11 and move it to revdeps. ++set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") ++set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") + set(LLVM_BUILD_SYSTEM cmake) + set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) +@@ -31,5 +35,6 @@ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) + set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") + set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) +-set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) ++# We don't do static libs, so we don't need to supply any system-libs ++set(LLVM_SYSTEM_LIBS "") + if(BUILD_SHARED_LIBS) + set(LLVM_ENABLE_SHARED ON) +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 80f6279..309c5dc 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -485,5 +485,6 @@ int main(int argc, char **argv) { + OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n'; + } else if (Arg == "--build-mode") { +- OS << build_mode << '\n'; ++ // force Release since we force non-standard Gentoo build mode ++ OS << "Release" << '\n'; + } else if (Arg == "--assertion-mode") { + #if defined(NDEBUG) +@@ -501,5 +502,9 @@ int main(int argc, char **argv) { + OS << ActivePrefix << '\n'; + } else if (Arg == "--src-root") { +- OS << LLVM_SRC_ROOT << '\n'; ++ if (IsInDevelopmentTree) { ++ OS << LLVM_SRC_ROOT << '\n'; ++ } else { ++ OS << "/dev/null\n"; ++ } + } else { + usage(); +-- +2.9.3 + diff --git a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch index d4363ad8bfce..a1b0be92d337 100644 --- a/sys-devel/llvm/files/llvm-3.9-llvm-config.patch +++ b/sys-devel/llvm/files/llvm-3.9-llvm-config.patch @@ -1,14 +1,14 @@ -From af798c5a6e4b2c6c98cce89b5d6fc8d33f9345cf Mon Sep 17 00:00:00 2001 +From 93133d777fd4c9d5e0f0cc563927f303f9527159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Wed, 2 Dec 2015 16:04:56 +0100 -Subject: [PATCH 1/2] llvm-config: Clean up exported values, update for shared +Date: Sat, 20 Aug 2016 23:47:41 +0200 +Subject: [PATCH] llvm-config: Clean up exported values, update for shared linking Gentoo-specific fixup for llvm-config, including: - wiping build-specific CFLAGS, CXXFLAGS, - updating library suffixes for shared libs, - wiping --system-libs for shared linking, -- banning --obj-root and --src-root due to no sources installed, +- making --obj-root and --src-root return invalid path (/dev/null), - making --build-mode return "Release" rather than "Gentoo". Thanks to Steven Newbury for the initial patch. @@ -17,14 +17,15 @@ Bug: https://bugs.gentoo.org/565358 Bug: https://bugs.gentoo.org/501684 --- tools/llvm-config/CMakeLists.txt | 11 ++++++++--- - tools/llvm-config/llvm-config.cpp | 20 +++++++++++++++----- - 2 files changed, 23 insertions(+), 8 deletions(-) + tools/llvm-config/llvm-config.cpp | 15 ++++++++++++--- + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt -index 32d0f4c..6e99832 100644 +index 744fa4e..593788a 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt -@@ -29,2 +29,6 @@ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_ +@@ -34,4 +34,8 @@ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR}) + set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}") +# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler @@ -33,36 +34,34 @@ index 32d0f4c..6e99832 100644 +# TODO: figure out if we can remove -std=c++11 and move it to revdeps. +set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") +set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -@@ -39 +43,2 @@ set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) + set(LLVM_BUILD_SYSTEM cmake) +@@ -48,3 +52,4 @@ set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") + set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE}) -set(LLVM_SYSTEM_LIBS ${SYSTEM_LIBS}) +# We don't do static libs, so we don't need to supply any system-libs +set(LLVM_SYSTEM_LIBS "") + if(BUILD_SHARED_LIBS) diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 94d426b..fb1bdfa 100644 +index c63733f..ead11b9 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp -@@ -525 +525,2 @@ int main(int argc, char **argv) { +@@ -524,3 +524,4 @@ int main(int argc, char **argv) { + } else if (Arg == "--build-mode") { - OS << build_mode << '\n'; + // force Release since we force non-standard Gentoo build mode + OS << "Release" << '\n'; -@@ -540,4 +541,13 @@ int main(int argc, char **argv) { -- } else if (Arg == "--obj-root") { -- OS << ActivePrefix << '\n'; -- } else if (Arg == "--src-root") { + } else if (Arg == "--assertion-mode") { +@@ -540,5 +540,9 @@ int main(int argc, char **argv) { + } 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'; -+ } ++ OS << LLVM_SRC_ROOT << '\n'; + } else { -+ // sources are not installed -+ llvm::errs() << "llvm-config: sources not installed, " -+ << Arg << " not available\n"; -+ exit(1); ++ OS << "/dev/null\n"; + } + } else if (Arg == "--link-shared") { -- -2.7.4 +2.9.3 diff --git a/sys-devel/llvm/llvm-3.8.1-r1.ebuild b/sys-devel/llvm/llvm-3.8.1-r1.ebuild index 802911c07d89..c2e88d97e1f7 100644 --- a/sys-devel/llvm/llvm-3.8.1-r1.ebuild +++ b/sys-devel/llvm/llvm-3.8.1-r1.ebuild @@ -164,7 +164,7 @@ src_prepare() { # Fix llvm-config for shared linking and sane flags # https://bugs.gentoo.org/show_bug.cgi?id=565358 - eapply "${FILESDIR}"/llvm-3.8-llvm-config.patch + eapply "${FILESDIR}"/llvm-3.8-llvm-config-r1.patch # Restore SOVERSIONs for shared libraries # https://bugs.gentoo.org/show_bug.cgi?id=578392 |