r309778 - [Driver] Disable static C++ library support on Fuchsia
Petr Hosek via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 1 18:18:02 PDT 2017
Author: phosek
Date: Tue Aug 1 18:18:02 2017
New Revision: 309778
URL: http://llvm.org/viewvc/llvm-project?rev=309778&view=rev
Log:
[Driver] Disable static C++ library support on Fuchsia
Don't support or build static C++ libraries for Fuchsia.
Differential Revision: https://reviews.llvm.org/D36202
Modified:
cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
cfe/trunk/test/Driver/fuchsia.cpp
Modified: cfe/trunk/cmake/caches/Fuchsia-stage2.cmake
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/Fuchsia-stage2.cmake?rev=309778&r1=309777&r2=309778&view=diff
==============================================================================
--- cfe/trunk/cmake/caches/Fuchsia-stage2.cmake (original)
+++ cfe/trunk/cmake/caches/Fuchsia-stage2.cmake Tue Aug 1 18:18:02 2017
@@ -31,6 +31,7 @@ foreach(target x86_64;aarch64)
set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
endforeach()
+
if(NOT APPLE)
list(APPEND LLVM_BUILTIN_TARGETS "default")
endif()
@@ -45,8 +46,10 @@ foreach(target x86_64;aarch64)
set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+ set(RUNTIMES_${target}-fuchsia_LIBCXXABI_ENABLE_STATIC OFF CACHE BOOL "")
set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
+ set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
endforeach()
# Setup toolchain.
Modified: cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp?rev=309778&r1=309777&r2=309778&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Fuchsia.cpp Tue Aug 1 18:18:02 2017
@@ -107,15 +107,8 @@ void fuchsia::Linker::ConstructJob(Compi
CmdArgs.push_back("-Bdynamic");
if (D.CCCIsCXX()) {
- if (ToolChain.ShouldLinkCXXStdlib(Args)) {
- bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) &&
- !Args.hasArg(options::OPT_static);
- if (OnlyLibstdcxxStatic)
- CmdArgs.push_back("-Bstatic");
+ if (ToolChain.ShouldLinkCXXStdlib(Args))
ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
- if (OnlyLibstdcxxStatic)
- CmdArgs.push_back("-Bdynamic");
- }
CmdArgs.push_back("-lm");
}
Modified: cfe/trunk/test/Driver/fuchsia.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fuchsia.cpp?rev=309778&r1=309777&r2=309778&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fuchsia.cpp (original)
+++ cfe/trunk/test/Driver/fuchsia.cpp Tue Aug 1 18:18:02 2017
@@ -28,8 +28,8 @@
// RUN: %clangxx %s -### --target=x86_64-unknown-fuchsia -static-libstdc++ 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
-// CHECK-STATIC: "-Bstatic"
+// CHECK-STATIC-NOT: "-Bstatic"
// CHECK-STATIC: "-lc++" "-lc++abi" "-lunwind"
-// CHECK-STATIC: "-Bdynamic"
+// CHECK-STATIC-NOT: "-Bdynamic"
// CHECK-STATIC: "-lm"
// CHECK-STATIC: "-lc"
More information about the cfe-commits
mailing list