public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* cross-compiler intel -> powerpc-gnu-linux
@ 2000-06-12 14:51 Bob Robison
  2000-06-12 16:00 ` Bill Webster
  2000-06-12 17:52 ` Brendan Simon
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Robison @ 2000-06-12 14:51 UTC (permalink / raw)
  To: CrossGCC; +Cc: bsimon

I have been reading through the archives (which have been very helpful) -- but I am still having
problems building the cross-compiler I want.  My setup is:

gcc-2.95.2    glibc-2.1.3  binutils-2.9.1

Binutils seems to build with no problems.  My configure line for gcc (from a build directory) is:

../gcc-2.95.2/configure --target=powerpc-gnu-linux --prefix=/usr/crosslinux \
--exec-prefix=/usr/crosslinux --program-suffix=linppc -v --enable-languages=c \
--with-headers=/usr/local/temp/glibc-2.1.3/include

The problem I have is exactly the same as what Brendan Simon reported on January 24th:
The --with-headers line copies everything from glibc-2.1.3/include into a sys-include directory
(in my case: /usr/crosslinux/powerpc-gnu-linux/sys-include)  But some of these files reference
include files that are one level up.  i.e. sys/cdefs.h is a single line file that includes
<misc/sys/cdefs.h>  This misc directory is in the glibc-2.1.3 main directory -- but I'm not sure
how to reference it.  I don't think I should set my --with-headers= argument to reference the whole
glibc-2.1.3 directory!

