Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 658466 - net-libs/libbloom - Pass CC and BITS to ebuild for cross compilation
Summary: net-libs/libbloom - Pass CC and BITS to ebuild for cross compilation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Yixun Lan
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on:
Blocks:
 
Reported: 2018-06-19 08:48 UTC by Zhaofeng Li
Modified: 2018-10-13 09:46 UTC (History)
2 users (show)

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


Attachments
The proposed ebuild (libbloom-1.5.ebuild,544 bytes, text/plain)
2018-06-19 08:48 UTC, Zhaofeng Li
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zhaofeng Li 2018-06-19 08:48:07 UTC
Created attachment 536312 [details]
The proposed ebuild

Hi,

This update to libbloom-1.5.ebuild fixes two problems regarding cross compilation:

1. The Makefile uses $(CC) as the compiler, which is not set correctly by default. The proposed ebuild sets CC=$(tc-getCC).

2. The Makefile sets -m64 when $(BITS) is not set, which will cause compilation to fail on 32-bit targets (such as ppc32). The proposed ebuild sets BITS=default, so that the Makefile will not force -m32 or -m64.

Reference: https://github.com/jvirkki/libbloom/blob/42d6ac0cf4e597c28e6bd2a035a30e5938f8f58a/Makefile#L38

The new ebuild has been tested to build on x86_64, powerpc (via cross-emerge on x86_64), and powerpc (native).
Comment 1 Larry the Git Cow gentoo-dev 2018-10-13 09:44:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5334c986122aabfefc272f4d97de1753750ae3ad

commit 5334c986122aabfefc272f4d97de1753750ae3ad
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-10-13 07:44:59 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-10-13 09:44:12 +0000

    net-libs/libbloom: fix build on 32-bit systems
    
    The change adapts build system to be friendlier to Gentoo envorinment:
    - avoid passing '-m64' unconditionally. Fixes build on ARCH=x86.
    - avoid passing -O3 unconditionally. Rely on users' optimization flags.
    - pass user's CC. Fixes simple cross-compilation case.
    
    Patch by Zhaofeng Li.
    
    Closes: https://bugs.gentoo.org/658466
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 net-libs/libbloom/{libbloom-1.5.ebuild => libbloom-1.5-r1.ebuild} | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-13 09:46:26 UTC
Looks goood! I also overrode OPT= to drop unconditional -O3.

Thank you!