[MacPorts] #31485: Asterisk fails to build on Lion
#31485: Asterisk fails to build on Lion --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: | Port: asterisk --------------------------------+------------------------------------------- Asterisk fails to build on Lion with Xcode 4.2 DP7. Build error is :info:build error: invalid value '6' in '-O6' -- Ticket URL: <https://trac.macports.org/ticket/31485> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: lion | Port: asterisk --------------------------------+------------------------------------------- Changes (by ryandesign@…): * cc: marc.blanchet@… (added) * owner: macports-tickets@… => mr_bond@… * keywords: => lion Old description:
Asterisk fails to build on Lion with Xcode 4.2 DP7.
Build error is
:info:build error: invalid value '6' in '-O6'
New description: Asterisk fails to build on Lion with Xcode 4.2 DP7. Build error is {{{ :info:build error: invalid value '6' in '-O6' }}} -- -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) * keywords: lion => clang Comment: [http://mailman2.u.washington.edu/pipermail/imap- uw/2007-February/001154.html This discussion] from a few years ago claims that in all official versions of gcc, any optimization level greater than 3 is treated the same as optimization level 3, confirmed by this page [http://www.unixguide.net/linux/faq/05.08.shtml this page]. And as you found, clang dies with an error if optimization level 6 is requested. (I can reproduce this on Snow Leopard as well, if I request clang.) So we should modify asterisk to not request that optimization level. I've fixed this in r84891. It now fails with a different error for me with clang, but the clang on Lion is newer than mine; please selfupdate and test this version and let us know what happens. If it doesn't work for you either, we may have to try a newer version of asterisk; see #31497. In the mean time, we could also try using llvm-gcc-4.2 instead of clang. -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Comment(by andrew@…): This now fails with the following error: {{{ :info:build ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture x86_64 }}} which is consistent with my builds of 1.8.7 as well. [http://forums.asterisk.org/viewtopic.php?f=1&t=79324 This seems to offer] a few suggestions, and recommends adding /usr/lib/bundle1.o to the LD_CONFIG however no one trying to build this seems to actually have a functioning install at the end... -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Comment(by ryandesign@…): Yeah that's getting too weird for me. Instead, please try llvm-gcc-4.2: {{{ sudo port clean asterisk sudo port install asterisk configure.compiler=llvm-gcc-4.2 }}} -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Comment(by andrew@…): Still no joy. Compiles with the same error. Seems like this is probably an Asterisk bug, and might be best addressed by them. I've done some more investigating, and the following things seem to be true. The asterisk configure script is incorrectly deciding that Mac OSX does not support weak_import, and so is not correctly defining {{{ HAVE_ATTRIBUTE_weak_import }}} Manually defining this in include/asterisk/autoconfig.h once configure is run succeeds. The correct thing to do here would be for someone to work out why the configure script test for this issue does not actually work successfully. The code I added was: {{{ #define HAVE_ATTRIBUTE_weak_import 1 }}} In addition, you need to define {{{ CONFIG_LDFLAGS=/usr/lib/bundle1.so }}} in the makeopts file. I'm assuming you can pass this option to the configure script via environment variables or something, but not sure. This was for Asterisk 1.8.7.0, and making these changes resulted in a successful build of Asterisk, that actually works (test calls even made...!!!!) -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Comment(by andrew@…): Looks like these issues have been addressed by Asterisk devs: https://issues.asterisk.org/jira/browse/ASTERISK-18213 and https://issues.asterisk.org/jira/browse/ASTERISK-17612 Neither of these changes have made the 1.8.7 release, but should be included in 1.8 -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk: invalid value '6' in '-O6' --------------------------------+------------------------------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Keywords: clang | Port: asterisk --------------------------------+------------------------------------------- Comment(by stefan.van.der.eijk@…):
Neither of these changes have made the 1.8.7 release, but should be included in 1.8
It didn't make it into 1.8.7.1 either. Building the SVN doesn't show these issues, but others pop up. See: https://trac.macports.org/ticket/31497 -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#31485: asterisk @1.6.2.10 fails to build with clang -----------------------+----------------------- Reporter: andrew@… | Owner: mr_bond@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.0.3 Resolution: | Keywords: clang Port: asterisk | -----------------------+----------------------- -- Ticket URL: <https://trac.macports.org/ticket/31485#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts