Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 526048 - =app-misc/pax-utils-0.8.1 with sys-libs/musl - elf.h:31:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
Summary: =app-misc/pax-utils-0.8.1 with sys-libs/musl - elf.h:31:1: error: expected ‘=...
Status: RESOLVED DUPLICATE of bug 507470
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-20 11:37 UTC by Anthony Basile
Modified: 2014-10-21 05:06 UTC (History)
1 user (show)

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


Attachments
Build log of failure (build.log,16.81 KB, text/plain)
2014-10-20 11:37 UTC, Anthony Basile
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2014-10-20 11:37:01 UTC
This bug is here to remind me to fix pax-utils-0.8.1 on musl.

Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2014-10-20 11:37:58 UTC
Created attachment 387046 [details]
Build log of failure
Comment 2 SpanKY gentoo-dev 2014-10-20 16:58:06 UTC
i have no idea why that's failing -- the error makes no sense.  you'll need to debug it as i don't have any musl toolchains.
Comment 3 Anthony Basile gentoo-dev 2014-10-20 17:06:52 UTC
(In reply to SpanKY from comment #2)
> i have no idea why that's failing -- the error makes no sense.  you'll need
> to debug it as i don't have any musl toolchains.

I intend to, Jer assigned it to you!  I carry my own weight :)
Comment 4 Anthony Basile gentoo-dev 2014-10-20 18:03:14 UTC
(In reply to Anthony Basile from comment #3)
> (In reply to SpanKY from comment #2)
> > i have no idea why that's failing -- the error makes no sense.  you'll need
> > to debug it as i don't have any musl toolchains.
> 
> I intend to, Jer assigned it to you!  I carry my own weight :)

First that comment was meant to be facetious.

The problem is __BEGIN_DECLS which I've meant to discuss in detail with Felker.  Here's a patch that would fix it.  I had the same issue with openrc and a few others:

diff -Naur pax-utils-0.8.1.orig/elf.h pax-utils-0.8.1/elf.h
--- pax-utils-0.8.1.orig/elf.h	2014-10-20 17:57:02.906664429 +0000
+++ pax-utils-0.8.1/elf.h	2014-10-20 17:57:39.046666562 +0000
@@ -21,7 +21,9 @@
 
 #include <features.h>
 
+#ifdef __cplusplus
 __BEGIN_DECLS
+#endif
 
 /* Standard ELF types.  */
 
@@ -3375,6 +3377,8 @@
 #define R_TILEGX_NUM		130
 
 
+#ifdef __cplusplus
 __END_DECLS
+#endif
 
 #endif	/* elf.h */
Comment 5 Anthony Basile gentoo-dev 2014-10-20 22:48:37 UTC
From Felker upstream:

<dalias> __BEGIN_DECLS is just part of glibc internals
<dalias> it's not going to work on any system except glibc/linux
<dalias> the fact that it starts with __ should make it clear that it's not a public interface for use by applications
<pikhq> A few other systems have the same macro, but yes.
<dalias> shielding it with #ifdef __cplusplus is not the solution
<dalias> changing it to extern "C" { inside #ifdef __cplusplus is the right solution

So my patch should remove __BEGIN_DECLS and add

#ifdef __cplusplus
extern "C" {
#endif

.... stuff


#ifdef __cplusplus
}
#endif
Comment 6 SpanKY gentoo-dev 2014-10-21 05:06:16 UTC
oh, i already fixed that earlier this year, and it's in the 0.9.1 version now

*** This bug has been marked as a duplicate of bug 507470 ***