From 772740dd8b0c23e9ffe4fc92805e700f5367ec4c Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 12 Sep 2019 20:19:15 +0100 Subject: [PATCH] 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. --- base/asm-common.h | 6 +++++- configure.ac | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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. -- 2.11.0