public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with ARM cross compiler
@ 2013-12-18 18:59 Hendrik Greving
  2013-12-19  0:16 ` Maxim Kuvyrkov
  0 siblings, 1 reply; 6+ messages in thread
From: Hendrik Greving @ 2013-12-18 18:59 UTC (permalink / raw)
  To: gcc-help

I am compiling (trying to) ARM cross compiler (on x86):

../gcc-4_8-branch/configure --prefix=/local_disk/hgreving/gcc_arm
--program-suffix=-arm --target=arm-none-linux-gnueabi
--disable-threads --enable-languages=c,c++ --with-gnu-as --with-gnu-ld
--disable-libmudflap --disable-libssp --disable-libstdcxx-pch
--disable-shared --enable-lto --disable-nls
--with-build-time-tools=/local_disk/hgreving/gcc_arm/bin

Fails with

checking dynamic linker characteristics... configure: error: Link
tests are not allowed after GCC_NO_EXECUTABLES.

I am seeing 2 errors in ./arm-none-linux-gnueabi/libquadmath/config.log:

1)

/local_disk/hgreving/gcc_arm/arm-none-linux-gnueabi/bin/ld: cannot
find crt1.o: No such file or directory
/local_disk/hgreving/gcc_arm/arm-none-linux-gnueabi/bin/ld: cannot
find crti.o: No such file or directory
/local_disk/hgreving/gcc_arm/arm-none-linux-gnueabi/bin/ld: cannot find -lc
/local_disk/hgreving/gcc_arm/arm-none-linux-gnueabi/bin/ld: cannot
find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

2)

conftest.c:15:19: fatal error: stdio.h: No such file or directory


Any help/hint appreciated,
Regards,
Hendrik Greving

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

* Re: Problem with ARM cross compiler
  2013-12-18 18:59 Problem with ARM cross compiler Hendrik Greving
@ 2013-12-19  0:16 ` Maxim Kuvyrkov
  2013-12-19  8:15   ` Kai Ruottu
  2013-12-19  9:53   ` Andrew Haley
  0 siblings, 2 replies; 6+ messages in thread
From: Maxim Kuvyrkov @ 2013-12-19  0:16 UTC (permalink / raw)
  To: Hendrik Greving; +Cc: gcc-help

On 19/12/2013, at 7:59 am, Hendrik Greving <hendrik.greving.intel@gmail.com> wrote:

> I am compiling (trying to) ARM cross compiler (on x86):
> 
> 
...
> conftest.c:15:19: fatal error: stdio.h: No such file or directory
> 
> 
> Any help/hint appreciated,

You don't have cross-built C library installed.  Building a cross toolchain from scratch is an intricate process, it is not building just the compiler, you also need bintutils, C library headers and C library itself.

Assuming you want Glibc for C library, try following procedure documented here: http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/EGLIBC.cross-building?view=markup .  Consider using one of pre-built cross toolchains, e.g., Linaro's.

--
Maxim Kuvyrkov
www.kugelworks.com


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

* Re: Problem with ARM cross compiler
  2013-12-19  0:16 ` Maxim Kuvyrkov
@ 2013-12-19  8:15   ` Kai Ruottu
  2013-12-19  9:23     ` Brian Drummond
  2013-12-19  9:53   ` Andrew Haley
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2013-12-19  8:15 UTC (permalink / raw)
  To: gcc-help

19.12.2013 2:15, Maxim Kuvyrkov kirjoitti:
> On 19/12/2013, at 7:59 am, Hendrik Greving<hendrik.greving.intel@gmail.com>  wrote:
>
>> I am compiling (trying to) ARM cross compiler (on x86):
>>
>>
> ...
>> conftest.c:15:19: fatal error: stdio.h: No such file or directory
>>
>>
>> Any help/hint appreciated,
> You don't have cross-built C library installed.  Building a cross toolchain from scratch is an intricate process, it is not building just the compiler, you also need bintutils, C library headers and C library itself.

I have never fully understood why the "totally from scratch target" is 
the first many people are trying
when there are existing targets for crosstoolchains. My own '$sysroot's 
for the 'arm*-linux-gnueabi'
targets in my laptop are :

