Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 576036 - >=dev-util/boost-build-1.58 and dev-libs/boost overriding CFLAGS (x32 breakage)
Summary: >=dev-util/boost-build-1.58 and dev-libs/boost overriding CFLAGS (x32 breakage)
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: David Seifert
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: x32
  Show dependency tree
 
Reported: 2016-02-29 20:18 UTC by Steven Newbury
Modified: 2023-08-23 08:56 UTC (History)
2 users (show)

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


Attachments
boost-build ebuild with new sed pass and patches (boost-build-1.58.0.ebuild,4.07 KB, text/plain)
2016-02-29 20:52 UTC, Steven Newbury
Details
Add libx32 to search paths (boost-build-1.58.0-x32.patch,1.17 KB, patch)
2016-02-29 20:54 UTC, Steven Newbury
Details | Diff
Remove -m32/-m64 automagic flags (boost-build-1.58.0-no-setup-gcc-address-model.patch,753 bytes, patch)
2016-02-29 20:56 UTC, Steven Newbury
Details | Diff
dev-libs/boost ebuild with new patches (boost-1.58.0-r1.ebuild,12.27 KB, text/plain)
2016-02-29 20:59 UTC, Steven Newbury
Details
Back-ported x32 context patch from upstream (boost-1.58.0-x32-context.patch,1.40 KB, patch)
2016-02-29 21:01 UTC, Steven Newbury
Details | Diff
Remove -march overrides on SSSE and AVX compile (boost-1.58.0-no-march.patch,848 bytes, patch)
2016-02-29 21:02 UTC, Steven Newbury
Details | Diff
dev-util/boost-build ebuild with x32 patch (boost-build-1.79.0.ebuild,2.17 KB, text/plain)
2022-05-01 21:07 UTC, Steven Newbury
Details
Add libx32 to search paths (boost-build-1.58.0-x32.patch,1.18 KB, patch)
2022-05-01 21:10 UTC, Steven Newbury
Details | Diff
Remove -m32/-m64 automagic flags (boost-build-9999-no-setup-gcc-address-model-r1.patch,583 bytes, patch)
2022-05-01 21:11 UTC, Steven Newbury
Details | Diff
dev-libs/boost ebuild with new patches and abi override (boost-1.79.0.ebuild,10.62 KB, text/plain)
2022-05-01 21:12 UTC, Steven Newbury
Details
x32 context support patch (boost-1.66.0-x32-context.patch,791 bytes, patch)
2022-05-01 21:15 UTC, Steven Newbury
Details | Diff
dev-libs/boost ebuild with new patches and abi override (boost-1.79.0.ebuild,10.61 KB, text/plain)
2022-05-09 09:26 UTC, Steven Newbury
Details
x32 context support patch (boost-1.66.0-x32-context.patch,785 bytes, patch)
2022-05-09 09:40 UTC, Steven Newbury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Newbury 2016-02-29 20:18:08 UTC
I'm not sure from which version when it started, but boost-build currently overrides -march and -m32/-m64 by default, no matter what is supplied though the ebuild.

Furthermore, in order to support run-time SSSE and AVX detection, dev-libs/boost again overrides -march to CPU types supporting those instruction-sets.

This doesn't itself prevent a successful emerge on x86 and/or amd64/multilib, but is fatal to x32, since boost-build attempts to use -march=i686 and -m32 in this case.

This behaviour also prevents the use of LTO optimization on non-intel or core-avx-i or earlier, this is due to GCC being unable to use more than one -march= for a given compilation unit, which is the whole-program with LTO, and attempts to use -march=core-avx-i on incompatible CPUs.

My solution is to remove all the support from dev-util/boost-build and dev-libs/boost for automagic -march= and -m32/-m64 selection for gcc.

