Unable to build asterisk 10 port with updated GCC

Asterisk project on BSD

Moderators: Moderator, Support

Unable to build asterisk 10 port with updated GCC

Postby varnav » Mon Dec 19, 2011 11:22 am

Hello!

Looks like asterisk port is not compatible with newer GCC that are installed according to handbook:
http://www.freebsd.org/doc/en/articles/ ... ticle.html

I'm getting the following error when trying to make /usr/ports/net/asterisk10 with GCC 4.6:

Code: Select all
creating makelist
creating config.h
   [LD] ../res/res_adsi.o abstract_jb.o acl.o alaw.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o audiohook.o autochan.o autoservice.o bridging.o callerid.o ccss.o cdr.o cel.o channel.o chanvars.o cli.o config.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o event.o features.o file.o fixedjitterbuf.o format.o format_cap.o format_pref.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o loader.o lock.o logger.o manager.o md5.o message.o netsock.o netsock2.o pbx.o plc.o poll.o privacy.o rtp_engine.o say.o sched.o security_events.o sha1.o slinfactory.o srv.o ssl.o stdtime/localtime.o strcompat.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadstorage.o timing.o translate.o udptl.o ulaw.o utils.o version.o xml.o xmldoc.o editline/libedit.a  -> asterisk
/usr/local/bin/ld: asterisk: local symbol `__progname' in /usr/lib/crt1.o is referenced by DSO
/usr/local/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
varnav
Newsterisk
 
Posts: 25
Joined: Tue Nov 15, 2011 3:59 pm

Re: Unable to build asterisk 10 port with updated GCC

Postby varnav » Mon Dec 19, 2011 5:18 pm

Same problem with /usr/ports/net/asterisk (1.8.8.0)
But /usr/ports/net/asterisk16 (1.6.2.21) is NOT affected and build ok.
varnav
Newsterisk
 
Posts: 25
Joined: Tue Nov 15, 2011 3:59 pm

Re: Unable to build asterisk 10 port with updated GCC

Postby crescent » Sun Apr 01, 2012 1:28 pm

I encountered the same problem. Neither asterisk18 (/usr/ports/net/asterisk) nor asterisk10 (/usr/ports/net/asterisk10) can currently be compiled with gcc46.

The symbols "__progname" and "environ" are defined in the /usr/lib/crt1.o object file as local (weak) symbols, but the asterisk build system needs them defined as global symbols. This patch (using asterisk-1.8.11.0 as an example) does that:
Code: Select all
--- /usr/ports/net/asterisk/work/asterisk-1.8.11.0/main/asterisk.exports        2012-04-01 11:19:50.532808549 -0700
+++ /root/asterisk.exports      2012-04-01 10:43:28.258979089 -0700
@@ -44,6 +44,8 @@
                res_srtp;
                res_srtp_policy;
                secure_call_info;
+               __progname;
+               environ;
        local:
                *;
};

After encountering the above link error, apply the patch to (or edit) the "work/asterisk-[VERSION]/main/asterisk.exports" file and execute "make" again.
crescent
Newsterisk
 
Posts: 1
Joined: Sun Apr 01, 2012 1:23 pm

Re: Unable to build asterisk 10 port with updated GCC

Postby varnav » Sun Apr 08, 2012 11:09 am

Cool! Probably you shall post this patch to the reviewboard
varnav
Newsterisk
 
Posts: 25
Joined: Tue Nov 15, 2011 3:59 pm


Return to Asterisk-BSD

Who is online

Users browsing this forum: No registered users and 1 guest