Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2044523

Summary: OpenBLAS build error with gcc toolset10
Product: Red Hat Enterprise Linux 8 Reporter: rajis
Component: binutilsAssignee: Nick Clifton <nickc>
binutils sub component: gcc-toolset-10 QA Contact: Miloš Prchlík <mprchlik>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: bergner, dsmith, fweimer, lkuprova, mcermak, mnewsome, mpolacek, mprchlik, ohudlick, sipoyare
Version: 8.5Keywords: Bugfix, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.5   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-toolset-10-binutils-2.35-11.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2044948 (view as bug list) Environment:
Last Closed: 2022-05-10 14:04:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2044948    
Attachments:
Description Flags
AArch64 rpm
none
PPC64LE rpm
none
i686 rpm
none
s390x rpm
none
x86_64 rpm none

Description rajis 2022-01-24 17:57:22 UTC
Description of problem:


Version-Release number of selected component (if applicable):
gcc-toolset-10 on RHEL 8.5

How reproducible:

#include <stdio.h>

int main() {
	float *a;
	__builtin_prefetch(a, 0, 0);
	return 0;
}

$ /opt/rh/gcc-toolset-10/root/usr/bin/cc -c t.c
/tmp/ccDsRow1.s: Assembler messages:
/tmp/ccDsRow1.s:18: Error: junk at end of line: `16'

This affects openblas build.

Comment 2 Marek Polacek 2022-01-24 18:09:54 UTC
This is a binutils problem; I've run into this before.

This happens when using newer binutils; with newer binutils we generate
    dcbt 0,9,16
when building a file in libbacktrace; with older binutils:
    dcbt 0,9 
So clearly gas doesn't grok the first.  I suspect that it's because
gcc-toolset-10-gas doesn't have this patch?
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=97bf40d859ffe44892b3ad2c62f011fd26fca699

Comment 5 Marek Polacek 2022-01-24 21:59:31 UTC
In my previous comment I mentioned libbacktrace, but I just verified this is the same issue:

# gcc -S q.C -o-
	.file	"q.C"
	.machine power8
	.abiversion 2
	.section	".text"
	.align 2
	.globl main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	std 31,-8(1)
	stdu 1,-64(1)
	.cfi_def_cfa_offset 64
	.cfi_offset 31, -8
	mr 31,1
	.cfi_def_cfa_register 31
	ld 9,32(31)
	dcbt 0,9,16               <= here
[...]

Comment 6 Nick Clifton 2022-01-25 11:25:31 UTC
OK, I will import the patch to GTS-10.  GTS-11 also needs a fix, so I will clone this BZ for that.

Comment 8 Nick Clifton 2022-01-25 15:10:53 UTC
Fixed in gcc-toolset-10-binutils-2.35-10.el8

Comment 9 Miloš Prchlík 2022-02-02 11:46:42 UTC
Reproducer shown in description fails even with gcc-toolset-10-binutils-2.35-10.el8:

$ scl enable gcc-toolset-10 bash
$ 
$ cat t.c
#include <stdio.h>

int main() {
        float *a;
        __builtin_prefetch(a, 0, 0);
        return 0;
}
[root@ibm-p9z-23-lp8 ~]# gcc -S -c t.c -o-
        .file   "t.c"
        .machine power8
        .abiversion 2
        .section        ".text"
        .align 2
        .globl main
        .type   main, @function
main:
.LFB0:
        .cfi_startproc
        std 31,-8(1)
        stdu 1,-64(1)
        .cfi_def_cfa_offset 64
        .cfi_offset 31, -8
        mr 31,1
        .cfi_def_cfa_register 31
        ld 9,32(31)
        dcbt 0,9,16
        li 9,0
        mr 3,9
        addi 1,31,64
        .cfi_def_cfa 1, 0
        ld 31,-8(1)
        blr
        .long 0
        .byte 0,0,0,0,128,1,0,1
        .cfi_endproc
.LFE0:
        .size   main,.-main
        .ident  "GCC: (GNU) 10.3.1 20210422 (Red Hat 10.3.1-1)"
        .section        .note.GNU-stack,"",@progbits
$ 
$ 
$ type gcc
gcc is hashed (/opt/rh/gcc-toolset-10/root/usr/bin/gcc)
$ type as
as is /opt/rh/gcc-toolset-10/root/usr/bin/as
$ rpm -qf /opt/rh/gcc-toolset-10/root/usr/bin/as
gcc-toolset-10-binutils-2.35-10.el8.ppc64le
$ rpm -qf /opt/rh/gcc-toolset-10/root/usr/bin/gcc
gcc-toolset-10-gcc-10.3.1-1.2.el8_5.ppc64le
$ 
$ 
$ gcc -v -c t.c
Using built-in specs.
COLLECT_GCC=gcc
Target: ppc64le-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/gcc-toolset-10/root/usr --mandir=/opt/rh/gcc-toolset-10/root/usr/share/man --infodir=/opt/rh/gcc-toolset-10/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-targets=powerpcle-linux --disable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-10.3.1-20210422/obj-ppc64le-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --enable-secureplt --with-long-double-128 --with-cpu-32=power8 --with-tune-32=power8 --with-cpu-64=power8 --with-tune-64=power8 --build=ppc64le-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.3.1 20210422 (Red Hat 10.3.1-1) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=power8' '-mcpu=power8'
 /opt/rh/gcc-toolset-10/root/usr/libexec/gcc/ppc64le-redhat-linux/10/cc1 -quiet -v t.c -msecure-plt -quiet -dumpbase t.c -mtune=power8 -mcpu=power8 -auxbase t -version -o /tmp/ccYMLfrH.s
GNU C17 (GCC) version 10.3.1 20210422 (Red Hat 10.3.1-1) (ppc64le-redhat-linux)
        compiled by GNU C version 10.3.1 20210422 (Red Hat 10.3.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/opt/rh/gcc-toolset-10/root/usr/lib/gcc/ppc64le-redhat-linux/10/include-fixed"
ignoring nonexistent directory "/opt/rh/gcc-toolset-10/root/usr/lib/gcc/ppc64le-redhat-linux/10/../../../../ppc64le-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/rh/gcc-toolset-10/root/usr/lib/gcc/ppc64le-redhat-linux/10/include
 /usr/local/include
 /opt/rh/gcc-toolset-10/root/usr/include
 /usr/include
End of search list.
GNU C17 (GCC) version 10.3.1 20210422 (Red Hat 10.3.1-1) (ppc64le-redhat-linux)
        compiled by GNU C version 10.3.1 20210422 (Red Hat 10.3.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: f8a6b71d6ea91bb71d6a1ba9c03b64ad
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=power8' '-mcpu=power8'
 as -v -a64 -mpower8 -many -mlittle -o t.o /tmp/ccYMLfrH.s
GNU assembler version 2.35 (ppc64le-redhat-linux) using BFD version version 2.35-10.el8
/tmp/ccYMLfrH.s: Assembler messages:
/tmp/ccYMLfrH.s:18: Error: junk at end of line: `16'
$ 


