Bug 5234 - kexec fails to build
Summary: kexec fails to build
Status: RESOLVED WORKSFORME
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2012.02
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-19 23:57 UTC by Baruch Even
Modified: 2013-05-26 14:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
patch to make kexec compile in cross-builds (886 bytes, patch)
2012-05-19 23:57 UTC, Baruch Even
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Baruch Even 2012-05-19 23:57:32 UTC
Created attachment 4358 [details]
patch to make kexec compile in cross-builds

Building kexec as part of buildroot with the uclibc library I get that the bin-to-hex utility fails to build, this is because it requires libc.so.0 which is not available on the host and is only generated as part of the buildroot tree. To overcome this kexec needs to build bin-to-hex with the HOSTCC. I've noticed that this was a patch in buildroot which was dropped at some point. So I recreated it, I also sent it to upstream kexec-tools mailing list and hope it will be accepted for future versions.

The patch as needed for buildroot is attached, it needs to be dropped into packages/kexec/
Comment 1 Gustavo Zacarias 2012-10-16 02:16:00 UTC
Did you try with a newer version of Buildroot which uses kexec 2.0.3?
If it still fails, can you attach a sample .config since i can't reproduce?
A simple solution would be to pass the BUILD_CC and BUILD_CFLAGS variables to configure, no kexec-tools patching needed and it's there to be used.
Thanks.
Comment 2 Thomas Petazzoni 2013-05-26 14:24:44 UTC
I've just tested with the latest Buildroot, and bin-to-hex is properly built with the host compiler and later used without problem.

...
cc   -O2 -Wall -o bin/bin-to-hex util/bin-to-hex.c
...
bin/bin-to-hex purgatory < purgatory/purgatory.ro > kexec/purgatory.c
...