Closed andy65535 closed 1 year ago
Works fine over here when the include files/paths are all correct.
$ nm at_command.o | grep ast_
U ast_debug_get_by_module
U ast_log
U ast_options
$ nm at_command.o | grep at_
00000000000001e0 d at_cmd.14
0000000000000060 d at_cmd.2
0000000000000000 d at_cmd.23
00000000000012b0 T at_enqueue_activate
00000000000010f0 T at_enqueue_answer
...
I assume you have a bunch of defined ast_* functions that are defined instead of referenced.
That would mean that the AST_INLINE_API macro is not doing its work correctly on your system. If you check include/asterisk/inline_api.h
(outside tree), you should find this:
#if !defined(LOW_MEMORY)
#if !defined(AST_API_MODULE)
#if defined(__clang__) || defined(__GNUC_STDC_INLINE__)
#define AST_INLINE_API(hdr, body) static hdr; static inline hdr body
#else /* if defined(__clang__) */
#define AST_INLINE_API(hdr, body) hdr; extern inline hdr body
#endif
#else /* if !defined(AST_API_MODULE) */
#define AST_INLINE_API(hdr, body) hdr; hdr body
#endif
You could play around and swap those #defines around. But this is not trivial to explain. Using a different gcc can produce different results.
Also:
commit 5e46127e17c1a80a03f952c78e0414cf34dfdca7
Author: George Joseph <george.joseph@fairview5.com>
Date: Mon Apr 6 18:58:30 2015 +0000
build: Fixes for gcc 5 compilation
These are fixes for compilation under gcc 5.0...
chan_sip.c: In parse_request needed to make 'lim' unsigned.
inline_api.h: Needed to add a check for '__GNUC_STDC_INLINE__' to detect C99
inline semantics (same as clang).
ccss.c: In ast_cc_set_parm, needed to fix weird comparison.
dsp.c: Needed to work around a possible compiler bug. It was throwing
an array-bounds error but neither
sgriepentrog, rmudgett nor I could figure out why.
manager.c: In action_atxfer, needed to correct an array allocation.
This patch will go to 11, 13, trunk.
Review: https://reviewboard.asterisk.org/r/4581/
Reported-by: Jeffrey Ollie
Tested-by: George Joseph
ASTERISK-24932 #close
That's a fix for gcc compilation with gcc 5. It is included first in 11.18:
$ git tag --contains 5e46127e17c1a80a03f952c78e0414cf34dfdca7 | sort -V | head -n3
11.18.0
11.18.0-rc1
11.19.0
I think you should update both your Asterisk and your compiler. This is 2015 stuff.
I've used inline_api.h from latest Asterisk repo https://github.com/asterisk/asterisk/blob/master/include/asterisk/inline_api.h and now chan_dongle making without errors. Also ast_compat.h needs update:
diff --git a/ast_compat.h b/ast_compat.h
index 1ad407a..6f371bb 100644
--- a/ast_compat.h
+++ b/ast_compat.h
@@ -9,6 +9,15 @@
#include <asterisk/channel.h>
+#if ASTERISK_VERSION_NUM <=111700
+#define DEBUG_ATLEAST(level) \
+ (option_debug >= (level) \
+ || (ast_opt_dbg_module \
+ && ((int)ast_debug_get_by_module(AST_MODULE) >= (level) \
+ || (int)ast_debug_get_by_module(__FILE__) >= (level))))
+#endif
+
+
/* Asterisk 11+ channel opaqification */
#if ASTERISK_VERSION_NUM < 110000 /* 11- */
Now it works as expected. Thank you!
Hi! bootstrap and configure --with-astversion=11.14
works well, but make failed:
asterisk 11.14.1 gcc version 4.8.3 20140911
Pleas, help.