dect
/
asterisk
Archived
13
0
Fork 0

Allow symbol export filtering to work properly on platforms that have symbol prefixes.

Some platforms prefix externally-visible symbols in object files generated
from C sources (most commonly, '_' is the prefix). On these platforms,
the existing symbol export filtering process ends up suppressing all the symbols
that are supposed to be left visible. This patch allows the prefix string
to be supplied to the top-level Makefile in the LINKER_SYMBOL_PREFIX variable,
and then generates the linker scripts as required to include the prefix
supplied.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@255906 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
kpfleming 2010-04-02 18:57:58 +00:00
parent f98d753785
commit a321328986
32 changed files with 257 additions and 231 deletions

View File

@ -175,6 +175,14 @@ HTTP_DOCSDIR=/var/www/html
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
HTTP_CGIDIR=/var/www/cgi-bin
# If your platform's linker expects a prefix on symbols generated from compiling C
# source files, set LINKER_SYMBOL_PREFIX to that value. On some systems, exported symbols
# from C source files are prefixed with '_', for example. If this value is not set
# properly, the linker scripts that live in the '*.exports' files in various places
# in this tree will unintentionally suppress symbols that should be visible
# in the final binary objects.
LINKER_SYMBOL_PREFIX=
# Uncomment this to use the older DSP routines
#_ASTCFLAGS+=-DOLD_DSP_ROUTINES

View File

@ -129,6 +129,7 @@ uninstall::
dist-clean::
rm -f .*.moduleinfo .moduleinfo
rm -f .*.makeopts .makeopts
rm -f *.exports
.%.moduleinfo: %.c
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@

View File

@ -3,7 +3,7 @@
#
# Makefile rules
#
# Copyright (C) 2006-2008, Digium, Inc.
# Copyright (C) 2006-2010, Digium, Inc.
#
# Kevin P. Fleming <kpfleming@digium.com>
#
@ -117,10 +117,16 @@ endif
$(CMD_PREFIX) $(CXX) -o $@ -E $< $(MAKE_DEPS) $(CXX_CFLAGS)
%.so: %.o
ifeq ($(GNU_LD),1)
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* $(LINKER_SYMBOL_PREFIX)
endif
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
%.so: %.oo
ifeq ($(GNU_LD),1)
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* $(LINKER_SYMBOL_PREFIX)
endif
$(ECHO_PREFIX) echo " [LDXX] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)

View File

@ -1,20 +0,0 @@
{
global:
mm_critical;
mm_diskerror;
mm_dlog;
mm_exists;
mm_expunged;
mm_fatal;
mm_flags;
mm_list;
mm_log;
mm_login;
mm_lsub;
mm_nocritical;
mm_notify;
mm_searched;
mm_status;
local:
*;
};

View File

@ -0,0 +1,20 @@
{
global:
LINKER_SYMBOL_PREFIXmm_critical;
LINKER_SYMBOL_PREFIXmm_diskerror;
LINKER_SYMBOL_PREFIXmm_dlog;
LINKER_SYMBOL_PREFIXmm_exists;
LINKER_SYMBOL_PREFIXmm_expunged;
LINKER_SYMBOL_PREFIXmm_fatal;
LINKER_SYMBOL_PREFIXmm_flags;
LINKER_SYMBOL_PREFIXmm_list;
LINKER_SYMBOL_PREFIXmm_log;
LINKER_SYMBOL_PREFIXmm_login;
LINKER_SYMBOL_PREFIXmm_lsub;
LINKER_SYMBOL_PREFIXmm_nocritical;
LINKER_SYMBOL_PREFIXmm_notify;
LINKER_SYMBOL_PREFIXmm_searched;
LINKER_SYMBOL_PREFIXmm_status;
local:
*;
};

View File

@ -0,0 +1,4 @@
#!/bin/sh
test -f ${1}.exports.in && ${AWK} "{sub(\"LINKER_SYMBOL_PREFIX\", \"${2}\"); print;}" ${1}.exports.in > ${1}.exports
test -f ${1}.exports.in || rm -f ${1}.exports

View File

@ -167,7 +167,7 @@ endif
$(OBJS): _ASTCFLAGS+=-DAST_MODULE=\"core\"
$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) asterisk.exports
$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
$(ECHO_PREFIX) echo " [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
@ -176,9 +176,16 @@ else
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
endif
ifeq ($(GNU_LD),1)
$(MAIN_TGT): asterisk.exports
asterisk.exports: asterisk.exports.in
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script asterisk $(LINKER_SYMBOL_PREFIX)
endif
clean::
rm -f asterisk
rm -f db1-ast/.*.d
rm -f asterisk.exports
@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
@$(MAKE) -C db1-ast clean
@$(MAKE) -C stdtime clean

View File

