-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLVM] Error building on macOS 11.3 #3383
Comments
Issue is this failing test
|
Unfortunately I don't have macOS 11 yet, and on my machine it doesn't reproduce (macOS 10.15). The symbol it doesn't find is supposed to be defined in Also we did recently change our build process to use CMake+Ninja instead of GNU make for building: 836d28b |
I've never even seen |
I hacked a fix by just removing On ec3ea38: From 396230dead7c871659a9943ad8ececa8a6aed26d Mon Sep 17 00:00:00 2001
From: Chris Seaton <chris.seaton@shopify.com>
Date: Thu, 29 Apr 2021 23:44:25 +0100
Subject: [PATCH] FIX
---
sulong/mx.sulong/suite.py | 43 -------------------
.../CMakeLists.txt | 7 ---
2 files changed, 50 deletions(-)
diff --git a/sulong/mx.sulong/suite.py b/sulong/mx.sulong/suite.py
index 820bceaefab..826975d4cdd 100644
--- a/sulong/mx.sulong/suite.py
+++ b/sulong/mx.sulong/suite.py
@@ -628,12 +628,10 @@ suite = {
"vpath" : True,
"ninja_targets" : [
"<lib:sulong>",
- "<lib:sulong++>",
],
"ninja_install_targets" : ["install"],
"results" : [
"bin/<lib:sulong>",
- "bin/<lib:sulong++>",
],
"buildDependencies" : [
"sdk:LLVM_TOOLCHAIN",
@@ -725,45 +723,6 @@ suite = {
},
"license" : "BSD-new",
},
- "com.oracle.truffle.llvm.libraries.bitcode.libcxx" : {
- "subDir" : "projects",
- "vpath" : True,
- "sourceDir" : "<path:sdk:LLVM_ORG_SRC>/llvm",
- "class" : "CMakeNinjaProject",
- # NinjaBuildTask uses only 1 job otherwise
- "max_jobs" : "8",
- "ninja_targets" : ["<lib:c++abi>", "<lib:c++>"],
- "ninja_install_targets" : ["install-libcxxabi", "install-libcxx"],
- "results" : ["native"],
- "cmakeConfig" : {
- "LLVM_ENABLE_PROJECTS" : "libcxx;libcxxabi",
- "LLVM_INCLUDE_DOCS" : "NO",
- "LLVM_INCLUDE_BENCHMARKS": "NO",
- "LLVM_TARGETS_TO_BUILD" : "X86",
- "LIBCXXABI_INCLUDE_TESTS": "NO",
- "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX" : "YES",
- "LIBCXXABI_LIBCXX_INCLUDES" : "<path:sdk:LLVM_ORG_SRC>/libcxx/include",
- "LIBCXXABI_LIBCXX_PATH" : "<path:sdk:LLVM_ORG_SRC>/libcxx",
- "LIBCXXABI_ENABLE_STATIC" : "NO",
- "LIBCXX_INCLUDE_BENCHMARKS": "NO",
- "LIBCXX_INCLUDE_TESTS": "NO",
- # using "default" will choose the in-tree version libc++abi and add a build dependency
- # from libc++ to libc++abi
- "LIBCXX_CXX_ABI" : "default",
- "LIBCXX_ENABLE_STATIC" : "NO",
- "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY" : "NO",
- "CMAKE_C_COMPILER" : "<path:SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME>/bin/clang",
- "CMAKE_CXX_COMPILER" : "<path:SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME>/bin/clang++",
- "CMAKE_INSTALL_PREFIX" : "native",
- },
- "buildDependencies" : [
- "sdk:LLVM_ORG_SRC",
- "SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME",
- "sdk:LLVM_TOOLCHAIN",
- "NATIVE_MODE_SUPPORT",
- ],
- "clangFormat" : False,
- },
"com.oracle.truffle.llvm.tests.cmake" : {
"description" : "Common CMake files",
@@ -1430,11 +1389,9 @@ suite = {
"platformDependent" : True,
"layout" : {
"./": [
- "dependency:com.oracle.truffle.llvm.libraries.bitcode.libcxx/*",
],
"./native/lib/" : [
"dependency:com.oracle.truffle.llvm.libraries.bitcode/bin/<lib:sulong>",
- "dependency:com.oracle.truffle.llvm.libraries.bitcode/bin/<lib:sulong++>",
"dependency:com.oracle.truffle.llvm.libraries.native/bin/*",
"dependency:com.oracle.truffle.llvm.libraries.graalvm.llvm.libs/bin/*",
],
diff --git a/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt b/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
index b59a2f8d82c..3266669d437 100644
--- a/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
+++ b/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
@@ -86,10 +86,3 @@ add_library(sulong SHARED
target_include_directories(sulong PRIVATE ${GRAALVM_LLVM_INCLUDE_DIR})
target_link_options(sulong PRIVATE -nostdlib)
install(TARGETS sulong DESTINATION bin)
-
-add_library(sulong++ SHARED libsulongxx/exception_support.cpp)
-target_include_directories(sulong++ PRIVATE ${LIBCXX_SRC}/libcxx/src ${LIBCXX_SRC}/libcxxabi/src)
-target_compile_definitions(sulong++ PRIVATE LIBCXXABI_SILENT_TERMINATE)
-target_compile_options(sulong++ PRIVATE -std=c++11 -stdlib=libc++ -Wno-undefined-internal)
-target_link_options(sulong++ PRIVATE -stdlib=libc++ -Wno-undefined-internal)
-install(TARGETS sulong++ DESTINATION bin)
--
2.31.1
On 7b97b5c for TruffleRuby: From 8c0dc93e3ae4ae8497d40e543a47361c7c04556e Mon Sep 17 00:00:00 2001
From: Chris Seaton <chris.seaton@shopify.com>
Date: Thu, 29 Apr 2021 23:44:25 +0100
Subject: [PATCH] FIX
---
sulong/mx.sulong/suite.py | 42 -------------------
.../CMakeLists.txt | 7 ----
2 files changed, 49 deletions(-)
diff --git a/sulong/mx.sulong/suite.py b/sulong/mx.sulong/suite.py
index 31e864fa041..32b5c96b13e 100644
--- a/sulong/mx.sulong/suite.py
+++ b/sulong/mx.sulong/suite.py
@@ -619,12 +619,10 @@ suite = {
"vpath" : True,
"ninja_targets" : [
"<lib:sulong>",
- "<lib:sulong++>",
],
"ninja_install_targets" : ["install"],
"results" : [
"bin/<lib:sulong>",
- "bin/<lib:sulong++>",
],
"buildDependencies" : [
"sdk:LLVM_TOOLCHAIN",
@@ -716,44 +714,6 @@ suite = {
},
"license" : "BSD-new",
},
- "com.oracle.truffle.llvm.libraries.bitcode.libcxx" : {
- "subDir" : "projects",
- "vpath" : True,
- "sourceDir" : "<path:sdk:LLVM_ORG_SRC>/llvm",
- "class" : "CMakeNinjaProject",
- # NinjaBuildTask uses only 1 job otherwise
- "max_jobs" : "8",
- "ninja_targets" : ["<lib:c++abi>", "<lib:c++>"],
- "ninja_install_targets" : ["install-libcxxabi", "install-libcxx"],
- "results" : ["native"],
- "cmakeConfig" : {
- "LLVM_ENABLE_PROJECTS" : "libcxx;libcxxabi",
- "LLVM_INCLUDE_DOCS" : "NO",
- "LLVM_TARGETS_TO_BUILD" : "X86",
- "LIBCXXABI_INCLUDE_TESTS": "NO",
- "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX" : "YES",
- "LIBCXXABI_LIBCXX_INCLUDES" : "<path:sdk:LLVM_ORG_SRC>/libcxx/include",
- "LIBCXXABI_LIBCXX_PATH" : "<path:sdk:LLVM_ORG_SRC>/libcxx",
- "LIBCXXABI_ENABLE_STATIC" : "NO",
- "LIBCXX_INCLUDE_BENCHMARKS": "NO",
- "LIBCXX_INCLUDE_TESTS": "NO",
- # using "default" will choose the in-tree version libc++abi and add a build dependency
- # from libc++ to libc++abi
- "LIBCXX_CXX_ABI" : "default",
- "LIBCXX_ENABLE_STATIC" : "NO",
- "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY" : "NO",
- "CMAKE_C_COMPILER" : "<path:SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME>/bin/clang",
- "CMAKE_CXX_COMPILER" : "<path:SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME>/bin/clang++",
- "CMAKE_INSTALL_PREFIX" : "native",
- },
- "buildDependencies" : [
- "sdk:LLVM_ORG_SRC",
- "SULONG_BOOTSTRAP_TOOLCHAIN_NO_HOME",
- "sdk:LLVM_TOOLCHAIN",
- "NATIVE_MODE_SUPPORT",
- ],
- "clangFormat" : False,
- },
"com.oracle.truffle.llvm.tests.debug.native" : {
"subDir" : "tests",
@@ -1445,11 +1405,9 @@ suite = {
"platformDependent" : True,
"layout" : {
"./": [
- "dependency:com.oracle.truffle.llvm.libraries.bitcode.libcxx/*",
],
"./native/lib/" : [
"dependency:com.oracle.truffle.llvm.libraries.bitcode/bin/<lib:sulong>",
- "dependency:com.oracle.truffle.llvm.libraries.bitcode/bin/<lib:sulong++>",
"dependency:com.oracle.truffle.llvm.libraries.native/bin/*",
"dependency:com.oracle.truffle.llvm.libraries.graalvm.llvm.libs/bin/*",
],
diff --git a/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt b/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
index b59a2f8d82c..3266669d437 100644
--- a/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
+++ b/sulong/projects/com.oracle.truffle.llvm.libraries.bitcode/CMakeLists.txt
@@ -86,10 +86,3 @@ add_library(sulong SHARED
target_include_directories(sulong PRIVATE ${GRAALVM_LLVM_INCLUDE_DIR})
target_link_options(sulong PRIVATE -nostdlib)
install(TARGETS sulong DESTINATION bin)
-
-add_library(sulong++ SHARED libsulongxx/exception_support.cpp)
-target_include_directories(sulong++ PRIVATE ${LIBCXX_SRC}/libcxx/src ${LIBCXX_SRC}/libcxxabi/src)
-target_compile_definitions(sulong++ PRIVATE LIBCXXABI_SILENT_TERMINATE)
-target_compile_options(sulong++ PRIVATE -std=c++11 -stdlib=libc++ -Wno-undefined-internal)
-target_link_options(sulong++ PRIVATE -stdlib=libc++ -Wno-undefined-internal)
-install(TARGETS sulong++ DESTINATION bin)
--
2.31.1
|
@rschatz it's not Ninja that makes the difference. |
:( Thanks for checking. So it's either the MacOS version or some other setup problem. |
Ok, I updated my Mac to 11.3, and I can reproduce the problem. Looking into it... |
Looks like it's specifically the MacOSX11.3 sdk. Looks like our LLVM toolchain build just doesn't work at all for C++ with that SDK. I still haven't found out why. Not a real fix, but you can work around the issue by specifying
|
Looks like an include directory with C++ headers from the SDK appears on the include path on newer SDKs, and that's redundant with an include path from the LLVM toolchain we ship. I haven't figured out how to prevent that, but I can offer you a workaround: You can just remove the headers from our shipped LLVM toolchain: Line 466 in ec3ea38
That's just a workaround, not a real solution, since it breaks the build on every other platform (including older MacOS SDKs). Also I'm not sure if the result of that build would work correctly on older MacOS versions. |
I wasn't able to fix using |
Thanks #3383 (comment) worked though. |
Apparently this is a general issue with upstream LLVM too. At least compiling a small c++ example fails with both our version of LLVM, and also with upstream LLVM 10 and 11. It works with upstream LLVM 12. I am working on updating our LLVM toolchain to version 12, and that should solve this issue, but it might take a while. These major version updates always lead to some unexpected compatibility issues that we have to fix first. |
We're at least not blocked from forward progress now. And we are successfully using C++ extensions. Could we have something in mx to remove this include? |
Looks like it's this issue: https://reviews.llvm.org/D89001 |
Should be fixed (5ffba7c, backported the upstream fix to LLVM 10). We'll update to LLVM 12 at a later time. |
The text was updated successfully, but these errors were encountered: