configure.ac, base/asm-common.h: Check explicitly for `_' on symbols.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 12 Sep 2019 19:19:15 +0000 (20:19 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 12 Sep 2019 19:19:15 +0000 (20:19 +0100)
There's an autoconf macro for this in the Debian `libltdl-dev' package,
though not in the main `libtool' package.

I think some BSDs are foolish enough to put `_' on symbols even though
they notionally use ELF.  This may not be enough to make things work on
them, but it should at least help a bit.

base/asm-common.h
configure.ac

index e8f6445..44c223d 100644 (file)
@@ -1116,7 +1116,11 @@ name:
 #endif
 
 #ifndef F
-#  define F(name) name
+#  ifdef SYM_USCORE
+#    define F(name) _##name
+#  else
+#    define F(name) name
+#  endif
 #endif
 
 #ifndef TYPE_FUNC
index 308e457..cc7f3b4 100644 (file)
@@ -192,6 +192,13 @@ case mdw_asm_debug in
        [Define to enable assembler-level debugging.]) ;;
 esac
 
+dnl Check for leading underscores on C symbols.
+LT_SYS_SYMBOL_USCORE
+case $sys_symbol_underscore in
+  yes) AC_DEFINE([SYM_USCORE], [1],
+        [Define if C symbols are prefixed with an underscore.]) ;;
+esac
+
 dnl--------------------------------------------------------------------------
 dnl CPU-specific assembler features.