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

Bug 851831

Summary: sys-boot/grub-2.06-r2: clang-14: error: optimization flag '-falign-jumps=1' is not supported
Product: Gentoo Linux Reporter: nvinson234
Component: Current packagesAssignee: Mike Gilbert <floppym>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, demiancarvalho
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 408963    
Attachments: build.log
config.log
grub-2.06-falign.patch

Description nvinson234 2022-06-14 06:59:58 UTC
sys-boot/grub-2.06-r2 fails to configure because '-falign-jumps=1' is incorrectly added to CFLAGS.

Reproducible: Always

Steps to Reproduce:
1. build grub 2.06-r2 with clang-14
2. observe build failure
3. examine configure.log
Actual Results:  
grub fails to configure with error 'configure: error: could not force soft-float'.  Analysis of config.log shows this is because 'falign-jumps=1' was added to CFLAGS.

Expected Results:  
grub configures and builds succssfully
Comment 1 nvinson234 2022-06-14 07:01:39 UTC
Created attachment 784724 [details]
build.log
Comment 2 nvinson234 2022-06-14 07:01:58 UTC
Created attachment 784727 [details]
config.log
Comment 3 nvinson234 2022-06-14 07:03:41 UTC
Created attachment 784730 [details, diff]
grub-2.06-falign.patch

Patch to fix the issue. Changes backported from upstream's configure.ac.
Comment 4 Mike Gilbert gentoo-dev 2022-06-16 16:12:17 UTC
Please provide a link to the upstream commit that adjusted configure.ac.
Comment 6 Oskari Pirhonen 2022-06-18 00:57:25 UTC
It actually seems to be a combination of that one and the previous one.

eb4868 - configure: Remove obsoleted -malign-{jumps, loops, functions}
e372dc - configure: Check for -falign-jumps=1 beside -falign-loops=1

Links to the other commit too:

https://git.savannah.gnu.org/cgit/grub.git/commit/?id=eb486898dac8cbc29b2cc39f911b657c3417ae34
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-20 14:27:07 UTC
*** Bug 853178 has been marked as a duplicate of this bug. ***
Comment 8 Mike Gilbert gentoo-dev 2022-06-20 15:05:18 UTC
(In reply to Oskari Pirhonen from comment #6)

Thanks for the tip.
Comment 9 Larry the Git Cow gentoo-dev 2022-06-20 15:10:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=830e49d291888e4d9ef8fec431a104f7cf9d1e21

commit 830e49d291888e4d9ef8fec431a104f7cf9d1e21
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-06-20 15:08:49 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-06-20 15:08:57 +0000

    sys-boot/grub: backport changes to fix build with clang
    
    Closes: https://bugs.gentoo.org/851831
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-boot/grub/Manifest            | 2 +-
 sys-boot/grub/grub-2.06-r2.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)