host-arm-angstrom-linux-gnueabi:
host-arm-cs2009-linux-gnueabi:
host-arm-cs2011-linux-gnueabi:
host-arm-debian-linux-gnueabi:
host-armel-debian-linux-gnueabi:
host-arm-linux-gnueabi:
host-arm-tizen-linux-gnueabi:
host-armv5tel-redhat-linux-gnueabi:
host-armv7hl-redhat-linux-gnueabi:
host-armv7l-tizen-linux-gnueabi:

(there are many more for old MeeGo, Scratchbox etc distros in my desktop 
PC) Built just for a fun.
For instance built to try newer GCC releases than the one in the current 
Tizen-2.2.1
SDK :

[root@HP-Pavilion bin]# ./arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=./arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/kai/Tizen-2.2.1/data/tools/arm-linux-gnueabi-gcc-4.5/bin/../libexec/gcc/arm-linux-gnueabi/4.5.4/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../configure -v --enable-languages=c,c++ 
--prefix=/build/build_server/rsa/jobs/1261/temp/install-arm-linux 
--enable-shared --enable-multiarch 
--with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id 
--with-system-zlib --without-included-gettext --enable-threads=posix 
--enable-nls --disable-bootstrap --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin 
--enable-gold --enable-ld=default --with-plugin-ld=ld.gold 
--disable-sjlj-exceptions --with-arch=armv7-a --with-tune=cortex-a8 
--with-float=softfp --with-fpu=vfpv3-d16 --enable-checking=release 
--program-prefix=arm-linux-gnueabi- --target=arm-linux-gnueabi 
--with-sysroot=/build/build_server/rsa/jobs/1261/buildroot/platforms/tizen2.2/rootstraps/tizen-device-2.2.devel
Thread model: posix
gcc version 4.5.4 20120105 (prerelease) (Linaro GCC 4.5-2012.01)

Furthermore as an old Unix guy I have never liked the current bloat in 
names like here :

    --prefix=/build/build_server/rsa/jobs/1261/temp/install-arm-linux
and
    
--with-sysroot=/build/build_server/rsa/jobs/1261/buildroot/platforms/tizen2.2/rootstraps/tizen-device-2.2.devel

Prefering simpler and much shorter names like :

   --prefix=/opt/cross
and
   --with-sysroot=/opt/host-arm-tizen-linux-gnueabi

Nothing should disable one to try first crosstoolchains for some 
existing target like Tizen. for instance
gcc-4.6.x, gcc-4.7.x, gcc-4.8.x, gcc-4.9.x for that.  The previous 
Linaro-made toolchain could give some
hints for configuring the self-made GCCs... Like I shamelessly did :

[root@HP-Pavilion bin]# arm-tizen-linux-gnueabi-gcc-4.8 -v
Using built-in specs.
COLLECT_GCC=arm-tizen-linux-gnueabi-gcc-4.8
COLLECT_LTO_WRAPPER=/media/2c439158-ef3e-4dcf-a63b-03191c302829/opt/cross/bin/../lib/gcc/arm-tizen-linux-gnueabi/4.8.2/lto-wrapper
Target: arm-tizen-linux-gnueabi
Configured with: ../configure --build=i686-linux-gnu 
--host=i686-linux-gnu --target=arm-tizen-linux-gnueabi 
--prefix=/opt/cross --with-sysroot=/opt/host-arm-tizen-linux-gnueabi 
--libdir=/opt/cross/lib --libexecdir=/opt/cross/lib 
--enable-languages=c,c++ --disable-sjlj-exceptions 
--without-included-gettext --enable-shared --enable-threads=posix 
--disable-nls --disable-bootstrap --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--enable-checking=release --enable-version-specific-runtime-libs 
--with-arch=armv7-a --with-tune=cortex-a8 --with-float=softfp 
--with-fpu=vfpv3-d16 --with-gxx-include-dir=/opt/cross/include/c++/4.8.2 
--program-prefix=arm-tizen-linux-gnueabi- --program-suffix=-4.8
Thread model: posix
gcc version 4.8.2 (by Kai Ruottu)

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

* Re: Problem with ARM cross compiler
  2013-12-19  8:15   ` Kai Ruottu
@ 2013-12-19  9:23     ` Brian Drummond
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Drummond @ 2013-12-19  9:23 UTC (permalink / raw)
  To: gcc-help