I've also back-ported the experimental x32 support from boost/develop branch which supersedes the version in the portage tree.
Comment 1 Steven Newbury 2016-02-29 20:52:54 UTC
Created attachment 427032 [details]
boost-build ebuild with new sed pass and patches
Comment 2 Steven Newbury 2016-02-29 20:54:58 UTC
Created attachment 427034 [details, diff]
Add libx32 to search paths
Comment 3 Steven Newbury 2016-02-29 20:56:18 UTC
Created attachment 427036 [details, diff]
Remove -m32/-m64 automagic flags
Comment 4 Steven Newbury 2016-02-29 20:59:38 UTC
Created attachment 427044 [details]
dev-libs/boost ebuild with new patches
Comment 5 Steven Newbury 2016-02-29 21:01:05 UTC
Created attachment 427046 [details, diff]
Back-ported x32 context patch from upstream
Comment 6 Steven Newbury 2016-02-29 21:02:14 UTC
Created attachment 427048 [details, diff]
Remove -march overrides on SSSE and AVX compile
Comment 7 David Seifert gentoo-dev 2017-04-04 18:01:06 UTC
Obsolete, reopen if issue persists.

commit 400e20295bf062a0bf697acce718e78116b143e2
Author: David Seifert <soap@gentoo.org>
Date:   Tue Apr 4 19:33:14 2017 +0200

    dev-libs/boost: Remove old
Comment 8 Will Simoneau 2019-02-27 19:40:08 UTC
This is still a problem today with dev-libs/boost-1.65.0 on x32.
Comment 9 Steven Newbury 2022-05-01 21:04:49 UTC
This is still an issue.  I've been maintaining the patches ever since.

Currently when building on x32 dev-libs/boost builds i386 binaries instead of x32.

Current ebuild/patches follow...
Comment 10 Steven Newbury 2022-05-01 21:07:20 UTC
Created attachment 775808 [details]
dev-util/boost-build ebuild with x32 patch
Comment 11 Steven Newbury 2022-05-01 21:10:39 UTC
Created attachment 775811 [details, diff]
Add libx32 to search paths
Comment 12 Steven Newbury 2022-05-01 21:11:26 UTC
Created attachment 775814 [details, diff]
Remove -m32/-m64 automagic flags
Comment 13 Steven Newbury 2022-05-01 21:12:39 UTC
Created attachment 775817 [details]
dev-libs/boost ebuild with new patches and abi override
Comment 14 Steven Newbury 2022-05-01 21:15:18 UTC
Created attachment 775820 [details, diff]
x32 context support patch
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-02 02:05:00 UTC
(In reply to Steven Newbury from comment #14)
> Created attachment 775820 [details, diff] [details, diff]
> x32 context support patch

Could you submit this upstream to https://github.com/boostorg/context?
Comment 16 Steven Newbury 2022-05-09 09:15:32 UTC
In the latest version attached above I used 32_64 for the address-model to differentiate from x86-32, however this breaks the build of packages using boost_python since the boost_python cmake file then determines that the boost libraries are 64 bit.

I'll attach new versions using address-model = 32 instead once I confirm that it resolves this issue.  It's how I originally wrote the patch.
Comment 17 Steven Newbury 2022-05-09 09:21:50 UTC
(In reply to Sam James from comment #15)
> (In reply to Steven Newbury from comment #14)
> > Created attachment 775820 [details, diff] [details, diff] [details, diff]
> > x32 context support patch
> 
> Could you submit this upstream to https://github.com/boostorg/context?

I did originally.  As I recall it got side tracked by discussion about forcing gcc flags instead of using the user provided flags and feature tests and/or function attributes, and the weren't very receptive.  I guess it was nearly a decade ago, maybe I should try again...?
Comment 18 Steven Newbury 2022-05-09 09:26:41 UTC
Created attachment 777722 [details]
dev-libs/boost ebuild with new patches and abi override
Comment 19 Steven Newbury 2022-05-09 09:40:00 UTC
Created attachment 777725 [details, diff]
x32 context support patch
Comment 20 David Seifert gentoo-dev 2023-08-14 09:23:36 UTC
(In reply to Steven Newbury from comment #19)
> Created attachment 777725 [details, diff] [details, diff]
> x32 context support patch

https://github.com/boostorg/context/blob/develop/build/Jamfile.v2#L843

isn't that code identical to your patch? Do you we really still need your patch?
Comment 21 David Seifert gentoo-dev 2023-08-23 08:56:21 UTC
Closing since I believe this to be upstreamed now