Opened 14 years ago

Closed 13 years ago

#24391 closed defect (duplicate)

Asterisk 1.6.1.12: build failure: Undefined symbols: ___sync_fetch_and_add_4

Reported by: reg@… Owned by: mr_bond@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: marc.blanchet@…, lorn@…, don@…
Port: asterisk

Description

The Asterisk ports fails to build. The problem reported is: Undefined symbols: _sync_fetch_and_add_4

This happened while linking: [LD] refcounter.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o -> refcounter

This happened on a first gen. MacBook (Core Duo) with Snow Leopard 10.6.3, XCode 3.2.1

The Macports install was a clean install and only Asterisk (with dependencies) was attempted to build. The Dependencies seemed to build fine only Asterisk itself keeps failing no matter what I do.

Attachments (4)

asterisk.output.txt (29.5 KB) - added by reg@… 14 years ago.
Debug-log-asterisk-build
main.log (55.5 KB) - added by don@… 13 years ago.
failed build log dec 3 '10
Portfile (1.8 KB) - added by stefan.van.der.eijk@… 13 years ago.
1.6.2.14
Portfile.diff (919 bytes) - added by stefan.van.der.eijk@… 13 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Cc: marc.blanchet@… added
Keywords: Asterisk ___sync_fetch_and_add_4 Undefined symbols removed
Owner: changed from macports-tickets@… to mr_bond@…
Port: asterisk added; Asterisk removed

Please remember to cc the maintainers. It's usually helpful to attach a full debug log.

Changed 14 years ago by reg@…

Attachment: asterisk.output.txt added

Debug-log-asterisk-build

comment:2 in reply to:  1 Changed 14 years ago by reg@…

Replying to jmr@…:

Please remember to cc the maintainers. It's usually helpful to attach a full debug log.

Thanks for the pointers and thanks for adding the maintainer to the CC field. I've attached the debug log.

Thx.

comment:3 Changed 14 years ago by lorn@…

Cc: lorn@… added

Cc Me!

comment:4 in reply to:  description Changed 14 years ago by lorn@…

The same problem still occurs on:

A MacMini, Intel dual core, 32 bit processor running Mac OS X Server v 1.6.3 build 10D573.

Replying to reg@…:

The Asterisk ports fails to build. The problem reported is: Undefined symbols: _sync_fetch_and_add_4

This happened while linking: [LD] refcounter.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o poll.o -> refcounter

This happened on a first gen. MacBook (Core Duo) with Snow Leopard 10.6.3, XCode 3.2.1

The Macports install was a clean install and only Asterisk (with dependencies) was attempted to build. The Dependencies seemed to build fine only Asterisk itself keeps failing no matter what I do.

comment:5 Changed 14 years ago by jmroot (Joshua Root)

Current version is 1.6.2.10; is this still a problem?

comment:6 in reply to:  5 Changed 13 years ago by don@…

Replying to jmr@…:

Current version is 1.6.2.10; is this still a problem?

Yes. I just ran into this problem on Asterisk 1.6.2.10. This was my first attempted build of Asterisk in this macport (version 1.9.2) tree.

Mac OS 10.6.5, xcode 3.2.4

Changed 13 years ago by don@…

Attachment: main.log added

failed build log dec 3 '10

comment:7 Changed 13 years ago by don@…

Cc: don@… added

Cc Me!

comment:8 Changed 13 years ago by stefan.van.der.eijk@…

I don't see the build issues on my system. I build the following Portfile (version 1.6.2.14) with the +jabber variant.

Changed 13 years ago by stefan.van.der.eijk@…

Attachment: Portfile added

1.6.2.14

Changed 13 years ago by stefan.van.der.eijk@…

Attachment: Portfile.diff added

comment:9 in reply to:  8 Changed 13 years ago by don@…

Replying to stefan.van.der.eijk@…:

I don't see the build issues on my system. I build the following Portfile (version 1.6.2.14) with the +jabber variant.

I found a work-around for this problem -- turn off the define for HAVE_GCC_ATOMICS.

FYI - The build works on a new macair with xcode 3.2.5 installed.

So I went back to my failing mac mini, I removed /opt, and reinstalled macports and xcode 3.2.5 from apple. Still failed the same way.

I then ran "port clean asterisk", "port config asterisk", then commented out the define of HAVE_GCC_ATOMICS in include/asterisk/autoconfig.h in the asterisk work directory, and then ran "port build asterisk". No build problems.

So whatever compiler + options configure is using isn't the same as is being used to build in the utils directory.

The config phase reports (extraneous stuff cut out)::

<cut> configure: build-cpu:vendor:os: i386 : apple : darwin10.6.0 : <cut> DEBUG: Using compiler 'Mac OS X gcc 4.2' DEBUG: configure phase started at Sun Jan 16 11:12:00 CET 2011 DEBUG: Executing org.macports.configure (asterisk) DEBUG: Environment: CPATH='/opt/local/include' CFLAGS='-pipe -O2 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-pipe -O2 -arch i386' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_asterisk/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2 -m32' LDFLAGS='-L/opt/local/lib -arch i386' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-pipe -O2 -m32' INSTALL='/usr/bin/install -c' OBJCFLAGS='-pipe -O2 -arch i386' FFLAGS='-pipe -O2 -m32' CC_PRINT_OPTIONS='YES' CC='/usr/bin/gcc-4.2' DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_asterisk/work/asterisk-1.6.2.10" && ./configure --prefix=/opt/local --without-h323' checking build system type... i386-apple-darwin10.6.0 checking host system type... i386-apple-darwin10.6.0 checking for gcc... /usr/bin/gcc-4.2 <cut> checking for compiler atomic operations... yes <cut>

I verified that the code:

main() {

int foo1; int foo2 = sync_fetch_and_add(&foo1, 1);

}

compiles and links successfully with /usr/bin/gcc-4.2, which the build above claims CC is set to.

Given I'm not an active developer under macports, just a user, and the multilevel build environment of macports and asterisk is complex, I don't really want to spend the time to grok it well enough to break this down further ... if somebody has a request for a particular test, I'd be happy to perform it.

comment:10 Changed 13 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.