All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Need help with cross-compiler configuration
@ 2017-08-30 14:49 Aseem Sharma
  2017-08-30 18:48 ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Aseem Sharma @ 2017-08-30 14:49 UTC (permalink / raw)
  To: buildroot

Hi,

I am naive to buildroot & processor world trying to compile
"buildroot-2017.02.5" for "Marvell ARM Armada 166E processor (compatible to
ARMv5TE instruction-set)" based old system.

I compiled the buildroot (kernel, rootfs & cross-compiler) by setting arm926t
(little-endian) as target arch/variant as suggested by Arnout/Baruch in
response to my old query. However, now I am having trouble booting the
system with the new buildroot created zImage. I do not seem to get any
output/log on the system screen after flashing this new image onto the
system.

To verify if the buildroot is configured correctly for my system, I tried
to create a helloWorld program using the buildroot internal cross-compiler
and then tried to run it on the arm based system (running old 2005
buildroot release). Following is the exact error message that I observe:
*hello.c on Host:*

#include <stdio.h>
int main()
{
   printf("Hello, World!");
   return 0;
}

*Command Line used to Compile on Host:*

sudo /home/administrator/Downloads/buildroot_2017/buildroot-2017.0
2.5/output/host/usr/bin/arm-linux-gcc --sysroot=/home/administrator/
Downloads/buildroot_2017/buildroot-2017.02.5/output/staging -o test hello.c

*Screen Output on Target:*

*# *./test
*./test: line 1: syntax error: unexpected ")"*
*#*
*#* cat ./test | more   *                              ------->  Just to
prove its not a shell script!*
bFLTD? ?c0 ?eY??)? ?? ?? ? -?-? ??-?
                                    ?
                                     0???R??X at -? ? 0?0`?S?0?S3?/??
 ?, at -?`?A ?????0?S3?/??  40?@-? ??@ ?R??????0?S?
? ?0 ?0???? @-?80?S?


*Please let me know if I am missing something. *

Thanks in advance.

Best Regards,
Aseem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170830/2213192c/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Need help with cross-compiler configuration
  2017-08-30 14:49 [Buildroot] Need help with cross-compiler configuration Aseem Sharma
@ 2017-08-30 18:48 ` Baruch Siach
  2017-08-31  7:00   ` Aseem Sharma
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2017-08-30 18:48 UTC (permalink / raw)
  To: buildroot

Hi Aseem,

On Wed, Aug 30, 2017 at 08:19:33PM +0530, Aseem Sharma wrote:
> I am naive to buildroot & processor world trying to compile
> "buildroot-2017.02.5" for "Marvell ARM Armada 166E processor (compatible to
> ARMv5TE instruction-set)" based old system.
> 
> I compiled the buildroot (kernel, rootfs & cross-compiler) by setting arm926t
> (little-endian) as target arch/variant as suggested by Arnout/Baruch in
> response to my old query. However, now I am having trouble booting the
> system with the new buildroot created zImage. I do not seem to get any
> output/log on the system screen after flashing this new image onto the
> system.

Which kernel did you use?

> To verify if the buildroot is configured correctly for my system, I tried
> to create a helloWorld program using the buildroot internal cross-compiler
> and then tried to run it on the arm based system (running old 2005
> buildroot release). Following is the exact error message that I observe:
> *hello.c on Host:*
> 
> #include <stdio.h>
> int main()
> {
>    printf("Hello, World!");
>    return 0;
> }
> 
> *Command Line used to Compile on Host:*
> 
> sudo /home/administrator/Downloads/buildroot_2017/buildroot-2017.0
> 2.5/output/host/usr/bin/arm-linux-gcc --sysroot=/home/administrator/
> Downloads/buildroot_2017/buildroot-2017.02.5/output/staging -o test hello.c
> 
> *Screen Output on Target:*
> 
> *# *./test
> *./test: line 1: syntax error: unexpected ")"*
> *#*
> *#* cat ./test | more   *                              ------->  Just to
> prove its not a shell script!*
> bFLTD? ?c0 ?eY??)? ?? ?? ? -?-? ??-?
>                                     ?
>                                      0???R??X at -? ? 0?0`?S?0?S3?/??
>  ?, at -?`?A ?????0?S3?/??  40?@-? ??@ ?R??????0?S?
> ? ?0 ?0???? @-?80?S?
> 
> *Please let me know if I am missing something. *

