Bug 1122003

Summary: gcc-4.9 based cross-gcc fails to cross compile kernel src rpm
Product: [Fedora] Fedora Reporter: Ajay Ramaswamy <ajayr>
Component: kernelAssignee: Kyle McMartin <kmcmartin>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dan, dhowells, gansalmon, itamar, jonathan, kernel-maint, lkoranda, madhu.chinakonda, mchehab, peterm, stanislav
Target Milestone: ---   
Target Release: ---   
Hardware: armv7hl   
OS: Linux   
Whiteboard:
Fixed In Version: cross-gcc-4.9.1-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-13 13:48:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
failing rpmbuild log
none
failing rpmbuild log with GCC 4.9.1
none
add --with-ld to hardcode linker path
none
working build log with cross gcc 4.9.1-2 none

Description Ajay Ramaswamy 2014-07-22 10:42:25 UTC
Created attachment 919865 [details]
failing rpmbuild log

Description of problem:

I was able to rebuild the kernel src rpm on a x86_64 fedora 20 laptop to build a kernel rpm for armv7hl nas

This stopped working after the bump from gcc-4.8.3 to gcc-4.9

Version- Release number of selected component (if applicable):
cross-gcc-common-4.9.0-4.fc20.noarch
cross-binutils-common-2.24-5.fc20.noarch
gcc-arm-linux-gnu-4.9.0-4.fc20.x86_64

How reproducible:


Steps to Reproduce:
1.  rpmbuild --rebuild --with cross --target=armv7hl --without perf --without tools --without pae --without debug /home/ajayr/Downloads/srpm/kernel-3.15.6-200.fc20.src.rpm > ~/kbuild.log 2>&1

2.
3.

Actual results:
fails

Expected results:

set of kernel rpms

Additional info:

Comment 1 David Howells 2014-07-31 09:50:09 UTC
I've just pushed 4.9.1-1 to updates testing.  Can you try that when it appears?

Comment 2 Ajay Ramaswamy 2014-08-01 03:30:27 UTC
(In reply to David Howells from comment #1)
> I've just pushed 4.9.1-1 to updates testing.  Can you try that when it
> appears?

downloaded 
cross-gcc-common-4.9.1-1.fc20.noarch.rpm
gcc-arm-linux-gnu-4.9.1-1.fc20.x86_64.rpm

from koji and still it fails with
+ '[' -d arch/arm/include ']'
+ cp -a --parents arch/arm/include /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/
+ '[' -d arch/arm/mach-/include ']'
+ cp -a include /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/include
+ touch -r /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/Makefile /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/include/generated/uapi/linux/version.h
+ cp /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/.config /home/ajayr/rpmbuild/BUILDROOT/kernel-3.15.6-200.fc20.arm/lib/modules/3.15.6-200.fc20.armv7hl/build/include/config/auto.conf
+ test -s vmlinux.id
+ echo '*** ERROR *** no vmlinux build ID! ***'
*** ERROR *** no vmlinux build ID! ***
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.XCWZdb (%build)

I have attached the full log too for reference

Comment 3 Ajay Ramaswamy 2014-08-01 03:31:34 UTC
Created attachment 923061 [details]
failing rpmbuild log with GCC 4.9.1

Comment 4 Kyle McMartin 2014-08-11 16:30:35 UTC
are you sure you didn't build with --without debuginfo in the past? i think if you add that to rpmbuild, you should have a working build with 4.9.1

regards, kyle

Comment 5 Kyle McMartin 2014-08-11 17:06:07 UTC
hrm, trying to reproduce for you now.

Comment 6 Kyle McMartin 2014-08-11 17:52:44 UTC
well, that's fun... it works on aarch64, but not armv7hl... looks like the kernel is failing to detect that -Wl,--build-id should work. sigh.

Comment 7 Kyle McMartin 2014-08-11 18:02:22 UTC
master@linux:.% arm-linux-gnu-gcc -Wl,--buildid -nostdlib -x c /dev/null -o foo                                                        (kyle@redacted:~/linux)
collect2: fatal error: cannot find 'ld'

hrm, ok, i'll debug why this has suddenly decided to fail.

Comment 8 Kyle McMartin 2014-08-11 21:58:10 UTC
you could also work around this by passing CFLAGS=-fuse-ld=bfd

i think i've found a handy workaround, although i'm not entirely sure why this only breaks on arm... it won't cause any issues on other platforms, so i'll run with it nonetheless.

Comment 9 Kyle McMartin 2014-08-12 14:54:11 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=7275227

I'm pretty confident the xcompilers in this scratch build will resolve your problem.

regards, Kyle

Comment 10 Kyle McMartin 2014-08-12 14:55:26 UTC
Created attachment 926088 [details]
add --with-ld to hardcode linker path

fix.

Comment 11 Ajay Ramaswamy 2014-08-13 10:42:12 UTC
YES! It works

binutils-arm-linux-gnu-2.24-5.fc20.x86_64
cross-binutils-common-2.24-5.fc20.noarch
cross-gcc-common-4.9.1-1.1.fc22.noarch
gcc-arm-linux-gnu-4.9.1-1.1.fc22.x86_64


Thank you
Ajay

Comment 12 Ajay Ramaswamy 2014-08-13 10:43:06 UTC
Created attachment 926368 [details]
working build log with cross gcc 4.9.1-2

Comment 13 Kyle McMartin 2014-08-13 13:48:19 UTC
no problemo.