@ -1,45 +0,0 @@
{
global:
ast_*;
_ast_*;
__ast_*;
pbx_*;
astman_*;
ao2_*;
__ao2_*;
option_debug;
option_verbose;
dahdi_chan_name;
dahdi_chan_name_len;
dahdi_chan_mode;
callerid_*;
cid_di;
cid_dr;
clidsb;
MD5*;
sched_*;
io_*;
jb_*;
aes_*;
config_*;
tdd_*;
term_*;
channelreloadreason2txt;
devstate2str;
__manager_event;
dialed_interface_info;
strsep;
setenv;
unsetenv;
strcasestr;
strnlen;
strndup;
vasprintf;
asprintf;
strtoq;
getloadavg;
ntohll;
htonll;
local:
*;
};

45
main/asterisk.exports.in Normal file
View File

@ -0,0 +1,45 @@
{
global:
LINKER_SYMBOL_PREFIXast_*;
LINKER_SYMBOL_PREFIX_ast_*;
LINKER_SYMBOL_PREFIX__ast_*;
LINKER_SYMBOL_PREFIXpbx_*;
LINKER_SYMBOL_PREFIXastman_*;
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_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;
local:
*;
};

View File

@ -1,33 +0,0 @@
{
global:
ast_adsi_available;
ast_adsi_begin_download;
ast_adsi_channel_restore;
ast_adsi_clear_screen;
ast_adsi_clear_soft_keys;
ast_adsi_connect_session;
ast_adsi_data_mode;
ast_adsi_disconnect_session;
ast_adsi_display;
ast_adsi_download_connect;
ast_adsi_download_disconnect;
ast_adsi_end_download;
ast_adsi_get_cpeid;
ast_adsi_get_cpeinfo;
ast_adsi_input_control;
ast_adsi_input_format;
ast_adsi_load_session;
ast_adsi_load_soft_key;
ast_adsi_print;
ast_adsi_query_cpeid;
ast_adsi_query_cpeinfo;
ast_adsi_read_encoded_dtmf;
ast_adsi_set_keys;
ast_adsi_set_line;
ast_adsi_transmit_message;
ast_adsi_transmit_message_full;
ast_adsi_unload_session;
ast_adsi_voice_mode;
local:
*;
};

33
res/res_adsi.exports.in Normal file
View File

@ -0,0 +1,33 @@
{
global:
LINKER_SYMBOL_PREFIXast_adsi_available;
LINKER_SYMBOL_PREFIXast_adsi_begin_download;
LINKER_SYMBOL_PREFIXast_adsi_channel_restore;
LINKER_SYMBOL_PREFIXast_adsi_clear_screen;
LINKER_SYMBOL_PREFIXast_adsi_clear_soft_keys;
LINKER_SYMBOL_PREFIXast_adsi_connect_session;
LINKER_SYMBOL_PREFIXast_adsi_data_mode;
LINKER_SYMBOL_PREFIXast_adsi_disconnect_session;
LINKER_SYMBOL_PREFIXast_adsi_display;
LINKER_SYMBOL_PREFIXast_adsi_download_connect;
LINKER_SYMBOL_PREFIXast_adsi_download_disconnect;
LINKER_SYMBOL_PREFIXast_adsi_end_download;
LINKER_SYMBOL_PREFIXast_adsi_get_cpeid;
LINKER_SYMBOL_PREFIXast_adsi_get_cpeinfo;
LINKER_SYMBOL_PREFIXast_adsi_input_control;
LINKER_SYMBOL_PREFIXast_adsi_input_format;
LINKER_SYMBOL_PREFIXast_adsi_load_session;
LINKER_SYMBOL_PREFIXast_adsi_load_soft_key;
LINKER_SYMBOL_PREFIXast_adsi_print;
LINKER_SYMBOL_PREFIXast_adsi_query_cpeid;
LINKER_SYMBOL_PREFIXast_adsi_query_cpeinfo;
LINKER_SYMBOL_PREFIXast_adsi_read_encoded_dtmf;
LINKER_SYMBOL_PREFIXast_adsi_set_keys;
LINKER_SYMBOL_PREFIXast_adsi_set_line;
LINKER_SYMBOL_PREFIXast_adsi_transmit_message;
LINKER_SYMBOL_PREFIXast_adsi_transmit_message_full;
LINKER_SYMBOL_PREFIXast_adsi_unload_session;
LINKER_SYMBOL_PREFIXast_adsi_voice_mode;
local:
*;
};

View File

@ -1,10 +0,0 @@
{
global:
*ast_agi_register;
*ast_agi_unregister;
*ast_agi_register_multiple;
*ast_agi_unregister_multiple;
*ast_agi_send;
local:
*;
};

10
res/res_agi.exports.in Normal file
View File

