Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907884 - net-misc/asterisk-21.1.0 fails to compile (MUSL-SYSTEM): ast_expr2.y:277:20: error: expected =, ,, ;, asm or __attribute__ before __P
Summary: net-misc/asterisk-21.1.0 fails to compile (MUSL-SYSTEM): ast_expr2.y:277:20: ...
Status: CONFIRMED
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:
Depends on:
Blocks:
 
Reported: 2023-06-05 08:06 UTC by Agostino Sarubbo
Modified: 2024-02-14 12:33 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,134.09 KB, text/plain)
2023-06-05 08:06 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-06-05 08:06:23 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-misc/asterisk-18.18.0 fails to compile (MUSL-SYSTEM).
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
(MUSL-SYSTEM) in the summary means that bug was found on a machine that runs MUSL libc but this bug MAY or MAY NOT BE related to musl.
Comment 1 Agostino Sarubbo gentoo-dev 2023-06-05 08:06:25 UTC
Created attachment 863312 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2024-02-14 08:29:21 UTC
tinderbox_musl has reproduced this issue with version 21.1.0 - Updating summary.
Comment 3 Jaco Kroon 2024-02-14 08:50:00 UTC
line in git blame:

94b934c8f66 main/ast_expr2.y (Steve Murphy     2007-07-02 21:50:15 +0000  277) static int		chk_div __P((FP___TYPE, FP___TYPE));

__P perhaps not #define's for some reason on musl?

What would have changed, because this worked previously I believe.  Or it could be glibc vs musl again.

Looking in /usr/include it seems sys/cdefs.h performs a #define for __P - is this glibc specific?  Will it fix the MUSL compile to simply add #include <sys/cdefs.h> to the relevant file?
Comment 4 Ionen Wolkens gentoo-dev 2024-02-14 09:13:15 UTC
(In reply to Jaco Kroon from comment #3)
> Looking in /usr/include it seems sys/cdefs.h performs a #define for __P - is
> this glibc specific?  Will it fix the MUSL compile to simply add #include
> <sys/cdefs.h> to the relevant file?
I'm no musl expert and haven't really looked at this, but no. sys/cdefs.h does not exist with musl.

Also, even with glibc relying on __P being defined sound flaky and per the comment is only kept to avoid breaking things it looks like (does nothing):

    /* These two macros are not used in glibc anymore.  They are kept here
       only because some other projects expect the macros to be defined.  */
    #define __P(args)       args
    #define __PMT(args)     args

If attempt any fix, I'd suggest trying it out in a quick stage3 musl chroot anyhow.
Comment 5 Jaco Kroon 2024-02-14 12:33:52 UTC
makes sense because the #define is basically #define __P(args) args

Asterisk does have a compat.h file which should #define it if it's not done.

Which is included from asterisk.h ... but apparently only for solaris.

Engaging the asterisk devs.  Thanks for the feedback.