Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713840 - net-misc/asterisk-13.32.0 fails with binutils-2.34
Summary: net-misc/asterisk-13.32.0 fails with binutils-2.34
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-03-21 19:20 UTC by Mike Johnson
Modified: 2020-04-01 14:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
augmented-binutils-2.34.patch (temp.patch,573 bytes, patch)
2020-04-01 06:57 UTC, Mike Johnson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Johnson 2020-03-21 19:20:09 UTC
Same issue as filed in Bug 711582.
I apologize for not following through Jako. I did watch the bug faithfully for several days, but I'm quite busy presently and lost focus after that.
asterisk-13.32.0 still fails with
/var/tmp/notmpfs/portage/net-misc/asterisk-13.32.0/work/asterisk-13.32.0/main/backtrace.c:138: undefined reference to `bfd_get_section_flags'
Previous attachment 617154 [details, diff] patch still works and allows merge.
I'll give it a look and see if I can fix the compatibility with older versions of binutils and take care of upstream notification pending success.

Reproducible: Always

Steps to Reproduce:
1.emerge asterisk
2.watch it fail
3.
Comment 1 Jaco Kroon 2020-03-22 06:55:51 UTC
Hi Mike,

https://gerrit.asterisk.org/c/asterisk/+/13970

Which was included upstream.

Apparently that wasn't tested well enough.  This should be in files/asterisk-13.32.0-binutils-2.34.patch

Could you please confirm that this patch does get applied during the build?

During merge with --quiet-build=n please check for:

 * Applying asterisk-13.32.0-binutils-2.34.patch

Just before the autoconf related stuff kicks in.  If that indeed does apply and it still fails, we have one of two options:

1.  Use ebuild command to compile the ebuild (it will fail with above).  The touch main/backtrace.c for me in the workdir, and issue MAKEOPTS=-j1 ebuild .../asterisk-13.32.0.ebuild compile, find me the compile output of main/backtrace.c and send me that.

2.  git clone http://gerrit.asterisk.org/asterisk asterisk
    git checkout origin/13
    ./configure
    make menuselect
    make -j??
    touch main/backtrace.c
    make -j1

The advantage of the latter is that it's simpler to mess with the code to generate a patch.  You simply edit until it works, then you issue me a git diff and provide me that output.

(3.  I could possibly get some of my QA infra upgraded to binutils 2.34 and action this there.)
Comment 2 Mike Johnson 2020-03-22 20:32:17 UTC
It shows the patch being applied in the log:
[32;01m*[0m Applying asterisk-13.32.0-binutils-2.34.patch ...
I'll check out the other two options today, sounds good to me.  I did spend an hour or so trying to figure out a guard to check for binutils version, pretty tough, so these options are welcome.
Comment 3 Mike Johnson 2020-03-23 00:49:49 UTC
Starting with option 1, I'm a bit unclear, you don't want the backtrace.o binary do you?  So I'm guessing you want backtrace.c after touch and MAKEOPTS="-j1" ebuild ... compile, here it is: https://termbin.com/z0ma.  Well just in case and because termbin is cheap here is the backtrace.o file: https://termbin.com/thcpj
Comment 4 Mike Johnson 2020-03-23 00:56:54 UTC
Whoops!  I messed that up.  Proper pastebin images:
backtrace.c https://termbin.com/aw2b
backtrace.o https://termbin.com/mbgd
Comment 5 Jaco Kroon 2020-03-23 08:45:13 UTC
Mike,

Neither actually.  I want the output from the compiler.  I'm looking for warnings/errors.  But yes, the .o can be inspected for what I'm looking for, it's just harder and not something I do regularly so I'd need to actually go look up the manuals on the tooling again :).

For example:

Directly after initial ebuild ... compile (except I'm in the git repo currently, option 2):

jkroon@plastiekpoot ~/projects/asterisk ((HEAD detached at origin/13)) $ touch main/backtrace.c
jkroon@plastiekpoot ~/projects/asterisk ((HEAD detached at origin/13)) $ make -j1
CC="cc" CXX="g++" LD="" AR="" RANLIB="" CFLAGS="" LDFLAGS="" make -C menuselect CONFIGURE_SILENT="--silent" makeopts
make[1]: Entering directory '/home/jkroon/projects/asterisk/menuselect'
make[1]: 'makeopts' is up to date.
make[1]: Leaving directory '/home/jkroon/projects/asterisk/menuselect'
   [CC] backtrace.c -> backtrace.o
backtrace.c:38:2: warning: #warning Injected warning [-Wcpp]
   38 | #warning Injected warning
      |
   [LD] abstract_jb.o acl.o adsi.o alaw.o alertpipe.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o astobj2_container.o astobj2_global.o astobj2_hash.o astobj2_rbtree.o audiohook.o autochan.o autoservice.o backtrace.o bridge.o bridge_after.o bridge_basic.o bridge_channel.o bridge_roles.o bucket.o callerid.o ccss.o cdr.o cel.o channel.o channel_internal_api.o chanvars.o cli.o codec.o codec_builtin.o config.o config_options.o core_local.o core_unreal.o crypt.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o endpoints.o enum.o event.o features.o features_config.o file.o fixedjitterbuf.o format.o format_cache.o format_cap.o format_compatibility.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o json.o libasteriskpj.o loader.o lock.o logger.o manager.o manager_bridges.o manager_channels.o manager_endpoints.o manager_mwi.o manager_system.o max_forwards.o md5.o media_index.o message.o mixmonitor.o mwi.o named_acl.o named_locks.o netsock.o netsock2.o optional_api.o options.o parking.o pbx.o pbx_app.o pbx_builtins.o pbx_functions.o pbx_hangup_handler.o pbx_switch.o pbx_timing.o pbx_variables.o pickup.o plc.o poll.o presencestate.o privacy.o rtp_engine.o say.o sched.o sdp_srtp.o security_events.o sem.o serializer.o sha1.o sip_api.o slinfactory.o smoother.o sorcery.o sounds.o srv.o stasis.o stasis_bridges.o stasis_cache.o stasis_cache_pattern.o stasis_channels.o stasis_endpoints.o stasis_message.o stasis_message_router.o stasis_system.o stdtime/localtime.o strcompat.o stringfields.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadpool.o threadstorage.o timing.o translate.o udptl.o ulaw.o uri.o utils.o uuid.o version.o xml.o xmldoc.o  -> asterisk
 +--------- Asterisk Build Complete ---------+
 + Asterisk has successfully been built, and +
 + can be installed by running:              +
 +                                           +
 +                make install               +
 +-------------------------------------------+

The import bit for me is the output from [CC] backrace.c -> backtrace.o (if you use ebuild it'll output the full gcc command which is fine).  I injected a warning using #warning in the source for the sake of illustrating the point.

I really don't care about the [LD] which is the failing one for you, I'm looking to understand why the MACRO isn't being interpreted on your side.  I could be completely missing something though.

Thanks,
Jaco
Comment 6 Mike Johnson 2020-03-24 01:55:48 UTC
I compiled the git version and made it all the way to 
 +--------- Asterisk Build Complete ---------+
 + Asterisk has successfully been built, and +
 + can be installed by running:              +
 +                                           +
 +                make install               +
 +-------------------------------------------+
But this was only after disabling several things in menuconfig.  It would run, fail, I would see what failed, run menuconfig and disable that, and start make again.  It was in the hope of ignoring whatever the cause was to get to the heart of the matter, I wouldn't call it conclusive at all.  Initially I perused the ebuild and tried to match the menuconfig options with the way it set them.
I'll have to revisit it tomorrow.  I wonder if there is a build log in the PORTAGE_TMPDIR when emerging it that has what you need?  1st thing I'm gonna check.  I don't think it matters but I'm building it on armv8-a FYI.
Comment 7 Jaco Kroon 2020-03-26 21:41:30 UTC
Ah yes, arm could make a difference.

Also, the libc that you've got.  But I'm not sure on this one.  Assuming on arm you're not using glibc?

/var/tmp/portage/net-misc/asterisk-13.32.0/temp/build.log

should do the trick.
Comment 8 Jaco Kroon 2020-03-26 21:42:28 UTC
Please be sure to set MAKEOPTS=-j1 ... else compiler output can get interleaved making it HARD to figure out these things.
Comment 9 Mike Johnson 2020-03-31 23:26:10 UTC
No, am using glibc.  I did try it with -j1, no distcc, didn't matter.  Back on it today.
Comment 10 Mike Johnson 2020-04-01 02:01:13 UTC
Compiled today with nodiscc, noccache, no tmpfs.  The build log is here: https://termbin.com/bqs63.
Don't know that there's much to see there, except 32;01m*[0m Applying asterisk-13.32.0-binutils-2.34.patch ...
It fails on linking:

/var/tmp/notmpfs/portage/net-misc/asterisk-13.32.0/work/asterisk-13.32.0/build_tools/make_linker_version_script asterisk 
aarch64-unknown-linux-gnu-g++  -o asterisk -Wl,--export-dynamic -Wl,--version-script,asterisk.exports -Wl,--dynamic-list,asterisk.dynamics -Wl,-O1,--as-needed,--hash-style=gnu,--sort-common -O2 -march=armv8-a+crc+crypto -pipe -Wl,-O1,--as-needed,--hash-style=gnu,--sort-common -O2 -march=armv8-a+crc+crypto -pipe abstract_jb.o acl.o adsi.o alaw.o alertpipe.o aoc.o app.o ast_expr2.o ast_expr2f.o asterisk.o astfd.o astmm.o astobj2.o astobj2_container.o astobj2_global.o astobj2_hash.o astobj2_rbtree.o audiohook.o autochan.o autoservice.o backtrace.o bridge.o bridge_after.o bridge_basic.o bridge_channel.o bridge_roles.o bucket.o callerid.o ccss.o cdr.o cel.o channel.o channel_internal_api.o chanvars.o cli.o codec.o codec_builtin.o config.o config_options.o core_local.o core_unreal.o crypt.o data.o datastore.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o endpoints.o enum.o event.o features.o features_config.o file.o fixedjitterbuf.o format.o format_cache.o format_cap.o format_compatibility.o frame.o framehook.o fskmodem.o global_datastores.o hashtab.o heap.o http.o image.o indications.o io.o jitterbuf.o json.o libasteriskpj.o loader.o lock.o logger.o manager.o manager_bridges.o manager_channels.o manager_endpoints.o manager_mwi.o manager_system.o max_forwards.o md5.o media_index.o message.o mixmonitor.o mwi.o named_acl.o named_locks.o netsock.o netsock2.o optional_api.o options.o parking.o pbx.o pbx_app.o pbx_builtins.o pbx_functions.o pbx_hangup_handler.o pbx_switch.o pbx_timing.o pbx_variables.o pickup.o plc.o poll.o presencestate.o privacy.o rtp_engine.o say.o sched.o sdp_srtp.o security_events.o sem.o serializer.o sha1.o sip_api.o slinfactory.o smoother.o sorcery.o sounds.o srv.o stasis.o stasis_bridges.o stasis_cache.o stasis_cache_pattern.o stasis_channels.o stasis_endpoints.o stasis_message.o stasis_message_router.o stasis_system.o stdtime/localtime.o strcompat.o stringfields.o strings.o stun.o syslog.o taskprocessor.o tcptls.o tdd.o term.o test.o threadpool.o threadstorage.o timing.o translate.o udptl.o ulaw.o uri.o utils.o uuid.o version.o xml.o xmldoc.o -L. -lasteriskssl  editline/libedit.a buildinfo.o -lc  -lxml2 -lz -licui18n -licuuc -licudata -lm -ldl -lxslt -lxml2 -lz -licui18n -licuuc -licudata -lm -ldl -lsqlite3  -lssl -lcrypto -ljansson   -luuid  -lcrypt   -lrt   -ldl -lcap  -lpthread -ltinfo  -lm -lresolv -lbfd   
/usr/lib/gcc/aarch64-unknown-linux-gnu/9.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: backtrace.o: in function `process_section':
/var/tmp/notmpfs/portage/net-misc/asterisk-13.32.0/work/asterisk-13.32.0/main/backtrace.c:138: undefined reference to `bfd_get_section_flags'
collect2: error: ld returned 1 exit status
Comment 11 Mike Johnson 2020-04-01 02:16:45 UTC
Oh, forgot to add, it was done with MAKEOPTS="-j1" also.  But I also forgot where we were, with letting the ebuild fail, touching main/backtrace.c, etc.  Here's a more complete detail of that failure: https://termbin.com/9sj4
Comment 12 Jaco Kroon 2020-04-01 06:40:52 UTC
Mike,

I know it fails on linking, but I'm still interested in the COMPILE output.  There may be hints there.

Please attach the build.log file if you don't mind.  -j1 preferably (just makes reading logically easier, there are a few warnings in the compile process on asterisk and I don't want those interleaved in the wrong place).

Kind Regards,
Jaco
Comment 13 Jaco Kroon 2020-04-01 06:45:16 UTC
Mike,

Or find me on IRC ... freenode, #gentoo-voip, nick jkroon.

Kind Regards,
Jaco
Comment 14 Mike Johnson 2020-04-01 06:54:27 UTC
Hi Jaco.  We had a mid-air collision, posting at the same time :)
The build log is listed above: https://termbin.com/bqs63, and then after I touched backtrace.c and resumed it simply had this tacked onto the end: https://termbin.com/9sj4.
I believe I have solved the issue.
The upstream patch does not address this issue, although they mention attempting to maintain compatibility with binutils-2.34.  However by following their lead I augmented the patch to include this issue and to my amazement it worked.  Just compiled 13.32.0 with it successfully.
Comment 15 Mike Johnson 2020-04-01 06:57:15 UTC
Created attachment 628132 [details, diff]
augmented-binutils-2.34.patch
Comment 16 Larry the Git Cow gentoo-dev 2020-04-01 14:37:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=442d02e2a7756ab45d5b6916d92c9387ab45771e

commit 442d02e2a7756ab45d5b6916d92c9387ab45771e
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2020-04-01 07:10:16 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-04-01 14:37:34 +0000

    net-misc/asterisk: further fix for binutils-2.34 on 13.32.0
    
    Closes: https://bugs.gentoo.org/713840
    Package-Manager: Portage-2.3.89, Repoman-2.3.20
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/15192
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-misc/asterisk/files/asterisk-13.32.0-binutils-2.34.patch | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)