diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2018-01-13 09:00:42 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2018-01-13 09:00:42 +0300 |
commit | 66df4a402d0ea0716f25e9af04105c038cfa39a9 (patch) | |
tree | fc914166e14de865d146b9db87cd6f8f31dbf21b /sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch | |
parent | 8bcc2ededbcb7b67e946fb577b87e4fec5c12791 (diff) |
llvm, clang: missed patches
Diffstat (limited to 'sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch')
-rw-r--r-- | sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch b/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch new file mode 100644 index 0000000..5def55d --- /dev/null +++ b/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch @@ -0,0 +1,54 @@ +From 628b899be14a6bab4b32dbd53aabd447dcc16cb7 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, +- making --src-root return invalid path (/dev/null). + +Thanks to Steven Newbury for the initial patch. + +Bug: https://bugs.gentoo.org/565358 +Bug: https://bugs.gentoo.org/501684 + +diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt +index 744fa4e44d1..593788aaef3 100644 +--- a/tools/llvm-config/CMakeLists.txt ++++ b/tools/llvm-config/CMakeLists.txt +@@ -32,8 +32,12 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS) + 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}) + set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}") +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index d780094861c..c61c72ff48c 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -549,7 +550,11 @@ int main(int argc, char **argv) { + } else if (Arg == "--obj-root") { + 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 if (Arg == "--ignore-libllvm") { + LinkDyLib = false; + LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto; +-- +2.11.0 + |