Did you build your test program statically? If not, which libc variant do you 
use?

Do you use compatible ARM ABI? The so called OABI (for old ABI) has still been 
in use at that time. See https://wiki.debian.org/ArmEabiPort.

Buildroot dropped support for ARM OABI a few years ago.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Need help with cross-compiler configuration
  2017-08-30 18:48 ` Baruch Siach
@ 2017-08-31  7:00   ` Aseem Sharma
  2017-08-31  7:16     ` Baruch Siach
  0 siblings, 1 reply; 6+ messages in thread
From: Aseem Sharma @ 2017-08-31  7:00 UTC (permalink / raw)
  To: buildroot

Much appreciate your quick response.
Please find my replies inline in *Blue*.

Thanks & Regards,
Aseem

On Thu, Aug 31, 2017 at 12:18 AM, Baruch Siach <baruch@tkos.co.il> wrote:

> Hi Aseem,
>
> On Wed, Aug 30, 2017 at 08:19:33PM +0530, Aseem Sharma wrote:
> > I am naive to buildroot & processor world trying to compile
> > "buildroot-2017.02.5" for "Marvell ARM Armada 166E processor (compatible
> to
> > ARMv5TE instruction-set)" based old system.
> >
> > I compiled the buildroot (kernel, rootfs & cross-compiler) by setting
> arm926t
> > (little-endian) as target arch/variant as suggested by Arnout/Baruch in
> > response to my old query. However, now I am having trouble booting the
> > system with the new buildroot created zImage. I do not seem to get any
> > output/log on the system screen after flashing this new image onto the
> > system.
>
> Which kernel did you use?
>
[Aseem] I am using the zImage built by default kernel version with
"buildroot-2017.02.5"  ie. "4.9.13"

>
> > To verify if the buildroot is configured correctly for my system, I tried
> > to create a helloWorld program using the buildroot internal
> cross-compiler
> > and then tried to run it on the arm based system (running old 2005
> > buildroot release). Following is the exact error message that I observe:
> > *hello.c on Host:*
> >
> > #include <stdio.h>
> > int main()
> > {
> >    printf("Hello, World!");
> >    return 0;
> > }
> >
> > *Command Line used to Compile on Host:*
> >
> > sudo /home/administrator/Downloads/buildroot_2017/buildroot-2017.0
> > 2.5/output/host/usr/bin/arm-linux-gcc --sysroot=/home/administrator/
> > Downloads/buildroot_2017/buildroot-2017.02.5/output/staging -o test
> hello.c
> >
> > *Screen Output on Target:*
> >
> > *# *./test
> > *./test: line 1: syntax error: unexpected ")"*
> > *#*
> > *#* cat ./test | more   *                              ------->  Just to
> > prove its not a shell script!*
> > bFLTD? ?c0 ?eY??)? ?? ?? ? -?-? ??-?
> >                                     ?
> >                                      0???R??X at -? ? 0?0`?S?0?S3?/??
> >  ?, at -?`?A ?????0?S3?/??  40?@-? ??@ ?R??????0?S?
> > ? ?0 ?0???? @-?80?S?
> >
> > *Please let me know if I am missing something. *
>
> Did you build your test program statically? If not, which libc variant do
> you
> use?
>
[Aseem] I built the test program by dynamically linking to libc. I am
assuming it would have picked it up from the default libraries created by
buildroot inside "buildroot-2017.02.5/output/staging" directory.
Do you think my below compile instructions was faulty? The whole idea for
this exercise was to confirm if the the cross compiler (built by me) was
configured correctly to be able to create binaries compatible with my
system.
#sudo /home/administrator/Downloads/buildroot_2017/buildroot-2017.
02.5/output/host/usr/bin/arm-linux-gcc
--sysroot=/home/administrator/Downloads/buildroot_2017/
buildroot-2017.02.5/output/staging -o test hello.c

>
> Do you use compatible ARM ABI? The so called OABI (for old ABI) has still
> been
> in use at that time. See https://wiki.debian.org/ArmEabiPort.
>
[Aseem] I am sorry, I do not really understand compatible ARM ABI and the
procedure to check if it being used. How do I check it?

>
> Buildroot dropped support for ARM OABI a few years ago.
>
[Aseem] Do you mean that I have to pick up an older version of buildroot to
make this work on my device? If yes, coould you please point me to the
correct build to be used.

>
> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open
> Systems
> =}------------------------------------------------ooO--U--
> Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170831/482e850a/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Need help with cross-compiler configuration
  2017-08-31  7:00   ` Aseem Sharma