@ -0,0 +1,10 @@
{
global:
LINKER_SYMBOL_PREFIX*ast_agi_register;
LINKER_SYMBOL_PREFIX*ast_agi_unregister;
LINKER_SYMBOL_PREFIX*ast_agi_register_multiple;
LINKER_SYMBOL_PREFIX*ast_agi_unregister_multiple;
LINKER_SYMBOL_PREFIX*ast_agi_send;
local:
*;
};

View File

@ -1,7 +0,0 @@
{
global:
ast_*;
calendar_config;
local:
*;
};

View File

@ -0,0 +1,7 @@
{
global:
LINKER_SYMBOL_PREFIXast_*;
LINKER_SYMBOL_PREFIXcalendar_config;
local:
*;
};

View File

@ -1,11 +0,0 @@
{
global:
ast_fax_tech_register;
ast_fax_tech_unregister;
ast_fax_session_unreference;
ast_fax_minrate;
ast_fax_maxrate;
ast_fax_state_to_str;
local:
*;
};

11
res/res_fax.exports.in Normal file
View File

@ -0,0 +1,11 @@
{
global:
LINKER_SYMBOL_PREFIXast_fax_tech_register;
LINKER_SYMBOL_PREFIXast_fax_tech_unregister;
LINKER_SYMBOL_PREFIXast_fax_session_unreference;
LINKER_SYMBOL_PREFIXast_fax_minrate;
LINKER_SYMBOL_PREFIXast_fax_maxrate;
LINKER_SYMBOL_PREFIXast_fax_state_to_str;
local:
*;
};

View File

@ -1,13 +0,0 @@
{
global:
ast_bridge_call;
ast_masq_park_call;
ast_park_call;
ast_parking_ext;
ast_pickup_call;
ast_pickup_ext;
ast_register_feature;
ast_unregister_feature;
local:
*;
};

View File

@ -0,0 +1,13 @@
{
global:
LINKER_SYMBOL_PREFIXast_bridge_call;
LINKER_SYMBOL_PREFIXast_masq_park_call;
LINKER_SYMBOL_PREFIXast_park_call;
LINKER_SYMBOL_PREFIXast_parking_ext;
LINKER_SYMBOL_PREFIXast_pickup_call;
LINKER_SYMBOL_PREFIXast_pickup_ext;
LINKER_SYMBOL_PREFIXast_register_feature;
LINKER_SYMBOL_PREFIXast_unregister_feature;
local:
*;
};

View File

@ -1,14 +0,0 @@
{
global:
ast_aji_create_chat;
ast_aji_disconnect;
ast_aji_get_client;
ast_aji_get_clients;
ast_aji_increment_mid;
ast_aji_invite_chat;
ast_aji_join_chat;
ast_aji_send;
ast_aji_send_chat;
local:
*;
};

14
res/res_jabber.exports.in Normal file
View File

@ -0,0 +1,14 @@
{
global:
LINKER_SYMBOL_PREFIXast_aji_create_chat;
LINKER_SYMBOL_PREFIXast_aji_disconnect;
LINKER_SYMBOL_PREFIXast_aji_get_client;
LINKER_SYMBOL_PREFIXast_aji_get_clients;
LINKER_SYMBOL_PREFIXast_aji_increment_mid;
LINKER_SYMBOL_PREFIXast_aji_invite_chat;
LINKER_SYMBOL_PREFIXast_aji_join_chat;
LINKER_SYMBOL_PREFIXast_aji_send;
LINKER_SYMBOL_PREFIXast_aji_send_chat;
local:
*;
};

View File

@ -1,11 +0,0 @@
{
global:
*ast_monitor_change_fname;
*ast_monitor_pause;
*ast_monitor_setjoinfiles;
*ast_monitor_start;
*ast_monitor_stop;
*ast_monitor_unpause;
local:
*;
};

View File

@ -0,0 +1,11 @@
{
global:
LINKER_SYMBOL_PREFIX*ast_monitor_change_fname;
LINKER_SYMBOL_PREFIX*ast_monitor_pause;
LINKER_SYMBOL_PREFIX*ast_monitor_setjoinfiles;
LINKER_SYMBOL_PREFIX*ast_monitor_start;
LINKER_SYMBOL_PREFIX*ast_monitor_stop;
LINKER_SYMBOL_PREFIX*ast_monitor_unpause;
local:
*;
};

View File

@ -1,20 +0,0 @@
{
global:
ast_odbc_ast_str_SQLGetData;
ast_odbc_backslash_is_escape;
ast_odbc_clear_cache;
ast_odbc_direct_execute;
ast_odbc_find_column;
ast_odbc_find_table;
ast_odbc_prepare_and_execute;
ast_odbc_release_obj;
ast_odbc_request_obj;
_ast_odbc_request_obj;
ast_odbc_request_obj2;
_ast_odbc_request_obj2;
ast_odbc_retrieve_transaction_obj;
ast_odbc_sanity_check;
ast_odbc_smart_execute;
local:
*;
};

