Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 596798 - app-emulation/xen-tools: failure in configuration phase (compiled by gcc), if dev-lang/python-2.7 was compiled by clang
Summary: app-emulation/xen-tools: failure in configuration phase (compiled by gcc), if...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Xen Devs
Depends on:
Reported: 2016-10-10 20:23 UTC by Jiří Moravec
Modified: 2019-05-10 14:36 UTC (History)
3 users (show)

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

GCC is failing with -OPT:Olimit=0 argument, clang just ignore it (python-2.7.12-Olimit.patch,520 bytes, patch)
2016-10-10 20:54 UTC, Jiří Moravec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Moravec 2016-10-10 20:23:59 UTC
After dev-lang/python-2.7 package was compiled with clang, compilation of app-emulation/xen-tools with gcc failed in configuration phase with msg:
configure: error: Unable to find Python development headers
configure: error: ./configure failed for tools

Reproducible: Always

Steps to Reproduce:
1. compile dev-lang/python-2.7 with clang
2. compile app-emulation/xen-tools with gcc

Actual Results:  
configure within .../portage/app-emulation/xen-tools-4.7.0-r2/work/xen-4.7.0/tools directory failed with:
checking for PyArg_ParseTuple in -lpython... no
configure: error: Unable to find a suitable python development library

Expected Results:  
xen-tools compiled without problem

default compiler: gcc
.../package.env/use-clang:dev-lang/python compiler-clang.conf

Comment python-2.7.10-cross-compile-warn-test.patch in ebuild!
Comment 1 Jiří Moravec 2016-10-10 20:54:53 UTC
Created attachment 449782 [details, diff]
GCC is failing with -OPT:Olimit=0 argument, clang just ignore it

Actually I needed just another patch for python-2.7.
More in
It's looking like different manifestation of the same cause.

Clang just ignore '-OPT:Olimit=0' argument, so if python is compiled with clang everything is OK. But this argument is then used when xen-tools package is compiled and if gcc is used, then error is throwned out because gcc is not ignoring '-OPT:Olimit=0'! :-(
Comment 2 Yixun Lan archtester gentoo-dev 2016-10-11 07:20:36 UTC
well, if you are using xen, please stick to gcc

I don't think Xen upstream support clang (even build python with clang).
Comment 3 Anton Bolshakov 2017-07-27 02:38:30 UTC

A similar issue has been reported to us:

FYI, to highlight the fact that other packages might be affected.

It might be an upstream python bug but users need a workaround (like a freebsd?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-05-09 13:20:21 UTC
Well, it's actually quite a curious bug.  Normally, clang reports this as an erroneous option:

$ clang-8 -OPT:Olimit=0 -x c -; echo $?
error: invalid integral value 'PT:Olimit=0' in '-OPT:Olimit=0'
error: invalid integral value 'PT:Olimit=0' in '-OPT:Olimit=0'

However, if you pass -O2 following it, it ignores the previous value.

However, that is not the only bug in question here.  The more important issue is xen-tools configure script taking 'python-config --cflags' which is plain wrong.  It should be using 'python-config --includes' instead.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-05-09 13:28:14 UTC
FWICS upstream removed the use of this flag in py3.2a4, so nothing to report upstream.  I'll patch it out in our Python ebuild.

I'll leave the bug open for xen-tools maintainers to replace wrong use of 'python-config --cflags'.
Comment 6 Larry the Git Cow gentoo-dev 2019-05-10 14:36:13 UTC
The bug has been referenced in the following commit(s):

commit e1d806dae10cf0fb34aa2778eabed2869b8eece8
Author:     Michał Górny <>
AuthorDate: 2019-05-09 13:29:10 +0000
Commit:     Michał Górny <>
CommitDate: 2019-05-10 14:35:55 +0000

    dev-lang/python: Force-off -OPT:Olimit=0 in 2.7 to unbreak clang+gcc
    Signed-off-by: Michał Górny <>

 dev-lang/python/python-2.7.16.ebuild | 5 +++++
 1 file changed, 5 insertions(+)