@ 2017-08-31  7:16     ` Baruch Siach
  2017-08-31  7:56       ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Baruch Siach @ 2017-08-31  7:16 UTC (permalink / raw)
  To: buildroot

Hi Aseem,

On Thu, Aug 31, 2017 at 12:30:05PM +0530, Aseem Sharma wrote:
> On Thu, Aug 31, 2017 at 12:18 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> > On Wed, Aug 30, 2017 at 08:19:33PM +0530, Aseem Sharma wrote:
> > > I am naive to buildroot & processor world trying to compile
> > > "buildroot-2017.02.5" for "Marvell ARM Armada 166E processor (compatible
> > to
> > > ARMv5TE instruction-set)" based old system.
> > >
> > > I compiled the buildroot (kernel, rootfs & cross-compiler) by setting
> > arm926t
> > > (little-endian) as target arch/variant as suggested by Arnout/Baruch in
> > > response to my old query. However, now I am having trouble booting the
> > > system with the new buildroot created zImage. I do not seem to get any
> > > output/log on the system screen after flashing this new image onto the
> > > system.
> >
> > Which kernel did you use?
>
> [Aseem] I am using the zImage built by default kernel version with
> "buildroot-2017.02.5"  ie. "4.9.13"

Do you have any reason to believe that this kernel supports your target? You 
will most likely need to write a device-tree file for your target. This is 
purely kernel related, so out of scope for Buildroot and for this list.

> > > To verify if the buildroot is configured correctly for my system, I 
> > > tried
> > > to create a helloWorld program using the buildroot internal
> > cross-compiler
> > > and then tried to run it on the arm based system (running old 2005
> > > buildroot release). Following is the exact error message that I observe:
> > > *hello.c on Host:*
> > >
> > > #include <stdio.h>
> > > int main()
> > > {
> > >    printf("Hello, World!");
> > >    return 0;
> > > }
> > >
> > > *Command Line used to Compile on Host:*
> > >
> > > sudo /home/administrator/Downloads/buildroot_2017/buildroot-2017.0
> > > 2.5/output/host/usr/bin/arm-linux-gcc --sysroot=/home/administrator/
> > > Downloads/buildroot_2017/buildroot-2017.02.5/output/staging -o test
> > hello.c
> > >
> > > *Screen Output on Target:*
> > >
> > > *# *./test
> > > *./test: line 1: syntax error: unexpected ")"*
> > > *#*
> > > *#* cat ./test | more   *                              ------->  Just to
> > > prove its not a shell script!*
> > > bFLTD? ?c0 ?eY??)? ?? ?? ? -?-? ??-?
> > >                                     ?
> > >                                      0???R??X at -? ? 0?0`?S?0?S3?/??
> > >  ?, at -?`?A ?????0?S3?/??  40?@-? ??@ ?R??????0?S?
> > > ? ?0 ?0???? @-?80?S?
> > >
> > > *Please let me know if I am missing something. *
> >
> > Did you build your test program statically? If not, which libc variant do
> > you
> > use?
>
> [Aseem] I built the test program by dynamically linking to libc. I am
> assuming it would have picked it up from the default libraries created by
> buildroot inside "buildroot-2017.02.5/output/staging" directory.
> Do you think my below compile instructions was faulty? The whole idea for
> this exercise was to confirm if the the cross compiler (built by me) was
> configured correctly to be able to create binaries compatible with my
> system.

The default Buildroot libc is uClibc. This libc does not guarantee binary 
compatibility between releases. This means that you'll need to copy the libc 
to your target, and make sure that the binaries you produce find it. The 
easiest method for doing that is using chroot.

Alternatively, you can build static binaries that don't need run-time presence 
of libc files.

> > Do you use compatible ARM ABI? The so called OABI (for old ABI) has still
> > been
> > in use at that time. See https://wiki.debian.org/ArmEabiPort.
>
> [Aseem] I am sorry, I do not really understand compatible ARM ABI and the
> procedure to check if it being used. How do I check it?

The Debian wiki page I linked to provides a few methods for doing that using 
objdump, file, and readelf utilities.

> > Buildroot dropped support for ARM OABI a few years ago.
>
> [Aseem] Do you mean that I have to pick up an older version of buildroot to
> make this work on my device? If yes, coould you please point me to the
> correct build to be used.

The Config.in.legacy file lists the BR2_ARM_OABI config symbol under "Legacy 
options removed in 2013.08". So you might have luck with an earlier release.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Need help with cross-compiler configuration
  2017-08-31  7:16     ` Baruch Siach
