Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 580362

Summary: app-arch/pax: fix build on musl
Product: Gentoo Linux Reporter: A. Wilcox (awilfox) <awilfox.gentoo>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: musl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: pax-20160306 ebuild patch
pax-20160306-glibc-to-linux.patch
pax-20160306-glibc-to-linux.patch

Description A. Wilcox (awilfox) 2016-04-17 18:11:06 UTC
Created attachment 431004 [details, diff]
pax-20160306 ebuild patch

pax requires a source patch and the standalone-fts library (like dev-libs/libcgroup) to compile and run on the musl C library.

While I was in there, I bumped EAPI to 6.
Comment 1 A. Wilcox (awilfox) 2016-04-17 18:11:37 UTC
Created attachment 431006 [details, diff]
pax-20160306-glibc-to-linux.patch
Comment 2 A. Wilcox (awilfox) 2016-04-17 20:24:44 UTC
Created attachment 431016 [details, diff]
pax-20160306-glibc-to-linux.patch

After discussion with upstream, I have updated the patch for the case of kFreeBSD and HURD using glibc.
Comment 3 Anthony Basile gentoo-dev 2016-04-17 20:33:13 UTC
(In reply to Andrew Wilcox (awilfox) from comment #0)
> Created attachment 431004 [details, diff] [details, diff]
> pax-20160306 ebuild patch
> 
> pax requires a source patch and the standalone-fts library (like
> dev-libs/libcgroup) to compile and run on the musl C library.
> 
> While I was in there, I bumped EAPI to 6.

EAPI=6 needs fixing in musl, see bug #571444.  EAPI=5 is okay


(In reply to Andrew Wilcox (awilfox) from comment #2)
> Created attachment 431016 [details, diff] [details, diff]
> pax-20160306-glibc-to-linux.patch
> 
> After discussion with upstream, I have updated the patch for the case of
> kFreeBSD and HURD using glibc.

despite what upstream says __linux__ is wrong here.  first even if you were to proceed this way, don't you want __LINUX__  all upper case?  second, all of these macros are wrong minded. see 

https://blogs.gentoo.org/blueness/2016/03/31/why-macros-like-__glibc__-and-__uclibc__-are-bad/

See what upstream has to say to removing these and getting the right checks into configure.ac
Comment 4 Anthony Basile gentoo-dev 2016-04-17 20:38:23 UTC
> See what upstream has to say to removing these and getting the right checks
> into configure.ac

ah they dropped gnu autotools for pure make.  okay so resolve the __linux__ vs __LINUX__ issue and then i'll commit.
Comment 5 A. Wilcox (awilfox) 2016-04-17 22:04:22 UTC
No, unfortunately __LINUX__ is not defined by any compiler.

awilcox on ciall [pts/8 Sun 17 17:01] tmp: gcc -dM -E - < /dev/null | grep -i LINUX
#define __linux 1
#define __linux__ 1
#define __gnu_linux__ 1
#define linux 1
awilcox on ciall [pts/8 Sun 17 17:02] tmp: clang -dM -E - < /dev/null | grep -i LINUX
#define __gnu_linux__ 1
#define __linux 1
#define __linux__ 1
#define linux 1

As for the EAPI 6 issue on Portage, thanks for the bug link... I've spent about two hours trying to patch it so I can merge Perl.  Now I can just use the patch in that bug until the actual fix is committed.
Comment 6 Anthony Basile gentoo-dev 2016-04-17 22:25:15 UTC
(In reply to Andrew Wilcox (awilfox) from comment #5)
> No, unfortunately __LINUX__ is not defined by any compiler.
> 
> awilcox on ciall [pts/8 Sun 17 17:01] tmp: gcc -dM -E - < /dev/null | grep
> -i LINUX
> #define __linux 1
> #define __linux__ 1
> #define __gnu_linux__ 1
> #define linux 1
> awilcox on ciall [pts/8 Sun 17 17:02] tmp: clang -dM -E - < /dev/null | grep
> -i LINUX
> #define __gnu_linux__ 1
> #define __linux 1
> #define __linux__ 1
> #define linux 1

okay so that's coming from the compiler, have you tried clang?

> 
> As for the EAPI 6 issue on Portage, thanks for the bug link... I've spent
> about two hours trying to patch it so I can merge Perl.  Now I can just use
> the patch in that bug until the actual fix is committed.

use the overlay i have a quick fix in there.
Comment 7 A. Wilcox (awilfox) 2016-04-17 22:37:02 UTC
Yes, I pulled the patch in from the overlay.  Thanks!

As for clang, it's directly below the gcc output.  Sorry if it wasn't spaced very well, it was a direct copy from my terminal.  The ordering is different but neither one defines __LINUX__.
Comment 8 Anthony Basile gentoo-dev 2016-04-17 22:43:35 UTC
(In reply to Andrew Wilcox (awilfox) from comment #7)
> Yes, I pulled the patch in from the overlay.  Thanks!
> 
> As for clang, it's directly below the gcc output.  Sorry if it wasn't spaced
> very well, it was a direct copy from my terminal.  The ordering is different
> but neither one defines __LINUX__.

doh! humans don't multitask as well as computers.

i'll commit this directly to the overlay.
Comment 9 Anthony Basile gentoo-dev 2016-04-17 23:29:12 UTC
(In reply to Anthony Basile from comment #8)
> 
> i'll commit this directly to the overlay.

i put it on the tree rather than the overlay