Skip to content
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

Introduce guard for aarch64 GCC compilation. #4647

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ genrule(
name = "sed_config_h",
srcs = ["cmake/config.h.cmake"],
outs = ["config.h"],
# TODO: We should actually check these properly instead of just #undefing them.
# Maybe select() can help here?
cmd = " | ".join([
"sed 's|cmakedefine|define|g' < $(SRCS)",
"sed 's|define HAVE_LIBGC 1|undef HAVE_LIBGC|g'",
"sed 's|define HAVE_LIBBACKTRACE 1|undef HAVE_LIBBACKTRACE|g' > $(OUTS)",
"sed 's|define HAVE_MM_MALLOC_H 1|undef HAVE_MM_MALLOC_H|g' > $(OUTS)",
]),
visibility = ["//visibility:private"],
)
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ include (CheckIncludeFile)
check_include_file (execinfo.h HAVE_EXECINFO_H)
check_include_file (ucontext.h HAVE_UCONTEXT_H)
check_include_file (backtrace-supported.h HAVE_LIBBACKTRACE)
check_include_file(mm_malloc.h, HAVE_MM_MALLOC_H)
include (CheckIncludeFileCXX)
check_include_file_cxx (cxxabi.h HAVE_CXXABI_H)

Expand Down
3 changes: 3 additions & 0 deletions cmake/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@

/* Define to 1 if you have the cxxabi.h header */
#cmakedefine HAVE_CXXABI_H 1

/* Define to 1 if you have the mm_malloc.h header */
#cmakedefine HAVE_MM_MALLOC_H 1
3 changes: 3 additions & 0 deletions lib/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ limitations under the License.
// of this to allow posix_memalign redeclaration with / without exception
// specifier. As we define posix_memalign below in this file we really need to
// ensure the proper include order to workaround this weirdness.
// Some systems (e.g., GCC compiling on arm64) do not have mm_malloc.h. We need to skip it.
#if HAVE_MM_MALLOC_H
#include <mm_malloc.h> // NOLINT(build/include_order)
#endif

#include "config.h"
#if HAVE_LIBGC
Expand Down
Loading