@ 2017-08-31  7:56       ` Arnout Vandecappelle
  2017-08-31 11:48         ` Aseem Sharma
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-08-31  7:56 UTC (permalink / raw)
  To: buildroot



On 31-08-17 09:16, Baruch Siach wrote:
> Hi Aseem,
> 
> On Thu, Aug 31, 2017 at 12:30:05PM +0530, Aseem Sharma wrote:
>> On Thu, Aug 31, 2017 at 12:18 AM, Baruch Siach <baruch@tkos.co.il> wrote:
>>> On Wed, Aug 30, 2017 at 08:19:33PM +0530, Aseem Sharma wrote:
>>>> I am naive to buildroot & processor world trying to compile
>>>> "buildroot-2017.02.5" for "Marvell ARM Armada 166E processor (compatible
>>> to
>>>> ARMv5TE instruction-set)" based old system.
>>>>
>>>> I compiled the buildroot (kernel, rootfs & cross-compiler) by setting
>>> arm926t
>>>> (little-endian) as target arch/variant as suggested by Arnout/Baruch in
>>>> response to my old query. However, now I am having trouble booting the
>>>> system with the new buildroot created zImage. I do not seem to get any
>>>> output/log on the system screen after flashing this new image onto the
>>>> system.
>>>
>>> Which kernel did you use?
>>
>> [Aseem] I am using the zImage built by default kernel version with
>> "buildroot-2017.02.5"  ie. "4.9.13"
> 
> Do you have any reason to believe that this kernel supports your target? You 
> will most likely need to write a device-tree file for your target. This is 
> purely kernel related, so out of scope for Buildroot and for this list.

 Indeed, you'll have to find a kernel and a kernel configuration that supports
your device. You can take a look at arch/arm/configs and arch/arm/boot/dts in
the kernel to see if there is anything that matches your device. Or do a
websearch for the combination of your device name and 'linux kernel'.

[snip]
>>>> *Screen Output on Target:*
>>>>
>>>> *# *./test
>>>> *./test: line 1: syntax error: unexpected ")"*

 This is indeed indicative of a kernel that doesn't support EABI, or maybe it
doesn't even support ELF. So if you keep using that older kernel, you will also
need to use a toolchain that supports OABI. I know of no easy way to determine
the ABI supported by the kernel. Maybe /proc/cpuinfo gives some insight, or else
you can look at /proc/config.gz (if available) but that's a bit complicated to
analyze.

[snip]
>>> Did you build your test program statically? If not, which libc variant do
>>> you
>>> use?

 That's not going to help. If it's a dynamic library issue, you'll get a "No
such file or directory" error (because it can't find the dynamic linker).

[snip]
>> [Aseem] Do you mean that I have to pick up an older version of buildroot to
>> make this work on my device? If yes, coould you please point me to the
>> correct build to be used.
> 
> The Config.in.legacy file lists the BR2_ARM_OABI config symbol under "Legacy 
> options removed in 2013.08". So you might have luck with an earlier release.

 I think it is still possible to use an OABI external toolchain, I don't think
