From 08324ab9eb97535b5994450186c5048be3c0cd62 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 8 Apr 2023 12:47:27 +0900 Subject: Include `--no-llvm-bc` option in `NM` macro only if usable --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 4bc9b60159..68ad4fef8c 100644 --- a/configure.ac +++ b/configure.ac @@ -258,6 +258,10 @@ AC_CHECK_TOOLS([OBJCOPY], [gobjcopy objcopy], [:]) AC_CHECK_TOOLS([OBJDUMP], [gobjdump objdump]) AC_CHECK_TOOLS([STRIP], [gstrip strip], [:]) +# nm errors with Rust's LLVM bitcode when Rust uses a newer LLVM version than nm. +# In case we're working with llvm-nm, tell it to not worry about the bitcode. +AS_IF([${NM} --help | grep -q 'llvm-bc'], [NM="$NM --no-llvm-bc"]) + AS_IF([test ! $rb_test_CFLAGS], [AS_UNSET(CFLAGS)]); AS_UNSET(rb_test_CFLAGS) AS_IF([test ! $rb_test_CXXFLAGS], [AS_UNSET(CXXFLAGS)]); AS_UNSET(rb_save_CXXFLAGS) -- cgit v1.2.3