* [Buildroot] segfault when running a simple c program on env build with buildroot
@ 2012-02-09 14:48 Eial Czerwacki
2012-02-09 15:09 ` Thomas Petazzoni
2012-02-09 15:11 ` Thomas Petazzoni
0 siblings, 2 replies; 7+ messages in thread
From: Eial Czerwacki @ 2012-02-09 14:48 UTC (permalink / raw)
To: buildroot
Hello All,
I have a small env built with buildroot based on busybox-1.19.2 and
uclibc-0.9.32.
I've included gcc into it and I'm trying to build and run the following
program but it segfaults:
sh-4.1# cat test.c
int main() { return 0; }
sh-4.1# gcc -o a test.c
sh-4.1# ls -l a
-rwxr-xr-x 1 root root 11553 Feb 9 07:44 a
sh-4.1# ./a
Segmentation fault
sh-4.1# dmesg | tail -1
<6>[634724.545000] a[24405]: segfault at 0 ip (null) sp bfd8fc7c error 4
my buildroot config is attached and the version in use a snapshot from
the date 10/9/2011.
any ideas why?
Eial.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: buildroot.config
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120209/70e1170b/attachment-0001.ksh>
^ permalink raw reply [flat|nested] 7+ messages in thread* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-09 14:48 [Buildroot] segfault when running a simple c program on env build with buildroot Eial Czerwacki @ 2012-02-09 15:09 ` Thomas Petazzoni 2012-02-09 15:11 ` Thomas Petazzoni 1 sibling, 0 replies; 7+ messages in thread From: Thomas Petazzoni @ 2012-02-09 15:09 UTC (permalink / raw) To: buildroot Le Thu, 09 Feb 2012 16:48:30 +0200, Eial Czerwacki <eial@scalemp.com> a ?crit : > my buildroot config is attached and the version in use a snapshot from > the date 10/9/2011. What is your hardware platform? Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-09 14:48 [Buildroot] segfault when running a simple c program on env build with buildroot Eial Czerwacki 2012-02-09 15:09 ` Thomas Petazzoni @ 2012-02-09 15:11 ` Thomas Petazzoni 2012-02-09 15:16 ` Eial Czerwacki 1 sibling, 1 reply; 7+ messages in thread From: Thomas Petazzoni @ 2012-02-09 15:11 UTC (permalink / raw) To: buildroot Le Thu, 09 Feb 2012 16:48:30 +0200, Eial Czerwacki <eial@scalemp.com> a ?crit : > sh-4.1# gcc -o a test.c You're using the native gcc on the target, while Buildroot is mostly designed for cross-compilation. Our native gcc on the target mechanism isn't used/tested a lot, so I would really recommend using the cross-compiler on the build machine to build your applications. Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-09 15:11 ` Thomas Petazzoni @ 2012-02-09 15:16 ` Eial Czerwacki 2012-02-09 15:54 ` Thomas Petazzoni 0 siblings, 1 reply; 7+ messages in thread From: Eial Czerwacki @ 2012-02-09 15:16 UTC (permalink / raw) To: buildroot On 02/09/2012 05:09 PM, Thomas Petazzoni wrote: > Le Thu, 09 Feb 2012 16:48:30 +0200, > Eial Czerwacki <eial@scalemp.com> a ?crit : > >> my buildroot config is attached and the version in use a snapshot from >> the date 10/9/2011. > > What is your hardware platform? > > Thomas any generic Intel/AMD cpu On 02/09/2012 05:11 PM, Thomas Petazzoni wrote: > Le Thu, 09 Feb 2012 16:48:30 +0200, > Eial Czerwacki <eial@scalemp.com> a ?crit : > >> sh-4.1# gcc -o a test.c > > You're using the native gcc on the target, while Buildroot is mostly > designed for cross-compilation. Our native gcc on the target mechanism > isn't used/tested a lot, so I would really recommend using the > cross-compiler on the build machine to build your applications. > > Thomas I've compiled iasl, dmidecode and biosdecode with same image, you say that I cannot do that? I need the bin linked to uclibc and my desktop doesn't support uclibc Thanks, Eial. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-09 15:16 ` Eial Czerwacki @ 2012-02-09 15:54 ` Thomas Petazzoni 2012-02-12 7:14 ` Eial Czerwacki 0 siblings, 1 reply; 7+ messages in thread From: Thomas Petazzoni @ 2012-02-09 15:54 UTC (permalink / raw) To: buildroot Le Thu, 09 Feb 2012 17:16:51 +0200, Eial Czerwacki <eial@scalemp.com> a ?crit : > > What is your hardware platform? > > > > Thomas > > any generic Intel/AMD cpu Sorry this does not exist. Your configuration states i686. If your processor is only i486 or i586 compatible, then those segfaults are expected since the generated code might use instructions that do not exist on your processor. > I've compiled iasl, dmidecode and biosdecode with same image, you say > that I cannot do that? > I need the bin linked to uclibc and my desktop doesn't support uclibc Buildroot generates for you an uClibc cross-compilation toolchain in output/host/usr/bin that you can use to cross-compile applications for the target platform. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-09 15:54 ` Thomas Petazzoni @ 2012-02-12 7:14 ` Eial Czerwacki 2012-02-12 8:25 ` Eial Czerwacki 0 siblings, 1 reply; 7+ messages in thread From: Eial Czerwacki @ 2012-02-12 7:14 UTC (permalink / raw) To: buildroot On 02/09/2012 05:54 PM, Thomas Petazzoni wrote: > Le Thu, 09 Feb 2012 17:16:51 +0200, > Eial Czerwacki <eial@scalemp.com> a ?crit : > >>> What is your hardware platform? >>> >>> Thomas >> >> any generic Intel/AMD cpu > > Sorry this does not exist. Your configuration states i686. If your > processor is only i486 or i586 compatible, then those segfaults are > expected since the generated code might use instructions that do not > exist on your processor. > correction, the cpus are any cpus from the last 4-5 years, my cpu is e6600 for the matter. all of them are i686 >> I've compiled iasl, dmidecode and biosdecode with same image, you say >> that I cannot do that? >> I need the bin linked to uclibc and my desktop doesn't support uclibc > > Buildroot generates for you an uClibc cross-compilation toolchain in > output/host/usr/bin that you can use to cross-compile applications for > the target platform. > > Best regards, > > Thomas that is what I need. Eial. ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] segfault when running a simple c program on env build with buildroot 2012-02-12 7:14 ` Eial Czerwacki @ 2012-02-12 8:25 ` Eial Czerwacki 0 siblings, 0 replies; 7+ messages in thread From: Eial Czerwacki @ 2012-02-12 8:25 UTC (permalink / raw) To: buildroot On 02/12/2012 09:14 AM, Eial Czerwacki wrote: > On 02/09/2012 05:54 PM, Thomas Petazzoni wrote: > >> Le Thu, 09 Feb 2012 17:16:51 +0200, >> Eial Czerwacki <eial@scalemp.com> a ?crit : >> >>>> What is your hardware platform? >>>> >>>> Thomas >>> >>> any generic Intel/AMD cpu >> >> Sorry this does not exist. Your configuration states i686. If your >> processor is only i486 or i586 compatible, then those segfaults are >> expected since the generated code might use instructions that do not >> exist on your processor. >> > > correction, the cpus are any cpus from the last 4-5 years, my cpu is > e6600 for the matter. > all of them are i686 > >>> I've compiled iasl, dmidecode and biosdecode with same image, you say >>> that I cannot do that? >>> I need the bin linked to uclibc and my desktop doesn't support uclibc >> >> Buildroot generates for you an uClibc cross-compilation toolchain in >> output/host/usr/bin that you can use to cross-compile applications for >> the target platform. >> >> Best regards, >> >> Thomas > > > that is what I need. > > Eial. > ok, I've found my issue, for some reason, although I was inside the busybox (using chroot to compile it), configure used the host's compiler and not the uclibc based compiler, passing the --host=i686-unknown-linux-uclibc solved this issue. Thanks for the help. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-12 8:25 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-09 14:48 [Buildroot] segfault when running a simple c program on env build with buildroot Eial Czerwacki 2012-02-09 15:09 ` Thomas Petazzoni 2012-02-09 15:11 ` Thomas Petazzoni 2012-02-09 15:16 ` Eial Czerwacki 2012-02-09 15:54 ` Thomas Petazzoni 2012-02-12 7:14 ` Eial Czerwacki 2012-02-12 8:25 ` Eial Czerwacki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox