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

Bug 566930

Summary: sys-boot/refind: Does not respect {C,LD}{,FLAGS}
Product: Gentoo Linux Reporter: . <dev.rindeal+gentoo>
Component: Current packagesAssignee: Sam Jorna (wraeth) <wraeth>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint, sveyret
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 563226, 569806    
Attachments: build.log
refind-0.10.0.ebuild.patch
refind-0.10.0.ebuild.patch
refind-0.10.0.ebuild.patch
refind-0.10.0-r1:build.log
Build rEFInd using user defined flags
Build rEFInd using user defined flags
Build rEFInd using user defined flags (gnuefi only)
Build rEFInd using user defined flags

Description . 2015-11-26 17:20:59 UTC
The build process doesn't contain any configure script, just Makefiles with hardcoded values for CC, CXX and other flags.
Comment 1 Sam Jorna (wraeth) gentoo-dev 2015-12-02 14:00:09 UTC
Created attachment 418350 [details]
build.log

Note that it is often useful to attach a build.log for the failing build so that an example of a broken instance is available and can be used for diagnosing issues.
Comment 2 Sam Jorna (wraeth) gentoo-dev 2015-12-02 14:01:26 UTC
Created attachment 418352 [details, diff]
refind-0.10.0.ebuild.patch

Adds eclasses and wrappers for respecting CC/CXX/CFLAGS during build.
Comment 3 Sam Jorna (wraeth) gentoo-dev 2015-12-05 09:54:37 UTC
Created attachment 418588 [details, diff]
refind-0.10.0.ebuild.patch

Slightly modified version of attachment 418352 [details, diff] that addresses a QA warning about adding preprocessor flags to CXXFLAGS.
Comment 4 Sam Jorna (wraeth) gentoo-dev 2015-12-24 08:02:35 UTC
My testing of this seems to show that it works fine, however I would appreciate anyone else willing to test the built binaries from this to ensure altering CC/CFLAGS/etc has no unexpected affects before this is committed to the tree.
Comment 5 . 2015-12-25 17:19:02 UTC
Created attachment 420790 [details, diff]
refind-0.10.0.ebuild.patch

No, your patch doesn't fixes it, mainly because you're using CXX{,FLAGS} while refind doesn't contain any C++ code.

So here's my patch that actually fixes the build for me.
Comment 6 Sam Jorna (wraeth) gentoo-dev 2015-12-28 11:51:29 UTC
Created attachment 420982 [details]
refind-0.10.0-r1:build.log

rindeal, thanks for your patch. This does appear to fix it however it does produce a number of warnings during compile (see attached build.log) - I'm not sure what impact these may have on the built binaries so again would appreciate further testing.

Also, this patch resolves the problem with this version, however refind-0.10.1 (bug 569806 ) includes changes to the build environment which makes this patch cause build failures.
Comment 7 . 2015-12-28 18:01:40 UTC
AFAIK, GCC becomes stricter and stricter each version so if the code uses some hacks and you're compiling it with v5.3 it emits lots of warnings. Maybe try fiddling with -std= flags and see if that helps.

I'm currently not at my machine so I cannot investigate the build failures of v0.10.1.
Comment 8 . 2016-01-05 13:04:07 UTC
So,

1) adding "-Wno-incompatible-pointer-types" to CFLAGS helps with 99% of warnings.

2) v0.10.1 fails with my patch, because its Makefiles ignore LDFLAGS.
Comment 9 Sam Jorna (wraeth) gentoo-dev 2016-01-10 03:34:14 UTC
(In reply to rindeal from comment #8)
> 1) adding "-Wno-incompatible-pointer-types" to CFLAGS helps with 99% of
> warnings.

Using the ebuild produced from attachment 420790 [details, diff] with the additional "-Wno-incompatible-pointer-types" allows the build to complete with fewer warnings, however the built EFI executable refuses to load on my system.
Comment 10 Stéphane Veyret 2016-07-09 15:29:29 UTC
Created attachment 440188 [details, diff]
Build rEFInd using user defined flags

This proposed patch is made for version 0.10.2 (and could also be a correction for bug 563226) and is TianoCore aware, so requires patch of bug 588440 to be integrated in the portage tree. I will provide another patch without this requirement.
Comment 11 Stéphane Veyret 2016-07-10 06:53:39 UTC
Created attachment 440240 [details, diff]
Build rEFInd using user defined flags

Sorry, there was a tipo in my previous patch. Here is a corrected one.
Comment 12 Stéphane Veyret 2016-07-10 06:58:39 UTC
Created attachment 440242 [details, diff]
Build rEFInd using user defined flags (gnuefi only)

Here is the same patch working only with GNU EFI (cannot be built using TianoCore, so not requiring correction of bug 588440). Note that this patch is only the previous one from which TianoCore references have been removed. No tests where done on it.
Comment 13 Stéphane Veyret 2016-07-17 17:30:40 UTC
Created attachment 440952 [details, diff]
Build rEFInd using user defined flags

Test flags before adding them.
Comment 14 Stéphane Veyret 2016-07-20 09:16:33 UTC
Also created a PR:
ahttps://github.com/gentoo/gentoo/pull/1921
Comment 15 Pacho Ramos gentoo-dev 2016-10-15 09:30:42 UTC
Any news on this? Thanks