The --version-script,asterisk.exports linker flag (and the module exports) didn't provide _IO_stdin_used in the list of exported symbols. That causes some kind of libc compatibility mode to kick in, where stdio file structures (stdout/stderr) land somewhere else. In the case of the Sparc, they landed on misaligned memory. This became apparent first after r376428 (Reorder startup sequence) when a lot of ast_log's were replaced with fprintf's. Writing to stderr triggered a SIGBUS. (Compared to x86 and amd64 architectures, the Sparc is very picky about memory alignment.) (issue ASTERISK-21763) (issue ASTERISK-21665) Reported by: Jeremy Kister Review: https://reviewboard.asterisk.org/r/2760/ ........ Merged revisions 397377 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397378 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
74 lines
2.3 KiB
Text
74 lines
2.3 KiB
Text
{
|
|
global:
|
|
LINKER_SYMBOL_PREFIXast_*;
|
|
LINKER_SYMBOL_PREFIXbridge_*;
|
|
LINKER_SYMBOL_PREFIXbridge_channel_*;
|
|
LINKER_SYMBOL_PREFIX_ast_*;
|
|
LINKER_SYMBOL_PREFIX__ast_*;
|
|
LINKER_SYMBOL_PREFIXpbx_*;
|
|
LINKER_SYMBOL_PREFIXastman_*;
|
|
LINKER_SYMBOL_PREFIXaco_*;
|
|
LINKER_SYMBOL_PREFIX__aco_*;
|
|
LINKER_SYMBOL_PREFIXao2_*;
|
|
LINKER_SYMBOL_PREFIX__ao2_*;
|
|
LINKER_SYMBOL_PREFIXoption_debug;
|
|
LINKER_SYMBOL_PREFIXoption_verbose;
|
|
LINKER_SYMBOL_PREFIXdahdi_chan_name;
|
|
LINKER_SYMBOL_PREFIXdahdi_chan_name_len;
|
|
LINKER_SYMBOL_PREFIXdahdi_chan_mode;
|
|
LINKER_SYMBOL_PREFIXcallerid_*;
|
|
LINKER_SYMBOL_PREFIXcid_di;
|
|
LINKER_SYMBOL_PREFIXcid_dr;
|
|
LINKER_SYMBOL_PREFIXclidsb;
|
|
LINKER_SYMBOL_PREFIXMD5*;
|
|
LINKER_SYMBOL_PREFIXsched_*;
|
|
LINKER_SYMBOL_PREFIXio_*;
|
|
LINKER_SYMBOL_PREFIXjb_*;
|
|
LINKER_SYMBOL_PREFIXaes_*;
|
|
LINKER_SYMBOL_PREFIXconfig_*;
|
|
LINKER_SYMBOL_PREFIXtdd_*;
|
|
LINKER_SYMBOL_PREFIXterm_*;
|
|
LINKER_SYMBOL_PREFIXchannelreloadreason2txt;
|
|
LINKER_SYMBOL_PREFIXdevstate2str;
|
|
LINKER_SYMBOL_PREFIX__manager_event;
|
|
LINKER_SYMBOL_PREFIXdialed_interface_info;
|
|
LINKER_SYMBOL_PREFIXstrsep;
|
|
LINKER_SYMBOL_PREFIXsetenv;
|
|
LINKER_SYMBOL_PREFIXstasis_*;
|
|
LINKER_SYMBOL_PREFIXunsetenv;
|
|
LINKER_SYMBOL_PREFIXstrcasestr;
|
|
LINKER_SYMBOL_PREFIXstrnlen;
|
|
LINKER_SYMBOL_PREFIXstrndup;
|
|
LINKER_SYMBOL_PREFIXvasprintf;
|
|
LINKER_SYMBOL_PREFIXasprintf;
|
|
LINKER_SYMBOL_PREFIXstrtoq;
|
|
LINKER_SYMBOL_PREFIXgetloadavg;
|
|
LINKER_SYMBOL_PREFIXntohll;
|
|
LINKER_SYMBOL_PREFIXhtonll;
|
|
LINKER_SYMBOL_PREFIXtimersub;
|
|
LINKER_SYMBOL_PREFIXres_srtp;
|
|
LINKER_SYMBOL_PREFIXres_srtp_policy;
|
|
LINKER_SYMBOL_PREFIXsecure_call_info;
|
|
/*
|
|
|
|
If _IO_stdin_used is not exported, stdout/stderr may not get
|
|
properly aligned. That causes breakage on some architectures.
|
|
|
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#51
|
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#94
|
|
http://lists.gnu.org/archive/html/bug-glibc/2001-12/msg00203.html
|
|
|
|
We export the symbol to get proper behaviour. Now printf
|
|
doesn't SIGBUS anymore on the SPARC.
|
|
|
|
Michael Karcher wrote on Jan 13, 2013:
|
|
> A build process that mangles the export of _IO_stdin_used is
|
|
> (as defined by the libc ABI, even if not explicitly written
|
|
> down) broken. [...]
|
|
|
|
*/
|
|
LINKER_SYMBOL_PREFIX_IO_stdin_used;
|
|
local:
|
|
*;
|
|
};
|