public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Solution: How to Cross Compile on Ubuntu x86_64 for Raspberry Pi
@ 2013-02-27  3:36 Thomas D. Dean
  2013-02-27  9:30 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas D. Dean @ 2013-02-27  3:36 UTC (permalink / raw)
  To: gcc-help

On Ubuntu:

1.  mount the RaspberryPi SD card image partition 2 on /mnt
     decide a better directory later
2.  Run the script
#!/bin/sh
##
## build the object file
arm-linux-gnueabihf-gcc-4.6 -c \
     -nostdlib -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -marm -Wl,-t  \
     hello.c -o helloc.o
##
## link
arm-linux-gnueabihf-gcc-4.6 -o helloc helloc.o \
     -nostdlib -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard \
     -marm -Wl,-t  \
     /mnt/usr/lib/arm-linux-gnueabihf/crt1.o \
     /mnt/usr/lib/arm-linux-gnueabihf/crti.o \
     /mnt/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o \
     /mnt/lib/arm-linux-gnueabihf/libgcc_s.so.1 \
     /mnt/lib/arm-linux-gnueabihf/libc.so.6 \
     /mnt/usr/lib/arm-linux-gnueabihf/libc_nonshared.a \
     /mnt/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 \
     /mnt/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o \
     /mnt/usr/lib/arm-linux-gnueabihf/crtn.o \
     /mnt/lib/arm-linux-gnueabihf/libm.so.6

This produces an image that will execute on the Raspberry Pi.

There seems to be a problem with either the crtxxx.o files or the libs.

Where do I file a bug report?

Tom Dean

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

* Re: Solution: How to Cross Compile on Ubuntu x86_64 for Raspberry Pi
  2013-02-27  3:36 Solution: How to Cross Compile on Ubuntu x86_64 for Raspberry Pi Thomas D. Dean
@ 2013-02-27  9:30 ` Jonathan Wakely
  2013-02-27 14:32   ` Thomas D. Dean
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2013-02-27  9:30 UTC (permalink / raw)
  To: Thomas D. Dean; +Cc: gcc-help

On 27 February 2013 03:36, Thomas D. Dean wrote:
>
> There seems to be a problem with either the crtxxx.o files or the libs.
>
> Where do I file a bug report?

GCC bug reports go to http://gcc.gnu.org/bugs/ but if the problem is
the library paths on Ubuntu it's a known issue that should fixed in
current sources.

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

* Re: Solution: How to Cross Compile on Ubuntu x86_64 for Raspberry Pi
  2013-02-27  9:30 ` Jonathan Wakely
@ 2013-02-27 14:32   ` Thomas D. Dean
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas D. Dean @ 2013-02-27 14:32 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

On 02/27/13 01:30, Jonathan Wakely wrote:
> On 27 February 2013 03:36, Thomas D. Dean wrote:
>>
>> There seems to be a problem with either the crtxxx.o files or the libs.
>>
>> Where do I file a bug report?
>
> GCC bug reports go to http://gcc.gnu.org/bugs/ but if the problem is
> the library paths on Ubuntu it's a known issue that should fixed in
> current sources.
>
>

The problem is not the paths, it is the files.  I substituted the 
RaspberryPi files by using -nostdlib and explicit listing the files on 
the command line,

diff says the crtxxx.o files on ubuntu are not the same as the same path 
file on RaspberryPi.

The libs may also be not usable.

diff says /usr/lib/gcc/arm-linux-gnueabihf/4.6/libgcc_s.so.1 on ubuntu 
is not the same as the same path file on RaspberryPi.

Tom Dean

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

end of thread, other threads:[~2013-02-27 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27  3:36 Solution: How to Cross Compile on Ubuntu x86_64 for Raspberry Pi Thomas D. Dean
2013-02-27  9:30 ` Jonathan Wakely
2013-02-27 14:32   ` Thomas D. Dean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).