[Home]

Summary:ASTERISK-13338: [patch] app_stack weak reference not set up properly for build on Mac OS X
Reporter:John Covert (jcovert)Labels:
Date Opened:2009-01-11 12:19:00.000-0600Date Closed:2011-06-07 14:02:42
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/Portability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090112__bug14210.diff.txt
Description:On Mac OS X 10.4.11 (latest Tiger) the following is reported during make:

[LD] app_stack.o -> app_stack.so
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning weak symbol references not set in output with MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning weak referenced symbols:
_ast_agi_register
_ast_agi_send
_ast_agi_unregister

and the following is reported during load:
Asterisk Dynamic Loader Starting:
== Parsing '/etc/asterisk/modules.conf':   == Found
[Jan 11 12:04:24] NOTICE[18378]: loader.c:869 load_modules: 152 modules will be loaded.
[Jan 11 12:04:24] WARNING[18378]: loader.c:371 load_dynamic_module: Error loading module 'app_stack.so': dlopen(/usr/lib/asterisk/modules/app_stack.so, 5): Symbol not found: _ast_agi_unregister
Referenced from: /usr/lib/asterisk/modules/app_stack.so
Expected in: flat namespace

And then Asterisk just hangs.  Workaround is to remove app_stack.so or just not build it.


****** ADDITIONAL INFORMATION ******

Note: I set the version to 1.6.0.3-rc1, but this is actually 1.6.0.3, which is not yet an option I can choose here.
Comments:By: Tilghman Lesher (tilghman) 2009-01-12 14:44:50.000-0600

Please try this patch, and see if it makes a difference.

(Source: http://www.mailinglistarchive.com/xcode-users%40lists.apple.com/msg04667.html )

By: John Covert (jcovert) 2009-01-13 00:01:36.000-0600

No, that patch does not work.  It causes the first prelink to fail with

powerpc-apple-darwin8-gcc-4.0.1: 10.3: No such file or directory

What did work was to explicitly set MACOSX_DEPLOYMENT_TARGET=10.4 before the make command.  

However, in the meantime the source has been modified.  The version in trunk (168536) now gets the following compiler warnings, but links ok without any modifications to Makefile.

  [CC] app_stack.c -> app_stack.o
app_stack.c:683: warning: alias definitions not supported in Mach-O; ignored
app_stack.c:683: warning: alias definitions not supported in Mach-O; ignored
app_stack.c:683: warning: alias definitions not supported in Mach-O; ignored
app_stack.c:683: warning: alias definitions not supported in Mach-O; ignored
app_stack.c:683: warning: alias definitions not supported in Mach-O; ignored


However, trunk (168536) doesn't get much farther along before it wipes out:

  [CC] asterisk.c -> asterisk.o
asterisk.c: In function 'handle_show_sysinfo':
asterisk.c:568: error: storage size of 'vmtotal' isn't known
asterisk.c:584: error: 'HW_PHYSMEM64' undeclared (first use in this function)
asterisk.c:584: error: (Each undeclared identifier is reported only once
asterisk.c:584: error: for each function it appears in.)
asterisk.c:609: error: 'KERN_NPROCS' undeclared (first use in this function)
asterisk.c:568: warning: unused variable 'vmtotal'
asterisk.c: In function 'read_credentials':
asterisk.c:1154: warning: pointer targets in passing argument 2 of 'getpeereid' differ in signedness
asterisk.c:1154: warning: pointer targets in passing argument 3 of 'getpeereid' differ in signedness
make[1]: *** [asterisk.o] Error 1
make: *** [main] Error 2

By: Tilghman Lesher (tilghman) 2009-01-13 10:51:58.000-0600

Okay, that resembles another bug that you've already filed, so I'm going to close this one out.