Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 711582 - net-misc/asterisk fails with binutils-2.34 (patch)
Summary: net-misc/asterisk fails with binutils-2.34 (patch)
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: https://gerrit.asterisk.org/c/asteris...
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2020-03-05 11:54 UTC by Mike Johnson
Modified: 2020-03-21 23:44 UTC (History)
2 users (show)

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


Attachments
allow compatibility with binutils-2.34 (binutils-2.34-compat.patch,594 bytes, patch)
2020-03-05 11:54 UTC, Mike Johnson
Details | Diff
asterisk-bfd.patch (asterisk-bfd.patch,479 bytes, patch)
2020-03-15 18:21 UTC, Jaco Kroon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Johnson 2020-03-05 11:54:24 UTC
Created attachment 617154 [details, diff]
allow compatibility with binutils-2.34

As described here: https://wiki.gentoo.org/wiki/Binutils_2.34_porting_notes/undefined_reference_to_bfd_get_section_*
All recent versions of asterisk fail with "undefined_reference_to_bfd_get_section".  The attached patch (created from the guidelines in above wiki page) allows asterisk-13.31.0 to merge.
Comment 1 Jaco Kroon 2020-03-13 14:20:58 UTC
Hi Mike,

Happy to merge this.  Can you please submit upstream or should I?

Will this work with older versions of binutils as well?

If not I don't see how we can merge this as is, nor will upstream accept it.

Kind Regards,
Jaco
Comment 2 Jaco Kroon 2020-03-13 14:33:14 UTC
Hi Mike,

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=fd3619828e94a24a92cddec42cbc0ab33352eeb4

--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -299,21 +299,15 @@ typedef struct bfd_section *sec_ptr;
    ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
    : ~ (bfd_vma) 0)
 
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)

+#define bfd_section_size(sec) ((sec)->size)

To extract but a small piece of that, no, the patch is not backwards compatible.  We'd need something like:

#ifndef bfd_get_section_size
#define bfd_get_section_size(x) bfd_section_size(x)
#endif

For all of the macros involved (I count three).

Reason is both for ourselves, and the fact that we should submit upstream.

Would you like me to drive or are you willing to create and submit upstream and then we carry until that filters down?
Comment 3 Jaco Kroon 2020-03-15 18:21:30 UTC
Created attachment 619930 [details, diff]
asterisk-bfd.patch

Hi Mike,

Would you mind testing the attached for me please?  This compiles and works with older binutils, but I'd like to confirm for 2.34 as per your bug report.

If this works I'll submit upstream (I've confirmed on master branch there is no fix yet).

Kind Regards,
Jaco
Comment 4 Jaco Kroon 2020-03-15 18:37:46 UTC
Mike - just to put this in perspective, I'm about ready to roll version 13.32.0 and would like to include this.
Comment 5 Jaco Kroon 2020-03-17 11:49:42 UTC
Patch has been approved upstream, thus proceeding.
Comment 6 Larry the Git Cow gentoo-dev 2020-03-20 09:09:51 UTC
The bug has been closed via the following commit(s):

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

commit bef6c9937500cd1ff103da2117d7e20f268cfa47
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2020-03-15 18:45:40 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-03-20 09:09:29 +0000

    net-misc/asterisk: version bump 13.32.0
    
    Normal release.
    
    Issues reported to Gentoo fixed from upstream was mysql's my_bool that
    went away.
    
    Include patches for binutils 2.34 (also submitted upstream so expect
    removal in next release).
    
    Also includes various init script improvements I've been running with
    for a while now.
    
    Closes: https://bugs.gentoo.org/594964
    Closes: https://bugs.gentoo.org/624038
    Closes: https://bugs.gentoo.org/710484
    Closes: https://bugs.gentoo.org/711582
    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/14986
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-misc/asterisk/Manifest                         |   1 +
 net-misc/asterisk/asterisk-13.32.0.ebuild          | 332 ++++++++++++++++++
 .../files/asterisk-13.32.0-binutils-2.34.patch     |  17 +
 .../asterisk-historic-dahdiras-without-root.patch  |  23 ++
 .../asterisk-historic-dundi-null-dereference.patch |  40 +++
 ...terisk-historic-invert-gmine-search-order.patch |  12 +
 .../asterisk-historic-no-var-run-install.patch     |  14 +
 .../asterisk/files/asterisk-historic-uclibc.patch  |  23 ++
 net-misc/asterisk/files/confd-13.32.0              | 160 +++++++++
 net-misc/asterisk/files/initd-13.32.0              | 380 +++++++++++++++++++++
 10 files changed, 1002 insertions(+)