summaryrefslogtreecommitdiff
path: root/include/local.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-09-19 18:07:51 +0200
committerTakashi Iwai <tiwai@suse.de>2006-09-19 18:07:51 +0200
commitf0fbd4c03efb7b9d4e5273428c7f6aa1102d2d83 (patch)
treefad3190f67574dc0e40b5e36f019f16a685f877a /include/local.h
parent0211bc3b6875af9c076517070f0466d257adce51 (diff)
downloadalsa-lib-f0fbd4c03efb7b9d4e5273428c7f6aa1102d2d83.tar.gz
add support for hosts that have custom symbol prefixes
From: Mike Frysinger <vapier@gentoo.org> some architectures, like Blackfin, have a prefix added to all symbols (in our case it's historical baggage) while normally packages shouldnt care, when code starts mixing assembler with C (like symbol versioning), you need to dip down into the inner details. find attached a patch which queries gcc for the prefix (all gcc toolchains have a builtin define of __USER_LABEL_PREFIX__) and then automatically has asm() constructs utilize this since most targets define __USER_LABEL_PREFIX__ to nothing, hopefully this shouldnt cause any problems :)
Diffstat (limited to 'include/local.h')
-rw-r--r--include/local.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/local.h b/include/local.h
index 01b79ca2..48820376 100644
--- a/include/local.h
+++ b/include/local.h
@@ -192,6 +192,9 @@ extern snd_lib_error_handler_t snd_err_msg;
/* When a reference to SYMBOL is encountered, the linker will emit a
warning message MSG. */
+
+#define ASM_NAME(name) __SYMBOL_PREFIX name
+
#ifdef HAVE_GNU_LD
# ifdef HAVE_ELF
@@ -210,19 +213,19 @@ extern snd_lib_error_handler_t snd_err_msg;
section attributes on what looks like a comment to the assembler. */
# ifdef HAVE_SECTION_QUOTES
# define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
+ __make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
static const char __evoke_link_warning_##symbol[] \
- __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
+ __attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\"\n\t#\""))) = msg;
# else
# define link_warning(symbol, msg) \
- __make_section_unallocated (".gnu.warning." #symbol) \
+ __make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
static const char __evoke_link_warning_##symbol[] \
- __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
+ __attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\n\t#"))) = msg;
# endif
# else
# define link_warning(symbol, msg) \
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
- ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
+ ".stabs \"" ASM_NAME(#symbol) "\",1,0,0,0\n");
# endif
#else
/* We will never be heard; they will all die horribly. */