Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1610361

Summary: devtoolset-8-strace FTBFS in rhel-7 x86_64
Product: Red Hat Developer Toolset Reporter: Edjunior Barbosa Machado <emachado>
Component: straceAssignee: Eugene Syromiatnikov <esyr>
Status: CLOSED ERRATA QA Contact: Edjunior Barbosa Machado <emachado>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 8.0 RHEL 7CC: dj, kanderso, mnewsome
Target Milestone: alpha   
Target Release: 8.0   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: devtoolset-8-strace-4.23-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-13 08:40:11 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:
Attachments:
Description Flags
output from rpmbuild --rebuild devtoolset-8-strace-4.23-3.el7.src.rpm none

Description Edjunior Barbosa Machado 2018-07-31 13:41:32 UTC
Created attachment 1471801 [details]
output from rpmbuild --rebuild devtoolset-8-strace-4.23-3.el7.src.rpm

Description of problem:
devtoolset-8-strace-4.23-3.el7 fails to build from srpm on current rhel-7.6 x86_64 due to several errors when running %check for tests-m32.

It is also reproducible on previous rhel-7.5 and 7.4.

Version-Release number of selected component (if applicable):
devtoolset-8-strace-4.23-3.el7.src.rpm

How reproducible:
100%

Steps to Reproduce:
1. rpmbuild --rebuild devtoolset-8-strace-4.23-3.el7.src.rpm