On Thu, 2013-12-19 at 10:15 +0200, Kai Ruottu wrote:
> 19.12.2013 2:15, Maxim Kuvyrkov kirjoitti:
> > On 19/12/2013, at 7:59 am, Hendrik Greving<hendrik.greving.intel@gmail.com>  wrote:
> >
> >> I am compiling (trying to) ARM cross compiler (on x86):
> >>
> >>
> > ...
> >> conftest.c:15:19: fatal error: stdio.h: No such file or directory
> >>
> >>
> >> Any help/hint appreciated,
> > You don't have cross-built C library installed.  Building a cross toolchain from scratch is an intricate process, it is not building just the compiler, you also need bintutils, C library headers and C library itself.
> 
> I have never fully understood why the "totally from scratch target" is 
> the first many people are trying
> when there are existing targets for crosstoolchains. My own '$sysroot's 
> for the 'arm*-linux-gnueabi'
> targets in my laptop are :
> 
> host-arm-angstrom-linux-gnueabi:
> host-arm-cs2009-linux-gnueabi:
> host-arm-cs2011-linux-gnueabi:
 and many others...

How many of those are comprehensive toolchains, and how many omit bits
of gcc, like Ada or Fortran for example?

- Brian

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

* Re: Problem with ARM cross compiler
  2013-12-19  0:16 ` Maxim Kuvyrkov
  2013-12-19  8:15   ` Kai Ruottu
@ 2013-12-19  9:53   ` Andrew Haley
  2013-12-19 18:46     ` Hendrik Greving
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Haley @ 2013-12-19  9:53 UTC (permalink / raw)
  To: Maxim Kuvyrkov, Hendrik Greving; +Cc: gcc-help

On 12/19/2013 12:15 AM, Maxim Kuvyrkov wrote:
> On 19/12/2013, at 7:59 am, Hendrik Greving <hendrik.greving.intel@gmail.com> wrote:
> 
>> I am compiling (trying to) ARM cross compiler (on x86):
>>
>>
> ...
>> conftest.c:15:19: fatal error: stdio.h: No such file or directory
>>
>>
>> Any help/hint appreciated,
> 
> You don't have cross-built C library installed.  Building a cross
> toolchain from scratch is an intricate process, it is not building
> just the compiler, you also need bintutils, C library headers and C
> library itself.

Sure, but you don't need a special C library: all you have to do is
unpack the root filesystem of your target and point the --with-sysroot
at it when configuring GCC.

Andrew.

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

* Re: Problem with ARM cross compiler
  2013-12-19  9:53   ` Andrew Haley
@ 2013-12-19 18:46     ` Hendrik Greving
  0 siblings, 0 replies; 6+ messages in thread
From: Hendrik Greving @ 2013-12-19 18:46 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Maxim Kuvyrkov, gcc-help

I took a prebuilt one from codesourcery instead..
Thanks,
Hendrik

On Thu, Dec 19, 2013 at 1:53 AM, Andrew Haley <aph@redhat.com> wrote:
> On 12/19/2013 12:15 AM, Maxim Kuvyrkov wrote:
>> On 19/12/2013, at 7:59 am, Hendrik Greving <hendrik.greving.intel@gmail.com> wrote:
>>
>>> I am compiling (trying to) ARM cross compiler (on x86):
>>>
>>>
>> ...
>>> conftest.c:15:19: fatal error: stdio.h: No such file or directory
>>>
>>>
>>> Any help/hint appreciated,
>>
>> You don't have cross-built C library installed.  Building a cross
>> toolchain from scratch is an intricate process, it is not building
>> just the compiler, you also need bintutils, C library headers and C
>> library itself.
>
> Sure, but you don't need a special C library: all you have to do is
> unpack the root filesystem of your target and point the --with-sysroot
> at it when configuring GCC.
>
> Andrew.

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

end of thread, other threads:[~2013-12-19 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18 18:59 Problem with ARM cross compiler Hendrik Greving
2013-12-19  0:16 ` Maxim Kuvyrkov
2013-12-19  8:15   ` Kai Ruottu
2013-12-19  9:23     ` Brian Drummond
2013-12-19  9:53   ` Andrew Haley
2013-12-19 18:46     ` Hendrik Greving

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