20
res/res_odbc.exports.in Normal file
View File

@ -0,0 +1,20 @@
{
global:
LINKER_SYMBOL_PREFIXast_odbc_ast_str_SQLGetData;
LINKER_SYMBOL_PREFIXast_odbc_backslash_is_escape;
LINKER_SYMBOL_PREFIXast_odbc_clear_cache;
LINKER_SYMBOL_PREFIXast_odbc_direct_execute;
LINKER_SYMBOL_PREFIXast_odbc_find_column;
LINKER_SYMBOL_PREFIXast_odbc_find_table;
LINKER_SYMBOL_PREFIXast_odbc_prepare_and_execute;
LINKER_SYMBOL_PREFIXast_odbc_release_obj;
LINKER_SYMBOL_PREFIXast_odbc_request_obj;
LINKER_SYMBOL_PREFIX_ast_odbc_request_obj;
LINKER_SYMBOL_PREFIXast_odbc_request_obj2;
LINKER_SYMBOL_PREFIX_ast_odbc_request_obj2;
LINKER_SYMBOL_PREFIXast_odbc_retrieve_transaction_obj;
LINKER_SYMBOL_PREFIXast_odbc_sanity_check;
LINKER_SYMBOL_PREFIXast_odbc_smart_execute;
local:
*;
};

View File

@ -1,6 +0,0 @@
{
global:
ast_pktccops_gate_alloc;
local:
*;
};

View File

@ -0,0 +1,6 @@
{
global:
LINKER_SYMBOL_PREFIXast_pktccops_gate_alloc;
local:
*;
};

View File

@ -1,18 +0,0 @@
{
global:
*ast_smdi_interface_find;
*ast_smdi_interface_unref;
*ast_smdi_md_message_destroy;
*ast_smdi_md_message_pop;
*ast_smdi_md_message_putback;
*ast_smdi_md_message_wait;
*ast_smdi_mwi_message_destroy;
*ast_smdi_mwi_message_pop;
*ast_smdi_mwi_message_putback;
*ast_smdi_mwi_message_wait;
*ast_smdi_mwi_message_wait_station;
*ast_smdi_mwi_set;
*ast_smdi_mwi_unset;
local:
*;
};

18
res/res_smdi.exports.in Normal file
View File

@ -0,0 +1,18 @@
{
global:
LINKER_SYMBOL_PREFIX*ast_smdi_interface_find;
LINKER_SYMBOL_PREFIX*ast_smdi_interface_unref;
LINKER_SYMBOL_PREFIX*ast_smdi_md_message_destroy;
LINKER_SYMBOL_PREFIX*ast_smdi_md_message_pop;
LINKER_SYMBOL_PREFIX*ast_smdi_md_message_putback;
LINKER_SYMBOL_PREFIX*ast_smdi_md_message_wait;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_message_destroy;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_message_pop;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_message_putback;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_message_wait;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_message_wait_station;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_set;
LINKER_SYMBOL_PREFIX*ast_smdi_mwi_unset;
local:
*;
};

View File

@ -1,21 +0,0 @@
{
global:
ast_speech_change;
ast_speech_change_results_type;
ast_speech_change_state;
ast_speech_destroy;
ast_speech_dtmf;
ast_speech_grammar_activate;
ast_speech_grammar_deactivate;
ast_speech_grammar_load;
ast_speech_grammar_unload;
ast_speech_new;
ast_speech_register;
ast_speech_results_free;
ast_speech_results_get;
ast_speech_start;
ast_speech_unregister;
ast_speech_write;
local:
*;
};

21
res/res_speech.exports.in Normal file
View File

@ -0,0 +1,21 @@
{
global:
LINKER_SYMBOL_PREFIXast_speech_change;
LINKER_SYMBOL_PREFIXast_speech_change_results_type;
LINKER_SYMBOL_PREFIXast_speech_change_state;
LINKER_SYMBOL_PREFIXast_speech_destroy;
LINKER_SYMBOL_PREFIXast_speech_dtmf;
LINKER_SYMBOL_PREFIXast_speech_grammar_activate;
LINKER_SYMBOL_PREFIXast_speech_grammar_deactivate;
LINKER_SYMBOL_PREFIXast_speech_grammar_load;
LINKER_SYMBOL_PREFIXast_speech_grammar_unload;
LINKER_SYMBOL_PREFIXast_speech_new;
LINKER_SYMBOL_PREFIXast_speech_register;
LINKER_SYMBOL_PREFIXast_speech_results_free;
LINKER_SYMBOL_PREFIXast_speech_results_get;
LINKER_SYMBOL_PREFIXast_speech_start;
LINKER_SYMBOL_PREFIXast_speech_unregister;
LINKER_SYMBOL_PREFIXast_speech_write;
local:
*;
};