Actual results:
(...)
gcc -std=gnu99 -DHAVE_CONFIG_H   -DMPERS_IS_m32 -m32 -I. -I../linux/i386 -I../linux/i386 -I../linux -I../linux -I.. -I.. -DTESTS_SIZEOF_KERNEL_LONG_T=4 -DTESTS_SIZEOF_LONG=4  -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -c -o wait4-v.o wait4-v.c
gcc -std=gnu99 -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -DMPERS_IS_m32 -m32 -Wl,-z,relro  -o wait4-v wait4-v.o libtests.a 
/usr/bin/ld: i386:x86-64 architecture of input file `wait4-v.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-errno2name.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-error_msg.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-tail_alloc.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-tprintf.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-get_page_size.o)' is incompatible with i386 output
/usr/bin/ld: wait4-v.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
make[4]: *** [wait4-v] Error 1
gcc -std=gnu99 -DHAVE_CONFIG_H   -DMPERS_IS_m32 -m32 -I. -I../linux/i386 -I../linux/i386 -I../linux -I../linux -I.. -I.. -DTESTS_SIZEOF_KERNEL_LONG_T=4 -DTESTS_SIZEOF_LONG=4  -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -c -o waitid-v.o waitid-v.c
gcc -std=gnu99 -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -DMPERS_IS_m32 -m32 -Wl,-z,relro  -o waitid-v waitid-v.o libtests.a 
/usr/bin/ld: i386:x86-64 architecture of input file `waitid-v.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-errno2name.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-error_msg.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-tail_alloc.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-tprintf.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-get_page_size.o)' is incompatible with i386 output
/usr/bin/ld: waitid-v.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
make[4]: *** [waitid-v] Error 1
gcc -std=gnu99 -DHAVE_CONFIG_H   -DMPERS_IS_m32 -m32 -I. -I../linux/i386 -I../linux/i386 -I../linux -I../linux -I.. -I.. -DTESTS_SIZEOF_KERNEL_LONG_T=4 -DTESTS_SIZEOF_LONG=4  -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -c -o zeroargc.o zeroargc.c
gcc -std=gnu99 -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic -DMPERS_IS_m32 -m32 -Wl,-z,relro  -o zeroargc zeroargc.o libtests.a 
/usr/bin/ld: i386:x86-64 architecture of input file `zeroargc.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `libtests.a(libtests_a-error_msg.o)' is incompatible with i386 output
/usr/bin/ld: zeroargc.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
make[4]: *** [zeroargc] Error 1
make[4]: Leaving directory `/root/rpmbuild/BUILD/strace-4.23/tests-m32'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/root/rpmbuild/BUILD/strace-4.23/tests-m32'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/strace-4.23/tests-m32'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/strace-4.23'
make: *** [check] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.0HEiVW (%check)


RPM build errors:
    user mockbuild does not exist - using root
    group mockbuild does not exist - using root
    user mockbuild does not exist - using root
    group mockbuild does not exist - using root
    Bad exit status from /var/tmp/rpm-tmp.0HEiVW (%check)


Expected results:
Successful rebuild

Additional info:

Comment 1 Eugene Syromiatnikov 2018-08-05 05:51:47 UTC
I presume it's the result of unclean build, weird environment and/or explicit "-m64" that is pushed into CFLAGS/CPPFLAGS by /usr/lib/rpm/redhat/rpmrc.

Anyway, "-m64" flag is filtered out now from CFLAGS/CPPFLAGS, as of devtoolset-8-strace-4.23-4.el{6,7}, so rpmbuild --rebuild works for me now.


Also, I've prepared a variant of spec[1] that can be built in an isolated environment using mock (on x86_64):

    rhpkg clone strace
    cd strace
    git checkout private-esyromia-bz1610361-compat-build
    rhpkg srpm
    mock --rebuild -r ./dts8rhel7.cfg ./strace-4.23-4.el7.src.rpm

(dts8rhel7.cfg has i386 repo added, in comparison to rhpkg mock-config output; strace-tests-allow-any-error-code-when-try-to-set-time.patch is needed as clock_settime/settimeofday tests didn't expect EPERM instead of EINVAL)

That way, tests for both m64 and m32 tests are also working for me, may I ask you to verify that?

[1] http://pkgs.devel.redhat.com/cgit/rpms/strace/tree/?h=private-esyromia-bz1610361-compat-build

Comment 2 Edjunior Barbosa Machado 2018-08-07 12:59:33 UTC
Thanks Eugene for the fix. I tried it manually and rpmbuild now runs successfully in x86_64, however in other arches it complains about the missing x86-32 packages, like in rhel-7.6 ppc64le:

# scl enable devtoolset-8 -- rpmbuild -bb rpmbuild/SPECS/strace.spec
error: Failed build dependencies:
	glibc(x86-32) is needed by strace-4.23-4.el7a.ppc64le
	glibc-devel(x86-32) is needed by strace-4.23-4.el7a.ppc64le
	libgcc(x86-32) is needed by strace-4.23-4.el7a.ppc64le

This seems to be avoided nesting "BuildRequires: glibc(x86-32) glibc-devel(x86-32) libgcc(x86-32)" under an '%ifarch x86_64'.

Comment 4 Eugene Syromiatnikov 2018-08-07 13:59:04 UTC
(In reply to Edjunior Barbosa Machado from comment #2)
> This seems to be avoided nesting "BuildRequires: glibc(x86-32)
> glibc-devel(x86-32) libgcc(x86-32)" under an '%ifarch x86_64'.

Yep, it seems that there's no 32-bit libraries provided on other arches anyway, so there's no ability to test 32-bit decoding there. The same holds for x32 ABI on x86_64.

Comment 5 Edjunior Barbosa Machado 2018-08-24 15:42:33 UTC
devtoolset-8-strace-4.23-5.el7.src.rpm now builds on both x86_64 and ppc64le, but still with some minor pitfalls.

Although yum-builddep devtoolset-8-strace-4.23-5.el7.src.rpm informs that all deps are installed, rpmbuild complains about missing system's *-devel packages:

[root@ibm-p8-kvm-03-guest-03 ~]# yum-builddep -y devtoolset-8-strace-4.23-5.el7.src.rpm 
Getting requirements for devtoolset-8-strace-4.23-5.el7.src
 --> Already installed : scl-utils-build-20130529-18.el7_4.ppc64le
 --> Already installed : libacl-devel-2.2.51-14.el7.ppc64le
 --> Already installed : time-1.7-45.el7.ppc64le
 --> Already installed : gcc-4.8.5-28.el7_5.1.ppc64le
 --> Already installed : devtoolset-8-elfutils-devel-0.173-1.el7.ppc64le
 --> Already installed : devtoolset-8-binutils-devel-2.30-26.el7.ppc64le
No uninstalled build requires

[root@ibm-p8-kvm-03-guest-03 ~]# scl enable devtoolset-8 -- rpmbuild --rebuild devtoolset-8-strace-4.23-5.el7.src.rpm 
Installing devtoolset-8-strace-4.23-5.el7.src.rpm
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
(...)
error: Failed build dependencies:
	elfutils-devel is needed by strace-4.23-5.el7.ppc64le
	binutils-devel is needed by strace-4.23-5.el7.ppc64le
[root@ibm-p8-kvm-03-guest-03 ~]# scl enable devtoolset-8 -- rpmbuild -bb rpmbuild/SPECS/strace.spec 
error: Failed build dependencies:
	elfutils-devel is needed by strace-4.23-5.el7.ppc64le
	binutils-devel is needed by strace-4.23-5.el7.ppc64le

And yum-builddep strace.spec tries to install such packages:

[root@ibm-p8-kvm-03-guest-03 ~]# scl enable devtoolset-8 -- yum-builddep rpmbuild/SPECS/strace.spec 
Getting requirements for rpmbuild/SPECS/strace.spec
 --> Already installed : libacl-devel-2.2.51-14.el7.ppc64le
 --> Already installed : time-1.7-45.el7.ppc64le
 --> Already installed : gcc-4.8.5-28.el7_5.1.ppc64le
 --> elfutils-devel-0.170-4.el7.ppc64le
 --> binutils-devel-2.27-28.base.el7_5.1.ppc64le

=====================================================================================================================================================================================================================
 Package                                             Arch                                         Version                                                   Repository                                          Size
=====================================================================================================================================================================================================================
Installing:
 binutils-devel                                      ppc64le                                      2.27-28.base.el7_5.1                                      beaker-Server                                      952 k
 elfutils-devel                                      ppc64le                                      0.170-4.el7                                               beaker-Server                                       85 k

Transaction Summary
=====================================================================================================================================================================================================================
Install  2 Packages

Is this ok [y/d/N]: 

Apart from that, and probably more important, 'scl enable devtoolset-8 -- rpmbuild -bb strace.spec' is producing strace instead of devtoolset-8-strace rpm packages.

All these issues can be solved by installing devtoolset-8-build beforehand. With devtoolset-8-build-8.0-2.el7 installed, it no longer complains about missing binutils-devel and elfutils-devel and produces devtoolset-8-strace as expected.

Comment 6 Eugene Syromiatnikov 2018-08-24 17:31:08 UTC
(In reply to Edjunior Barbosa Machado from comment #5)
> Although yum-builddep devtoolset-8-strace-4.23-5.el7.src.rpm informs that all
> deps are installed, rpmbuild complains about missing system's *-devel packages:

If I understand correctly, that's the outcome of the fact that yum-builddep uses SRPM metadata (where the package names resolved at the time of build) and doesn't try to parse RPM; meanwhile, rpmbuild parses spec file in order to obtain build dependencies; it's possible to use a spec file (for example, by extracting it from SRPM with rpm2cpio devtoolset-8-strace-4.23-5.el7.src.rpm | cpio -idmv strace.spec) as an argument to yum-builddep instead—in that case, the list of required packages should match between yum-builddep and rpmbuild regardless of presence of devtoolset-8-build package.

> All these issues can be solved by installing devtoolset-8-build beforehand.
> With devtoolset-8-build-8.0-2.el7 installed, it no longer complains about
> missing binutils-devel and elfutils-devel and produces devtoolset-8-strace
> as expected.

That's probably expected, as devtoolset-8-build is indeed installed as a part of buildroot[1], and the only file it installs is /etc/rpm/macros.devtoolset-8-config, that has the following contents:
--->8---
%scl devtoolset-8

%undefine nfsmountable
%enable_devtoolset8 %global ___build_pre %{___build_pre}; source scl_source enable devtoolset-8 || :
---8<---

Which setup SCL macros for devtoolset-8.

[1] http://download.eng.bos.redhat.com/brewroot/packages/devtoolset-8-strace/4.23/5.el7/data/logs/ppc64le/root.log

Comment 7 Edjunior Barbosa Machado 2018-09-14 13:28:15 UTC
Verified as fixed against devtoolset-8-strace-4.24-4.el7.src.rpm (with devtoolset-8-build-8.0-2.el7 previously installed).

Comment 9 errata-xmlrpc 2018-11-13 08:40:11 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, 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/RHEA-2018:3573