Also, rebuild of openblas-0.3.12-1.el8.src.rpm with gcc-toolset-10 enabled fails, I suppose this is also expected:

[[ "../kernel/power/../arm/znrm2.c" == *.S ]] && CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -funwind-tables -fstack-clash-protection -fPIC -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=128 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.12\" -Ofast -mcpu=power8 -mtune=power8 -mvsx  -fno-fast-math -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=cnrm2_k -DASMFNAME=cnrm2_k_ -DNAME=cnrm2_k_ -DCNAME=cnrm2_k -DCHAR_NAME=\"cnrm2_k_\" -DCHAR_CNAME=\"cnrm2_k\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX -Wa,--generate-missing-build-notes=yes" || CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -funwind-tables -fstack-clash-protection -fPIC -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_WARMUP -DMAX_CPU_NUMBER=128 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.12\" -Ofast -mcpu=power8 -mtune=power8 -mvsx  -fno-fast-math -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=cnrm2_k -DASMFNAME=cnrm2_k_ -DNAME=cnrm2_k_ -DCNAME=cnrm2_k -DCHAR_NAME=\"cnrm2_k_\" -DCHAR_CNAME=\"cnrm2_k\" -DNO_AFFINITY -I.. -UDOUBLE  -DCOMPLEX"; \
gcc $CFLAGS -DCOMPLEX -c -UDOUBLE ../kernel/power/../arm/znrm2.c -o cnrm2_k.o
{standard input}: Assembler messages:
{standard input}:1232: Error: junk at end of line: `16'
{standard input}:1234: Error: junk at end of line: `16'
{standard input}:1242: Error: junk at end of line: `16'
{standard input}:1247: Error: junk at end of line: `16'

