summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-09-02 05:27:53 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-09-02 05:27:53 +0000
commit8190e96fad6481eed053dc724ce5d8fbb89d8ad1 (patch)
treeee5cd1ddfc1d54e98a53cdf5a1e70cccc4d53a2e /main
parent5eae9f44f74f9869e46e416a2d5d092834043483 (diff)
Merged revisions 284610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines When optional_api is non-optional, force dependent modules to be loaded. (closes issue #17707) Reported by: ira Patches: 20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14) Tested by: tilghman Review: https://reviewboard.asterisk.org/r/876/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/loader.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/loader.c b/main/loader.c
index 17bb1f821..dea236b05 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -414,6 +414,26 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned
return NULL;
}
+ /* This section is a workaround for a gcc 4.1 bug that has already been
+ * fixed in later versions. Unfortunately, some distributions, such as
+ * RHEL/CentOS 5, distribute gcc 4.1, so we're stuck with having to deal
+ * with this issue. This basically ensures that optional_api modules are
+ * loaded before any module which requires their functionality. */
+#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref)
+ if (!ast_strlen_zero(mod->info->nonoptreq)) {
+ /* Force any required dependencies to load */
+ char *each, *required_resource = ast_strdupa(mod->info->nonoptreq);
+ while ((each = strsep(&required_resource, ","))) {
+ each = ast_strip(each);
+
+ /* Is it already loaded? */
+ if (!find_resource(each, 0)) {
+ load_dynamic_module(each, global_symbols_only);
+ }
+ }
+ }
+#endif
+
while (!dlclose(lib));
resource_being_loaded = NULL;