Any ideas? 
(output below is snipped from the output of >make LANGUAGES=c all install
--------------------
make[3]: Entering directory `/usr/local/temp/gcc-build/gcc'
rm -f tmplibgcc2.a
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2
_udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi
_fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi
_floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
_ctors _pure; \
do \
  echo ${name}; \
  /usr/local/temp/gcc-build/gcc/xgcc -B/usr/local/temp/gcc-build/gcc/
-B/usr/crosslinux/powerpc-gnu-linux/bin/ -I/usr/crosslinux/powerpc-gnu-linux/include -O2 
-DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mstrict-align -I. -I../../gcc-2.95.2/gcc
-I../../gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
       ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  arlinppc rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
_divdi3
_moddi3
_udivdi3
_umoddi3
_negdi2
_lshrdi3
_ashldi3
_ashrdi3
_ffsdi2
_udiv_w_sdiv
_udivmoddi4
_cmpdi2
_ucmpdi2
_floatdidf
_floatdisf
_fixunsdfsi
In file included from
/usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/featu
res.h:250,
                 from
/usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/limit
s.h:26,
                 from /usr/local/temp/gcc-build/gcc/include/limits.h:117,
                 from include/syslimits.h:7,
                 from include/limits.h:11,
                 from ../../gcc-2.95.2/gcc/libgcc2.c:1105:
/usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/sys/c
defs.h:1: misc/sys/cdefs.h: No such file or directory




Please help!
bob
-----------
This message was sent by XFMail at 16:43:09 on 12-Jun-00 by:
Bob Robison          Southwest Research Institute, http://www.swri.org
Staff Engineer             Signal Exploitation & Geolocation Division
brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
<><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

* Re: cross-compiler intel -> powerpc-gnu-linux
  2000-06-12 14:51 cross-compiler intel -> powerpc-gnu-linux Bob Robison
@ 2000-06-12 16:00 ` Bill Webster
  2000-06-12 17:52 ` Brendan Simon
  1 sibling, 0 replies; 6+ messages in thread
From: Bill Webster @ 2000-06-12 16:00 UTC (permalink / raw)
  To: Bob Robison; +Cc: CrossGCC

I recently conpleted a build of the cross compiler for ppc. I did not experience the same problem that
you seem to be having. I was having a problem with the linker (unsupported emulation). I was able to
finally resolve the problem by using binutils-2.9.5.0.46. I downloaded it from
ftp://ftp.varesearch.com/pub/support/hjl/binutils/ .


Bob Robison wrote:

> I have been reading through the archives (which have been very helpful) -- but I am still having
> problems building the cross-compiler I want.  My setup is:
>
> gcc-2.95.2    glibc-2.1.3  binutils-2.9.1
>
> Binutils seems to build with no problems.  My configure line for gcc (from a build directory) is:
>
> ../gcc-2.95.2/configure --target=powerpc-gnu-linux --prefix=/usr/crosslinux \
> --exec-prefix=/usr/crosslinux --program-suffix=linppc -v --enable-languages=c \
> --with-headers=/usr/local/temp/glibc-2.1.3/include
>
> The problem I have is exactly the same as what Brendan Simon reported on January 24th:
> The --with-headers line copies everything from glibc-2.1.3/include into a sys-include directory
> (in my case: /usr/crosslinux/powerpc-gnu-linux/sys-include)  But some of these files reference
> include files that are one level up.  i.e. sys/cdefs.h is a single line file that includes
> <misc/sys/cdefs.h>  This misc directory is in the glibc-2.1.3 main directory -- but I'm not sure
> how to reference it.  I don't think I should set my --with-headers= argument to reference the whole
> glibc-2.1.3 directory!
>
> Any ideas?
> (output below is snipped from the output of >make LANGUAGES=c all install
> --------------------
> make[3]: Entering directory `/usr/local/temp/gcc-build/gcc'
> rm -f tmplibgcc2.a
> for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2
> _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi
> _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi
> _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
> _ctors _pure; \
> do \
>   echo ${name}; \
>   /usr/local/temp/gcc-build/gcc/xgcc -B/usr/local/temp/gcc-build/gcc/
> -B/usr/crosslinux/powerpc-gnu-linux/bin/ -I/usr/crosslinux/powerpc-gnu-linux/include -O2
> -DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2
> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mstrict-align -I. -I../../gcc-2.95.2/gcc
> -I../../gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
>        ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>   arlinppc rc tmplibgcc2.a ${name}.o; \
>   rm -f ${name}.o; \
> done
> _muldi3
> _divdi3
> _moddi3
> _udivdi3
> _umoddi3
> _negdi2
> _lshrdi3
> _ashldi3
> _ashrdi3
> _ffsdi2
> _udiv_w_sdiv
> _udivmoddi4
> _cmpdi2
> _ucmpdi2
> _floatdidf
> _floatdisf
> _fixunsdfsi
> In file included from
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/featu
> res.h:250,
>                  from
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/limit
> s.h:26,
>                  from /usr/local/temp/gcc-build/gcc/include/limits.h:117,
>                  from include/syslimits.h:7,
>                  from include/limits.h:11,
>                  from ../../gcc-2.95.2/gcc/libgcc2.c:1105:
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/sys/c
> defs.h:1: misc/sys/cdefs.h: No such file or directory
>
> Please help!
> bob
> -----------
> This message was sent by XFMail at 16:43:09 on 12-Jun-00 by:
> Bob Robison          Southwest Research Institute, http://www.swri.org
> Staff Engineer             Signal Exploitation & Geolocation Division
> brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
> <><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2
>
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

--
=============================================================
Bill Webster
Phone: (801) 426-5001 x283
Email: billw@lineo.com




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

* Re: cross-compiler intel -> powerpc-gnu-linux
  2000-06-12 14:51 cross-compiler intel -> powerpc-gnu-linux Bob Robison
  2000-06-12 16:00 ` Bill Webster
@ 2000-06-12 17:52 ` Brendan Simon
  2000-06-13 12:35   ` Bob Robison
  1 sibling, 1 reply; 6+ messages in thread
From: Brendan Simon @ 2000-06-12 17:52 UTC (permalink / raw)
  To: Bob Robison; +Cc: CrossGCC

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4828 bytes --]

Hi Bob,

I remember this problem and it is very frustrating.  I can't rember how 
I solved it.  I'll have to look through my build scripts when I get 
home.  I have a feeling that I had the "preinstall" the header files 
manually.  ie. copy header files to $prefix/$target/include.  Also make 
sure the linux header files are there too.  I usually just use a 
symbolic link to the kernel headers.  Make sure it is not the kernel 
headers for your host (ie. /usr/include/linux or 
/usr/src/linux/include/linux) as the asm symbolic link will be wrong.
I can't be more specific at this stage but will have a better idea of 
what I did when I look at my build scripts.

BTW: I think the binutils I used was 2.9.5.0.24.  I'm sure there is a 
later version now.  I got it from H.Lu's site at vasystems.  I can't 
remeber the URL at the moment but I'm sure it must be in the archives 
somewhere.  I know that 2.9.1 is outdated and some problems were fixed 
for the powerpc.

Brendan Simon.



Bob Robison wrote:
> 
> I have been reading through the archives (which have been very helpful) -- but I am still having
> problems building the cross-compiler I want.  My setup is:
> 
> gcc-2.95.2    glibc-2.1.3  binutils-2.9.1
> 
> Binutils seems to build with no problems.  My configure line for gcc (from a build directory) is:
> 
> .../gcc-2.95.2/configure --target=powerpc-gnu-linux --prefix=/usr/crosslinux \
> --exec-prefix=/usr/crosslinux --program-suffix=linppc -v --enable-languages=c \
> --with-headers=/usr/local/temp/glibc-2.1.3/include
> 
> The problem I have is exactly the same as what Brendan Simon reported on January 24th:
> The --with-headers line copies everything from glibc-2.1.3/include into a sys-include directory
> (in my case: /usr/crosslinux/powerpc-gnu-linux/sys-include)  But some of these files reference
> include files that are one level up.  i.e. sys/cdefs.h is a single line file that includes
>   This misc directory is in the glibc-2.1.3 main directory -- but I'm not sure
> how to reference it.  I don't think I should set my --with-headers= argument to reference the whole
> glibc-2.1.3 directory!
> 
> Any ideas? 
> (output below is snipped from the output of >make LANGUAGES=c all install
> --------------------
> make[3]: Entering directory &pi0;/usr/local/temp/gcc-build/gcc'
> rm -f tmplibgcc2.a
> for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2
> _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi
> _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi
> _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
> _ctors _pure; \
> do \
>   echo ${name}; \
>   /usr/local/temp/gcc-build/gcc/xgcc -B/usr/local/temp/gcc-build/gcc/
> -B/usr/crosslinux/powerpc-gnu-linux/bin/ -I/usr/crosslinux/powerpc-gnu-linux/include -O2 
> -DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2
> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mstrict-align -I. -I../../gcc-2.95.2/gcc
> -I../../gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
>        ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>   arlinppc rc tmplibgcc2.a ${name}.o; \
>   rm -f ${name}.o; \
> done
> _muldi3
> _divdi3
> _moddi3
> _udivdi3
> _umoddi3
> _negdi2
> _lshrdi3
> _ashldi3
> _ashrdi3
> _ffsdi2
> _udiv_w_sdiv
> _udivmoddi4
> _cmpdi2
> _ucmpdi2
> _floatdidf
> _floatdisf
> _fixunsdfsi
> In file included from
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/featu
> res.h:250,
>                  from
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/limit
> s.h:26,
>                  from /usr/local/temp/gcc-build/gcc/include/limits.h:117,
>                  from include/syslimits.h:7,
>                  from include/limits.h:11,
>                  from ../../gcc-2.95.2/gcc/libgcc2.c:1105:
> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/sys/c
> defs.h:1: misc/sys/cdefs.h: No such file or directory
> 
> 
> 
> 
> Please help!
> bob
> -----------
> This message was sent by XFMail at 16:43:09 on 12-Jun-00 by:
> Bob Robison          Southwest Research Institute, http://www.swri.org
> Staff Engineer             Signal Exploitation & Geolocation Division
> brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
> <><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2
> 
> 



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

* Re: cross-compiler intel -> powerpc-gnu-linux
  2000-06-12 17:52 ` Brendan Simon
@ 2000-06-13 12:35   ` Bob Robison
  2000-06-13 14:49     ` Bill Webster
  0 siblings, 1 reply; 6+ messages in thread
From: Bob Robison @ 2000-06-13 12:35 UTC (permalink / raw)
  To: CrossGCC

OK, I got the new (2.9.5.0.46) binutils and built it with no real problems.  I configured gcc
adding a -with-headers line to point at a copy of powerpc-linux kernel
headers that I have (from a fairly recent kernel).  I was able to get successfully through the gcc
build with that.  Now I
need to build glibc.  This seems more complicated.  I tried the following configure line, and
directly referenced the sys-include directory utilized in the gcc build.  (I know this sounds
kludgy... I'm open to other ideas!)  The build continued on for quite a ways before failing.


#!/bin/sh
CC=powerpc-gnu-linux-gcc ../glibc-2.1.3/configure --host=powerpc-gnu-linux
--build=powerpc-gnu-linux --target=powerpc-gnu-linux
 --prefix=/usr/crosslinux --exec-prefix=/usr/crosslinux --program-suffix=linppc -v
--enable-languages=c --with-binutils=/usr/cr
osslinux/powerpc-gnu-linux/bin --enable-add-ons=linuxthreads,crypt
--with-headers=/usr/crosslinux/powerpc-gnu-linux/sys-include

(ignore the linewraps)  I had to but in host= and build= for powerpc to get things cranking.  It
goes for quite a while, but then while trying to do a link step it complains:

powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ -nostdlib -nostartfiles -o
/usr/local/temp/build-glibc/locale/localedef  -Wl,-dynamic-linker=/usr/crosslinux/lib/ld.so.1  
/usr/local/temp/build-glibc/csu/crt1.o /usr/local/temp/build-glibc/csu/crti.o
`powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ --print-file-name=crtbegin.o`
/usr/local/temp/build-glibc/locale/localedef.o /usr/local/temp/build-glibc/locale/ld-ctype.o
/usr/local/temp/build-glibc/locale/ld-messages.o /usr/local/temp/build-glibc/locale/ld-monetary.o
/usr/local/temp/build-glibc/locale/ld-numeric.o /usr/local/temp/build-glibc/locale/ld-time.o
/usr/local/temp/build-glibc/locale/ld-collate.o /usr/local/temp/build-glibc/locale/charmap.o
/usr/local/temp/build-glibc/locale/charset.o /usr/local/temp/build-glibc/locale/linereader.o
/usr/local/temp/build-glibc/locale/locfile.o /usr/local/temp/build-glibc/locale/stringtrans.o
/usr/local/temp/build-glibc/locale/repertoire.o /usr/local/temp/build-glibc/locale/simple-hash.o
/usr/local/temp/build-glibc/locale/xmalloc.o /usr/local/temp/build-glibc/locale/xstrdup.o 
-Wl,-rpath-link=/usr/local/temp/build-glibc:/usr/local/temp/build-glibc/math:/usr/local/temp/build-g
libc/elf:/usr/local/temp/build-glibc/nss:/usr/local/temp/build-glibc/nis:/usr/local/temp/build-glibc
/rt:/usr/local/temp/build-glibc/resolv:/usr/local/temp/build-glibc/db2:/usr/local/temp/build-glibc/l
inuxthreads /usr/local/temp/build-glibc/libc.so.6 /usr/local/temp/build-glibc/libc_nonshared.a
-lgcc `powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ --print-file-name=crtend.o`
/usr/local/temp/build-glibc/csu/crtn.o
/usr/local/temp/build-glibc/locale/localedef.o: In function `main':
/usr/local/temp/glibc-2.1.3/locale/programs/localedef.c:282: warning: mmap is not implemented and
will always fail
/usr/local/temp/build-glibc/libc.so.6: undefined reference to
`__syscall_getpriority'/usr/local/temp/build-glibc/libc.so.6: undefined reference to
`__syscall_execve'
/usr/local/temp/build-glibc/libc.so.6: undefined reference to `__syscall_sigaction'
/usr/local/temp/build-glibc/libc.so.6: undefined reference to `__syscall_sigprocmask'

and a bunch more __syscall_xxxx undefined.  I'm guessing that I did something dumb/obvious and
somehow the appropriate sysdefs that include syscall are not being built, or included in my
temporary libc.

Can anyone shed some light on this?  I'm not real familiar with where to look for gilbc
configuration/help.  The stuff I have seen does not address the cross-environment.

thanks,
bob

On 13-Jun-00 Brendan Simon wrote:
> Hi Bob,
> 
> I remember this problem and it is very frustrating._ I can't rember how 
> I solved it._ I'll have to look through my build scripts when I get 
> home._ I have a feeling that I had the "preinstall" the header files 
> manually._ ie. copy header files to $prefix/$target/include._ Also make 
> sure the linux header files are there too._ I usually just use a 
> symbolic link to the kernel headers._ Make sure it is not the kernel 
> headers for your host (ie. /usr/include/linux or 
> /usr/src/linux/include/linux) as the asm symbolic link will be wrong.
> I can't be more specific at this stage but will have a better idea of 
> what I did when I look at my build scripts.
> 
> BTW: I think the binutils I used was 2.9.5.0.24._ I'm sure there is a 
> later version now._ I got it from H.Lu's site at vasystems._ I can't 
> remeber the URL at the moment but I'm sure it must be in the archives 
> somewhere._ I know that 2.9.1 is outdated and some problems were fixed 
> for the powerpc.
> 
> Brendan Simon.
> 
> 
> 
> Bob Robison wrote:
>> 
>> I have been reading through the archives (which have been very helpful) -- but I am still having
>> problems building the cross-compiler I want.  My setup is:
>> 
>> gcc-2.95.2    glibc-2.1.3  binutils-2.9.1
>> 
>> Binutils seems to build with no problems.  My configure line for gcc (from a build directory)
>> is:
>> 
>> .../gcc-2.95.2/configure --target=powerpc-gnu-linux --prefix=/usr/crosslinux \
>> --exec-prefix=/usr/crosslinux --program-suffix=linppc -v --enable-languages=c \
>> --with-headers=/usr/local/temp/glibc-2.1.3/include
>> 
>> The problem I have is exactly the same as what Brendan Simon reported on January 24th:
>> The --with-headers line copies everything from glibc-2.1.3/include into a sys-include directory
>> (in my case: /usr/crosslinux/powerpc-gnu-linux/sys-include)  But some of these files reference
>> include files that are one level up.  i.e. sys/cdefs.h is a single line file that includes
>>   This misc directory is in the glibc-2.1.3 main directory -- but I'm not sure
>> how to reference it.  I don't think I should set my --with-headers= argument to reference the
>> whole
>> glibc-2.1.3 directory!
>> 
>> Any ideas? 
>> (output below is snipped from the output of >make LANGUAGES=c all install
>> --------------------
>> make[3]: Entering directory &pi0;/usr/local/temp/gcc-build/gcc'
>> rm -f tmplibgcc2.a
>> for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2
>> _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
>> _fixunsdfdi
>> _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi
>> _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
>> _ctors _pure; \
>> do \
>>   echo ${name}; \
>>   /usr/local/temp/gcc-build/gcc/xgcc -B/usr/local/temp/gcc-build/gcc/
>> -B/usr/crosslinux/powerpc-gnu-linux/bin/ -I/usr/crosslinux/powerpc-gnu-linux/include -O2 
>> -DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2
>> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mstrict-align -I. -I../../gcc-2.95.2/gcc
>> -I../../gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
>>        ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
>>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>>   arlinppc rc tmplibgcc2.a ${name}.o; \
>>   rm -f ${name}.o; \
>> done
>> _muldi3
>> _divdi3
>> _moddi3
>> _udivdi3
>> _umoddi3
>> _negdi2
>> _lshrdi3
>> _ashldi3
>> _ashrdi3
>> _ffsdi2
>> _udiv_w_sdiv
>> _udivmoddi4
>> _cmpdi2
>> _ucmpdi2
>> _floatdidf
>> _floatdisf
>> _fixunsdfsi
>> In file included from
>> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/fe
>> atu
>> res.h:250,
>>                  from
>> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/li
>> mit
>> s.h:26,
>>                  from /usr/local/temp/gcc-build/gcc/include/limits.h:117,
>>                  from include/syslimits.h:7,
>>                  from include/limits.h:11,
>>                  from ../../gcc-2.95.2/gcc/libgcc2.c:1105:
>> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/sy
>> s/c
>> defs.h:1: misc/sys/cdefs.h: No such file or directory
>> 
>> 
>> 
>> 
>> Please help!
>> bob
>> -----------
>> This message was sent by XFMail at 16:43:09 on 12-Jun-00 by:
>> Bob Robison          Southwest Research Institute, http://www.swri.org
>> Staff Engineer             Signal Exploitation & Geolocation Division
>> brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
>> <><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2
>> 
>> 
> 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

* Re: cross-compiler intel -> powerpc-gnu-linux
  2000-06-13 12:35   ` Bob Robison
@ 2000-06-13 14:49     ` Bill Webster
  2000-06-14  6:22       ` Bob Robison
  0 siblings, 1 reply; 6+ messages in thread
From: Bill Webster @ 2000-06-13 14:49 UTC (permalink / raw)
  To: Bob Robison; +Cc: CrossGCC

These are the steps that I followed to build the cross-compiler I am currently using (I am reasonably
certain that these are quite complete):

# Packages:
#   binutils-2.9.5.0.46.tar.gz
#   gcc-core-2.95.2.tar.gz
#   linux-2.2.15.tar.gz
#   glibc-2.1.3.tar.gz
#   glibc-crypt-2.1.tar.gz
#   glibc-linuxthreads.2.1.3.tar.gz
#

# Unpackage source

# Set up some environment vars
host=i686-linux
target=powerpc-linux
prefix=/opt/test
tprefix=${prefix}/${target}
bin=${prefix}/bin
binutils=../binutils-2.9.5.0.46
gcc=../gcc-2.95.2
glibc=../glibc-2.1.3
kernel=../linux-2.2.15

# Do some cleanup (if necessary) and prep work
rm -fr binutils-build gcc-build glibc-build
mkdir binutils-build gcc-build glibc-build

# Build tool chain
cd ${base}/binutils-build
${binutils}/configure --srcdir=${binutils} --prefix=${prefix} --target=${target}
make all
<make install>

cd ${base}/gcc-build
${gcc}/configure --srcdir=${gcc} --prefix=${prefix} --target=${target}
export PATH=${bin}:${PATH}
make all
<make install>

# Install kernel headers
<cd ${kernel}>
# Edit ${kernel}/Makefile, change line 'ARCH := ...' to 'ARCH := ppc'
<make menuconfig>
# In 'Platform support' select correct 'Processor type' and 'Machine type' and exit
# with save
<make dep>
# Copy kernal include files into tool chain install directory
<cp -dR ${kernel}/include/asm-ppc ${tprefix}/include/asm>
<cp -dR ${kernel}/include/linux ${tprefix}/include/linux>

# Finish tool chain
cd ${base}/glibc-build
CC=${target}-gcc
${glibc}/configure --srcdir=${glibc} --prefix=${tprefix} --build=${host}
--enable-add-ons=crypt,linuxthreads --with-headers=${tprefix}/include ${target}
make all
<make install>

All of the steps that are enclosed in '<...>' are steps which are performed while logged in as root.

]
Bob Robison wrote:

> OK, I got the new (2.9.5.0.46) binutils and built it with no real problems.  I configured gcc
> adding a -with-headers line to point at a copy of powerpc-linux kernel
> headers that I have (from a fairly recent kernel).  I was able to get successfully through the gcc
> build with that.  Now I
> need to build glibc.  This seems more complicated.  I tried the following configure line, and
> directly referenced the sys-include directory utilized in the gcc build.  (I know this sounds
> kludgy... I'm open to other ideas!)  The build continued on for quite a ways before failing.
>
> #!/bin/sh
> CC=powerpc-gnu-linux-gcc ../glibc-2.1.3/configure --host=powerpc-gnu-linux
> --build=powerpc-gnu-linux --target=powerpc-gnu-linux
>  --prefix=/usr/crosslinux --exec-prefix=/usr/crosslinux --program-suffix=linppc -v
> --enable-languages=c --with-binutils=/usr/cr
> osslinux/powerpc-gnu-linux/bin --enable-add-ons=linuxthreads,crypt
> --with-headers=/usr/crosslinux/powerpc-gnu-linux/sys-include
>
> (ignore the linewraps)  I had to but in host= and build= for powerpc to get things cranking.  It
> goes for quite a while, but then while trying to do a link step it complains:
>
> powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ -nostdlib -nostartfiles -o
> /usr/local/temp/build-glibc/locale/localedef  -Wl,-dynamic-linker=/usr/crosslinux/lib/ld.so.1
> /usr/local/temp/build-glibc/csu/crt1.o /usr/local/temp/build-glibc/csu/crti.o
> `powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ --print-file-name=crtbegin.o`
> /usr/local/temp/build-glibc/locale/localedef.o /usr/local/temp/build-glibc/locale/ld-ctype.o
> /usr/local/temp/build-glibc/locale/ld-messages.o /usr/local/temp/build-glibc/locale/ld-monetary.o
> /usr/local/temp/build-glibc/locale/ld-numeric.o /usr/local/temp/build-glibc/locale/ld-time.o
> /usr/local/temp/build-glibc/locale/ld-collate.o /usr/local/temp/build-glibc/locale/charmap.o
> /usr/local/temp/build-glibc/locale/charset.o /usr/local/temp/build-glibc/locale/linereader.o
> /usr/local/temp/build-glibc/locale/locfile.o /usr/local/temp/build-glibc/locale/stringtrans.o
> /usr/local/temp/build-glibc/locale/repertoire.o /usr/local/temp/build-glibc/locale/simple-hash.o
> /usr/local/temp/build-glibc/locale/xmalloc.o /usr/local/temp/build-glibc/locale/xstrdup.o
> -Wl,-rpath-link=/usr/local/temp/build-glibc:/usr/local/temp/build-glibc/math:/usr/local/temp/build-g
> libc/elf:/usr/local/temp/build-glibc/nss:/usr/local/temp/build-glibc/nis:/usr/local/temp/build-glibc
> /rt:/usr/local/temp/build-glibc/resolv:/usr/local/temp/build-glibc/db2:/usr/local/temp/build-glibc/l
> inuxthreads /usr/local/temp/build-glibc/libc.so.6 /usr/local/temp/build-glibc/libc_nonshared.a
> -lgcc `powerpc-gnu-linux-gcc -B/usr/crosslinux/powerpc-gnu-linux/bin/ --print-file-name=crtend.o`
> /usr/local/temp/build-glibc/csu/crtn.o
> /usr/local/temp/build-glibc/locale/localedef.o: In function `main':
> /usr/local/temp/glibc-2.1.3/locale/programs/localedef.c:282: warning: mmap is not implemented and
> will always fail
> /usr/local/temp/build-glibc/libc.so.6: undefined reference to
> `__syscall_getpriority'/usr/local/temp/build-glibc/libc.so.6: undefined reference to
> `__syscall_execve'
> /usr/local/temp/build-glibc/libc.so.6: undefined reference to `__syscall_sigaction'
> /usr/local/temp/build-glibc/libc.so.6: undefined reference to `__syscall_sigprocmask'
>
> and a bunch more __syscall_xxxx undefined.  I'm guessing that I did something dumb/obvious and
> somehow the appropriate sysdefs that include syscall are not being built, or included in my
> temporary libc.
>
> Can anyone shed some light on this?  I'm not real familiar with where to look for gilbc
> configuration/help.  The stuff I have seen does not address the cross-environment.
>
> thanks,
> bob
>
> On 13-Jun-00 Brendan Simon wrote:
> > Hi Bob,
> >
> > I remember this problem and it is very frustrating._ I can't rember how
> > I solved it._ I'll have to look through my build scripts when I get
> > home._ I have a feeling that I had the "preinstall" the header files
> > manually._ ie. copy header files to $prefix/$target/include._ Also make
> > sure the linux header files are there too._ I usually just use a
> > symbolic link to the kernel headers._ Make sure it is not the kernel
> > headers for your host (ie. /usr/include/linux or
> > /usr/src/linux/include/linux) as the asm symbolic link will be wrong.
> > I can't be more specific at this stage but will have a better idea of
> > what I did when I look at my build scripts.
> >
> > BTW: I think the binutils I used was 2.9.5.0.24._ I'm sure there is a
> > later version now._ I got it from H.Lu's site at vasystems._ I can't
> > remeber the URL at the moment but I'm sure it must be in the archives
> > somewhere._ I know that 2.9.1 is outdated and some problems were fixed
> > for the powerpc.
> >
> > Brendan Simon.
> >
> >
> >
> > Bob Robison wrote:
> >>
> >> I have been reading through the archives (which have been very helpful) -- but I am still having
> >> problems building the cross-compiler I want.  My setup is:
> >>
> >> gcc-2.95.2    glibc-2.1.3  binutils-2.9.1
> >>
> >> Binutils seems to build with no problems.  My configure line for gcc (from a build directory)
> >> is:
> >>
> >> .../gcc-2.95.2/configure --target=powerpc-gnu-linux --prefix=/usr/crosslinux \
> >> --exec-prefix=/usr/crosslinux --program-suffix=linppc -v --enable-languages=c \
> >> --with-headers=/usr/local/temp/glibc-2.1.3/include
> >>
> >> The problem I have is exactly the same as what Brendan Simon reported on January 24th:
> >> The --with-headers line copies everything from glibc-2.1.3/include into a sys-include directory
> >> (in my case: /usr/crosslinux/powerpc-gnu-linux/sys-include)  But some of these files reference
> >> include files that are one level up.  i.e. sys/cdefs.h is a single line file that includes
> >>   This misc directory is in the glibc-2.1.3 main directory -- but I'm not sure
> >> how to reference it.  I don't think I should set my --with-headers= argument to reference the
> >> whole
> >> glibc-2.1.3 directory!
> >>
> >> Any ideas?
> >> (output below is snipped from the output of >make LANGUAGES=c all install
> >> --------------------
> >> make[3]: Entering directory &pi0;/usr/local/temp/gcc-build/gcc'
> >> rm -f tmplibgcc2.a
> >> for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2
> >> _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
> >> _fixunsdfdi
> >> _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi
> >> _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit
> >> _ctors _pure; \
> >> do \
> >>   echo ${name}; \
> >>   /usr/local/temp/gcc-build/gcc/xgcc -B/usr/local/temp/gcc-build/gcc/
> >> -B/usr/crosslinux/powerpc-gnu-linux/bin/ -I/usr/crosslinux/powerpc-gnu-linux/include -O2
> >> -DCROSS_COMPILE -DIN_GCC -DHAIFA    -g -O2 -I./include  -fPIC -g1  -DIN_LIBGCC2
> >> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -mstrict-align -I. -I../../gcc-2.95.2/gcc
> >> -I../../gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
> >>        ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
> >>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
> >>   arlinppc rc tmplibgcc2.a ${name}.o; \
> >>   rm -f ${name}.o; \
> >> done
> >> _muldi3
> >> _divdi3
> >> _moddi3
> >> _udivdi3
> >> _umoddi3
> >> _negdi2
> >> _lshrdi3
> >> _ashldi3
> >> _ashrdi3
> >> _ffsdi2
> >> _udiv_w_sdiv
> >> _udivmoddi4
> >> _cmpdi2
> >> _ucmpdi2
> >> _floatdidf
> >> _floatdisf
> >> _fixunsdfsi
> >> In file included from
> >> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/fe
> >> atu
> >> res.h:250,
> >>                  from
> >> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/li
> >> mit
> >> s.h:26,
> >>                  from /usr/local/temp/gcc-build/gcc/include/limits.h:117,
> >>                  from include/syslimits.h:7,
> >>                  from include/limits.h:11,
> >>                  from ../../gcc-2.95.2/gcc/libgcc2.c:1105:
> >> /usr/crosslinux/lib/gcc-lib/powerpc-gnu-linux/2.95.2/../../../../powerpc-gnu-linux/sys-include/sy
> >> s/c
> >> defs.h:1: misc/sys/cdefs.h: No such file or directory
> >>
> >>
> >>
> >>
> >> Please help!
> >> bob
> >> -----------
> >> This message was sent by XFMail at 16:43:09 on 12-Jun-00 by:
> >> Bob Robison          Southwest Research Institute, http://www.swri.org
> >> Staff Engineer             Signal Exploitation & Geolocation Division
> >> brobison@swri.org               Phone:(210)522-3935/Fax:(210)522-2709
> >> <><    <><    <><    <><    <><    <><    <><    <><    <><   Col 3:2
> >>
> >>
> >
>
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

* Re: cross-compiler intel -> powerpc-gnu-linux
  2000-06-13 14:49     ` Bill Webster
@ 2000-06-14  6:22       ` Bob Robison
  0 siblings, 0 replies; 6+ messages in thread
From: Bob Robison @ 2000-06-14  6:22 UTC (permalink / raw)
  To: Bill Webster; +Cc: CrossGCC

Bill,

   This looks like a good setup -- but it doesn't work for me.  I'm playing around with it now,
maybe I can figure something out.  What is the difference between the gcc-core and gcc
distributions?  I thought maybe that would help, but it hasn't.

   My main problem with your instructions is that when building gcc it can't find include files
like stdlib.h and unistd.h.  This happens when compiling libgcc2.c, while building gcc.  You didn't
reference any 'with-headers=' line on your gcc configure example.  Did you really get it to work
without one?

   The main issue, it seems, is that to build gcc certain header files must be found.  These seem
to live in the glibc distribution, but in a funny place.  i.e. the stdlib.h file that is in the
glibc/include directory merely includes <stdlib/stdlib.h> and there are a number of other examples
like that.  It sort of appears that glibc needs to be built first (or re-structured somehow) before
the gcc build can use its include files.  Maybe gcc shouldn't be using glibc's include files, but
if not, I don't know how to resolve the stdlib.h, etc references in libgcc2.c

bob

On 13-Jun-00 Bill Webster wrote:
> These are the steps that I followed to build the cross-compiler I am currently using (I am
> reasonably
> certain that these are quite complete):
> 
># Packages:
>#   binutils-2.9.5.0.46.tar.gz
>#   gcc-core-2.95.2.tar.gz
>#   linux-2.2.15.tar.gz
>#   glibc-2.1.3.tar.gz
>#   glibc-crypt-2.1.tar.gz
>#   glibc-linuxthreads.2.1.3.tar.gz
>#
> 
># Unpackage source
> 
># Set up some environment vars
> host=i686-linux
> target=powerpc-linux
> prefix=/opt/test
> tprefix=${prefix}/${target}
> bin=${prefix}/bin
> binutils=../binutils-2.9.5.0.46
> gcc=../gcc-2.95.2
> glibc=../glibc-2.1.3
> kernel=../linux-2.2.15
> 
># Do some cleanup (if necessary) and prep work
> rm -fr binutils-build gcc-build glibc-build
> mkdir binutils-build gcc-build glibc-build
> 
># Build tool chain
> cd ${base}/binutils-build
> ${binutils}/configure --srcdir=${binutils} --prefix=${prefix} --target=${target}
> make all
> <make install>
> 
> cd ${base}/gcc-build
> ${gcc}/configure --srcdir=${gcc} --prefix=${prefix} --target=${target}
> export PATH=${bin}:${PATH}
> make all
> <make install>
> 
># Install kernel headers
> <cd ${kernel}>
># Edit ${kernel}/Makefile, change line 'ARCH := ...' to 'ARCH := ppc'
> <make menuconfig>
># In 'Platform support' select correct 'Processor type' and 'Machine type' and exit
># with save
> <make dep>
># Copy kernal include files into tool chain install directory
> <cp -dR ${kernel}/include/asm-ppc ${tprefix}/include/asm>
> <cp -dR ${kernel}/include/linux ${tprefix}/include/linux>
> 
># Finish tool chain
> cd ${base}/glibc-build
> CC=${target}-gcc
> ${glibc}/configure --srcdir=${glibc} --prefix=${tprefix} --build=${host}
> --enable-add-ons=crypt,linuxthreads --with-headers=${tprefix}/include ${target}
> make all
> <make install>
> 
> All of the steps that are enclosed in '<...>' are steps which are performed while logged in as
> root.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

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

end of thread, other threads:[~2000-06-14  6:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-12 14:51 cross-compiler intel -> powerpc-gnu-linux Bob Robison
2000-06-12 16:00 ` Bill Webster
2000-06-12 17:52 ` Brendan Simon
2000-06-13 12:35   ` Bob Robison
2000-06-13 14:49     ` Bill Webster
2000-06-14  6:22       ` Bob Robison

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