Bug 1122003 - gcc-4.9 based cross-gcc fails to cross compile kernel src rpm
Summary: gcc-4.9 based cross-gcc fails to cross compile kernel src rpm
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 20
Hardware: armv7hl
OS: Linux
Target Milestone: ---
Assignee: Kyle McMartin
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-22 10:42 UTC by Ajay Ramaswamy
Modified: 2015-09-01 03:55 UTC (History)
11 users (show)

Fixed In Version: cross-gcc-4.9.1-2.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-13 13:48:19 UTC
Type: Bug

Attachments (Terms of Use)
failing rpmbuild log (286.85 KB, text/plain)
2014-07-22 10:42 UTC, Ajay Ramaswamy
no flags Details
failing rpmbuild log with GCC 4.9.1 (286.73 KB, text/plain)
2014-08-01 03:31 UTC, Ajay Ramaswamy
no flags Details
add --with-ld to hardcode linker path (1.01 KB, patch)
2014-08-12 14:55 UTC, Kyle McMartin
no flags Details | Diff
working build log with cross gcc 4.9.1-2 (715.54 KB, text/plain)
2014-08-13 10:43 UTC, Ajay Ramaswamy
no flags Details

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):

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


Actual results:

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?


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

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


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


Thank you

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.

Note You need to log in before you can comment on or make changes to this bug.