there's an explicit check for that. So you just have to find an old toolchain.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Need help with cross-compiler configuration
  2017-08-31  7:56       ` Arnout Vandecappelle
@ 2017-08-31 11:48         ` Aseem Sharma
  0 siblings, 0 replies; 6+ messages in thread
From: Aseem Sharma @ 2017-08-31 11:48 UTC (permalink / raw)
  To: buildroot

Thanks Arnout & Baruch for your inputs and time.
I will see what I can find on internet and old kernel configuration.

Best Regards,
Aseem

On Thu, Aug 31, 2017 at 1:26 PM, Arnout Vandecappelle <arnout@mind.be>
wrote:

>
>
> On 31-08-17 09:16, Baruch Siach wrote:
> > Hi Aseem,
> >
> > On Thu, Aug 31, 2017 at 12:30:05PM +0530, Aseem Sharma wrote:
> >> On Thu, Aug 31, 2017 at 12:18 AM, Baruch Siach <baruch@tkos.co.il>
> wrote:
> >>> On Wed, Aug 30, 2017 at 08:19:33PM +0530, Aseem Sharma wrote:
> >>>> I am naive to buildroot & processor world trying to compile
> >>>> "buildroot-2017.02.5" for "Marvell ARM Armada 166E processor
> (compatible
> >>> to
> >>>> ARMv5TE instruction-set)" based old system.
> >>>>
> >>>> I compiled the buildroot (kernel, rootfs & cross-compiler) by setting
> >>> arm926t
> >>>> (little-endian) as target arch/variant as suggested by Arnout/Baruch
> in
> >>>> response to my old query. However, now I am having trouble booting the
> >>>> system with the new buildroot created zImage. I do not seem to get any
> >>>> output/log on the system screen after flashing this new image onto the
> >>>> system.
> >>>
> >>> Which kernel did you use?
> >>
> >> [Aseem] I am using the zImage built by default kernel version with
> >> "buildroot-2017.02.5"  ie. "4.9.13"
> >
> > Do you have any reason to believe that this kernel supports your target?
> You
> > will most likely need to write a device-tree file for your target. This
> is
> > purely kernel related, so out of scope for Buildroot and for this list.
>
>  Indeed, you'll have to find a kernel and a kernel configuration that
> supports
> your device. You can take a look at arch/arm/configs and arch/arm/boot/dts
> in
> the kernel to see if there is anything that matches your device. Or do a
> websearch for the combination of your device name and 'linux kernel'.
>
> [snip]
> >>>> *Screen Output on Target:*
> >>>>
> >>>> *# *./test
> >>>> *./test: line 1: syntax error: unexpected ")"*
>
>  This is indeed indicative of a kernel that doesn't support EABI, or maybe
> it
> doesn't even support ELF. So if you keep using that older kernel, you will
> also
> need to use a toolchain that supports OABI. I know of no easy way to
> determine
> the ABI supported by the kernel. Maybe /proc/cpuinfo gives some insight,
> or else
> you can look at /proc/config.gz (if available) but that's a bit
> complicated to
> analyze.
>
> [snip]
> >>> Did you build your test program statically? If not, which libc variant
> do
> >>> you
> >>> use?
>
>  That's not going to help. If it's a dynamic library issue, you'll get a
> "No
> such file or directory" error (because it can't find the dynamic linker).
>
> [snip]
> >> [Aseem] Do you mean that I have to pick up an older version of
> buildroot to
> >> make this work on my device? If yes, coould you please point me to the
> >> correct build to be used.
> >
> > The Config.in.legacy file lists the BR2_ARM_OABI config symbol under
> "Legacy
> > options removed in 2013.08". So you might have luck with an earlier
> release.
>
>  I think it is still possible to use an OABI external toolchain, I don't
> think
> there's an explicit check for that. So you just have to find an old
> toolchain.
>
>  Regards,
>  Arnout
>
> --
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170831/4f563fab/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-31 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 14:49 [Buildroot] Need help with cross-compiler configuration Aseem Sharma
2017-08-30 18:48 ` Baruch Siach
2017-08-31  7:00   ` Aseem Sharma
2017-08-31  7:16     ` Baruch Siach
2017-08-31  7:56       ` Arnout Vandecappelle
2017-08-31 11:48         ` Aseem Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.