Comment 10 Nick Clifton 2022-02-03 11:09:15 UTC
Found it.  A second patch is needed:

https://sourceware.org/bugzilla/show_bug.cgi?id=26513

Testing now...

Comment 11 Miloš Prchlík 2022-02-07 15:27:46 UTC
(In reply to Nick Clifton from comment #10)
> Found it.  A second patch is needed:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=26513
> 
> Testing now...

Good news, both the reproducer and OpenBLAS rebuild are now happy \o/

Comment 12 Miloš Prchlík 2022-02-14 08:14:15 UTC
Verified with gcc-toolset-10-binutils-2.35-11.el8

Comment 14 rajis 2022-03-03 17:42:26 UTC
Is this package gcc-toolset-10-binutils-2.35-11.el8 available anywhere for testing?

Comment 15 Nick Clifton 2022-03-04 10:26:04 UTC
You should find it here:

https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1873912

Comment 16 rajis 2022-03-04 14:24:13 UTC
(In reply to Nick Clifton from comment #15)
> You should find it here:
> 
> https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1873912

I am not able to access this link.

Comment 17 Nick Clifton 2022-03-07 12:03:27 UTC
(In reply to rajis from comment #16)

> > https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1873912
> 
> I am not able to access this link.

Strange - it works for me.  Which rpm(s) do you need ?

Comment 18 rajis 2022-03-07 17:34:20 UTC
(In reply to Nick Clifton from comment #17)
> (In reply to rajis from comment #16)
> 
> > > https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1873912
> > 
> > I am not able to access this link.
> 
> Strange - it works for me.  Which rpm(s) do you need 

gcc-toolset-10-binutils

Comment 25 Nick Clifton 2022-03-09 11:35:57 UTC
(In reply to rajis from comment #18)
 
> > Which rpm(s) do you need 
> 
> gcc-toolset-10-binutils

Sorry - I meant: do you need to the -devel and/or -debuginfo rpms as well as the ordinary rpms ?

I have uploaded the ordinary rpms to this BZ.  I hope that you will be able to download them from here.

Comment 26 rajis 2022-03-09 14:41:02 UTC
I don't see any attachments in this BZ, Can you share the attachment link?

Comment 27 Nick Clifton 2022-03-10 11:24:16 UTC
(In reply to rajis from comment #26)
> I don't see any attachments in this BZ, Can you share the attachment link?

I think that the problem was that the "private" flag was set on the attachments.  Please could you try checking to see if they are now visible to you ?

Comment 28 rajis 2022-03-10 20:50:16 UTC
(In reply to Nick Clifton from comment #27)
> (In reply to rajis from comment #26)
> > I don't see any attachments in this BZ, Can you share the attachment link?
> 
> I think that the problem was that the "private" flag was set on the
> attachments.  Please could you try checking to see if they are now visible
> to you ?

Yes. It works now. Able to compile OpenBLAS with this Binutils version on POWER. Thanks.

Comment 30 errata-xmlrpc 2022-05-10 14:04:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gcc-toolset-10-binutils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1872