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

Bug 539210

Summary: dev-lang/python-{2.7.8,2.7.9-r1} with sys-libs/musl - In file included from .../work/Python-2.7.9/Modules/python.c:11:0: /usr/include/sys/prctl.h:88:8: error: redefinition of ‘struct prctl_mm_map’
Product: Gentoo Linux Reporter: James Taylor <james>
Component: [OLD] DevelopmentAssignee: Python Gentoo Team <python>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: python-2.7.9-r1 build.log
musl sys/prctl.h

Description James Taylor 2015-02-07 10:52:57 UTC
Created attachment 395770 [details]
python-2.7.9-r1 build.log

Python-2.7 fails to build under musl-libc 1.1.6 due to a duplicate include in Modules/python.c, as follows:

#ifdef __linux__
#include <linux/prctl.h>
#include <sys/prctl.h>
#ifndef PR_SET_NAME
#define PR_SET_NAME 15

This causes a compilation error since musl exports structs in sys/prctl.h which conflict with the ones from the linux headers.

Steps to Reproduce:

Set up a system using the musl stage3 according to the wiki, then attempt to rebuild python-2.7

Expected result:
Python-2.7 would build and be installed with no errors

Actual result:
Build fails (log attached)

Comment 1 James Taylor 2015-02-07 10:53:48 UTC
Created attachment 395772 [details]
musl sys/prctl.h
Comment 2 Felix Janda 2015-02-07 11:58:20 UTC
The offending code is from 61_all_process_data.patch in python-gentoo-patches-2.7.9-0. I would suggest just removing the <linux/prctl.h> include since prctl() is not declared there.
Comment 3 Mike Gilbert gentoo-dev 2015-02-07 21:24:34 UTC
+*python-2.7.9-r2 (07 Feb 2015)
+  07 Feb 2015; Mike Gilbert <> +python-2.7.9-r2.ebuild:
+  Drop 61_all_process_data.patch, fixes musl build, bug 539210.
Comment 4 Travis Tilley 2015-03-25 16:01:35 UTC
The exact same issue exists in python 3.3.5.
Comment 5 Travis Tilley 2015-03-25 16:07:45 UTC
If i add this patch to EPATCH_EXCLUDE then python 3.3.5 compiles with musl again. Any chance we can have this fix applied to 3.3.5?