From: Mark Wooding Date: Thu, 12 Sep 2019 19:19:15 +0000 (+0100) Subject: configure.ac, base/asm-common.h: Check explicitly for `_' on symbols. X-Git-Tag: 2.5.0~9 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/772740dd8b0c23e9ffe4fc92805e700f5367ec4c configure.ac, base/asm-common.h: Check explicitly for `_' on symbols. 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. --- diff --git a/base/asm-common.h b/base/asm-common.h index e8f6445c..44c223da 100644 --- a/base/asm-common.h +++ b/base/asm-common.h @@ -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 diff --git a/configure.ac b/configure.ac index 308e457c..cc7f3b4f 100644 --- a/configure.ac +++ b/configure.ac @@ -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.