Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835738 - dev-libs/libxml2 with USE=python and ABI_X86="32 64" fails to build: /usr/include/python3.8/pyport.h:726:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
Summary: dev-libs/libxml2 with USE=python and ABI_X86="32 64" fails to build: /usr/inc...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sam James
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-21 12:58 UTC by Thomas Sachau
Modified: 2022-03-22 20:22 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,111.53 KB, text/plain)
2022-03-21 12:59 UTC, Thomas Sachau
Details
build.log (sam, successful build) (file_835738.txt,236.78 KB, text/plain)
2022-03-21 17:38 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Sachau gentoo-dev 2022-03-21 12:58:50 UTC
The 32bit version of libxml2 fails because it tries to build against 64bit headers of python. Proper solution would be a 32bit version of all python packages with multilib wrapped headers.
Comment 1 Thomas Sachau gentoo-dev 2022-03-21 12:59:47 UTC
Created attachment 767510 [details]
build.log
Comment 2 David Seifert gentoo-dev 2022-03-21 13:13:26 UTC
Is this using your unsupported multilib fork of portage again?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-21 14:55:59 UTC
Please review open bugs first.

Also, while I'm fine with multilib-portage bugs, including instructions on how to reproduce and flagging this up would be polite.

*** This bug has been marked as a duplicate of bug 582130 ***
Comment 4 Thomas Sachau gentoo-dev 2022-03-21 17:27:11 UTC
(In reply to David Seifert from comment #2)
> Is this using your unsupported multilib fork of portage again?

How about you check the bug content including the build.log yourself? Maybe even just enable the mentioned flags from the summary and try the build?
Comment 5 Thomas Sachau gentoo-dev 2022-03-21 17:31:49 UTC
(In reply to Sam James from comment #3)
> Please review open bugs first.
> 
> Also, while I'm fine with multilib-portage bugs, including instructions on
> how to reproduce and flagging this up would be polite.
> 
> *** This bug has been marked as a duplicate of bug 582130 ***

I did review that bug. It is not a duplicate because bug 582130 is about cross-compiling (with a cross-toolchain) libxml2 while this one is about building the second abi with multilib-eclass.

Bug 582130 is rather easy to fix as you have a full cross-compiled python on the target platform. The issue with multilib-eclass is, that there is no full multilib python on amd64. Since the python headers are 64bit, you run into issues, when you want to build 32bit libxml2 against them.

Unless there are additional factors i dont know, just enable the mentioned flags from the summary and you should get the error message when building the 32bit version of libxml2.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-21 17:37:31 UTC
(In reply to Thomas Sachau from comment #5)
> (In reply to Sam James from comment #3)
> > Please review open bugs first.
> > 
> > Also, while I'm fine with multilib-portage bugs, including instructions on
> > how to reproduce and flagging this up would be polite.
> > 
> > *** This bug has been marked as a duplicate of bug 582130 ***
> 
> I did review that bug. It is not a duplicate because bug 582130 is about
> cross-compiling (with a cross-toolchain) libxml2 while this one is about
> building the second abi with multilib-eclass.
> 

Isn't the whole thing with multilib-portage that it does multilib in a "more cross environment"?

I build everything with ABI_X86_32 and I haven't hit this outside of cross-compilation (which is bug 582130).

> Bug 582130 is rather easy to fix as you have a full cross-compiled python on
> the target platform. The issue with multilib-eclass is, that there is no
> full multilib python on amd64. Since the python headers are 64bit, you run
> into issues, when you want to build 32bit libxml2 against them.

Can you please give a patch then?

> 
> Unless there are additional factors i dont know, just enable the mentioned
> flags from the summary and you should get the error message when building
> the 32bit version of libxml2.

These flags match how I normally build libxml2 and it works fine. Log is attached.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-21 17:38:17 UTC
Created attachment 767527 [details]
build.log (sam, successful build)
Comment 8 David Seifert gentoo-dev 2022-03-21 18:09:51 UTC
(In reply to Thomas Sachau from comment #4)
> (In reply to David Seifert from comment #2)
> > Is this using your unsupported multilib fork of portage again?
> 
> How about you check the bug content including the build.log yourself? Maybe
> even just enable the mentioned flags from the summary and try the build?

I have USE="python" and ABI_X86="32 64" enabled globally. But I've tried it again just to be 200% sure, and guess what? It works just fine, no issues.

Now to the actual question: why do you file these bugs and never mention that you're using portage-multilib?
Comment 9 Mike Gilbert gentoo-dev 2022-03-22 20:22:12 UTC
The Python bindings should get build for the native ABI only:

    if multilib_is_native_abi && use python ; then
        python_foreach_impl libxml2_py_configure
    fi

This code works fine on base portage.

> Proper solution would be a 32bit version of all python packages with multilib wrapped headers.

Implementing multilib python would introduce a lot of complexity for nearly no benefit.