Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 881131 - sys-boot/refind-0.13.3.1 - clang-15: error: unknown argument: -fno-tree-loop-distribute-patterns
Summary: sys-boot/refind-0.13.3.1 - clang-15: error: unknown argument: -fno-tree-loop-...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2022-11-12 18:08 UTC by Toralf Förster
Modified: 2023-09-14 04:44 UTC (History)
3 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,17.86 KB, text/plain)
2022-11-12 18:08 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,105.25 KB, text/plain)
2022-11-12 18:08 UTC, Toralf Förster
Details
environment (environment,66.06 KB, text/plain)
2022-11-12 18:08 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,702 bytes, application/x-bzip)
2022-11-12 18:08 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,13.04 KB, application/x-bzip)
2022-11-12 18:08 UTC, Toralf Förster
Details
sys-boot:refind-0.13.3.1:20221112-130908.log (sys-boot:refind-0.13.3.1:20221112-130908.log,5.03 KB, text/plain)
2022-11-12 18:08 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,18.31 KB, application/x-bzip)
2022-11-12 18:08 UTC, Toralf Förster
Details
Patch to work around unnecessary optimisation and non-standard c. (refind-clang.patch,1.19 KB, patch)
2023-06-27 17:33 UTC, Guillaume de Volpiano
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-11-12 18:08:21 UTC
make[2]: Entering directory '/var/tmp/portage/sys-boot/refind-0.13.3.1/work/refind-0.13.3.1/filesystems'
make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
clang -Os -fno-strict-aliasing -fno-tree-loop-distribute-patterns -fno-stack-protector -fshort-wchar -Wall -fno-PIE -DEFIX64 -DEFI_FUNCTION_WRAPPER -m64 -mno-red-zone  -fpic -I/usr/include/efi -I/usr/include/efi/x86_64 -I/usr/include/efi/protocol -I../include -I../refind -I../libeg -I../mok -DFSTYPE=ext2 -I.  "-DEFIAPI=__attribute__((ms_abi))"  \
      -D__MAKEWITH_GNUEFI -c fsw_ext2.c -o fsw_ext2.o
clang-15: error: unknown argument: '-fno-tree-loop-distribute-patterns'
clang-15: error: unknown argument: '-fno-tree-loop-distribute-patterns'
clang-15: error: unknown argument: '-fno-tree-loop-distribute-patterns'

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_hardened-j4-20221111-181859

  -------------------------------------------------------------------

GNUMAKEFLAGS="$GNUMAKEFLAGS --jobserver-style=pipe"
GNUMAKEFLAGS="$GNUMAKEFLAGS --shuffle"
CC=clang
CXX=clang++
gcc-config -l:
 [1] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 15.0.4
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.4
Python 3.10.8
Available Ruby profiles:
  (none found)
Available Rust versions:
  [1]   rust-bin-1.65.0 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JDK 17.0.5_p8 [openjdk-bin-17]
2)	Eclipse Temurin JDK 8.352_p08 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-17  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):

  HEAD of ::gentoo
commit ddcce5583933141d900dffa1fc81f375b1ab1cd5
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Nov 12 12:16:53 2022 +0000

    2022-11-12 12:16:52 UTC

emerge -qpvO sys-boot/refind
[ebuild  N    ] sys-boot/refind-0.13.3.1  USE="ext2 ext4 iso9660 -btrfs (-custom-cflags) -doc -hfs -ntfs -reiserfs"
Comment 1 Toralf Förster gentoo-dev 2022-11-12 18:08:23 UTC
Created attachment 832049 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-11-12 18:08:24 UTC
Created attachment 832051 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2022-11-12 18:08:26 UTC
Created attachment 832053 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-11-12 18:08:27 UTC
Created attachment 832055 [details]
etc.clang.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-11-12 18:08:28 UTC
Created attachment 832057 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-11-12 18:08:29 UTC
Created attachment 832059 [details]
sys-boot:refind-0.13.3.1:20221112-130908.log
Comment 7 Toralf Förster gentoo-dev 2022-11-12 18:08:30 UTC
Created attachment 832061 [details]
temp.tar.bz2
Comment 8 Guillaume de Volpiano 2023-06-27 17:32:39 UTC
Sadly,I'm afraid that this bug isn't going to be fixable without involvement from upstream. It is possible to work around this issue and another where the code is "sloppy" by clang standards (see patch), but there is a larger issue where objcopy accepts custom bfdnames in --target, where llvm-objcopy only accepts supported formats, and refind uses a custom format.
Comment 9 Guillaume de Volpiano 2023-06-27 17:33:50 UTC
Created attachment 864730 [details, diff]
Patch to work around unnecessary optimisation and non-standard c.

This is not a complete fix
Comment 10 Larry the Git Cow gentoo-dev 2023-09-14 04:43:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=797977a54c63876d010635d5d8431798396e9b15

commit 797977a54c63876d010635d5d8431798396e9b15
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2023-09-10 12:29:17 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2023-09-14 04:39:01 +0000

    sys-boot/refind: fix compilation with clang
    
    Compiling with clang works.
    Linking with lld produces broken executables (including the drivers).
    llvm-objcopy does not support the output format needed by refind.
    
    Try to force ld.bfd and binutils objcopy.  Fail otherwise.
    
    Bug: https://bugs.gentoo.org/732256
    Bug: https://bugs.gentoo.org/832018
    Bug: https://bugs.gentoo.org/881131
    Closes: https://github.com/gentoo/gentoo/pull/32710
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 sys-boot/refind/files/refind-0.14.0.2-clang.patch |  62 +++++++++
 sys-boot/refind/refind-0.14.0.2-r1.ebuild         | 160 ++++++++++++++++++++++
 2 files changed, 222 insertions(+)