Compilation issues under i386 for i386.

Jean Gabriel Gonzalez jeangabriel at ou.edu
Fri May 25 23:34:28 UTC 2007


Hello,
Thanks for your answer,
-We  have done what you told  us. Yes, we have obtained and installed the
required tool-chain. Here besides the list of the packages:
rtems-4.6-autoconf-rtems-2.59-0.noarch.rpm
rtems-4.6-automake-rtems-1.7.2-2.noarch.rpm

 rpm -i rtems-4.6-rtems-base-binutils-2.13.2.1-2.i386.rpm
rpm -i rtems-4.6-i386-rtems-binutils-2.13.2.1-2.i386.rpm
rpm -i rtems-4.6-rtems-base-gcc-gcc3.2.3newlib1.11.0-3.i386.rpm
rpm -i rtems-4.6- i386-rtems-c++-gcc3.2.3newlib1.11.0-3.i386.rpm
rpm -i rtems-4.6- i386-rtems-gcc-gcc3.2.3newlib1.11.0-3.i386.rpm
rpm -i rtems-4.6-rtems-base-gdb-5.2-1.i386.rpm
rpm -i rtems-4.6- i386-rtems-gdb-5.2-1.i386.rpm

-First of all , our <INSTALL_POINT>, where  is the rtems tool-chain is :

 /opt/rtems-4.7/bin

-So, before to run the /configure, we’ve done this command : 

export  PATH=/opt/rtems-4.7/bin:${PATH}

-Then, we added --prefix to the configure command, like that : 

# /root/Desktop/rtems-4.7.1/configure --target=i386
--enable-rtemsbsp=pc386   --prefix=/opt/rtems-4.7/bin

- This command works well. After that, we verified the operation of the
cross toolset by assembling the small program proposed in the RTEMS
documentation. So, In a temporary working directory called « test », we
placed the following function in a file named f.c :

int f( int x )
{
return x + 1;
}


- Then we assembled the file using the following command :

[root at localhost test]# i386-rtems4.7-gcc -v -S f.c

Using built-in specs. 
Target: i386-rtems4.7 
Configured with: ../gcc-4.1.1/configure --prefix=/opt/rtems-4.7
--bindir=/opt/rtems-4.7/bin --exec_prefix=/opt/rtems-4.7
--includedir=/opt/rtems-4.7/include --libdir=/opt/rtems-4.7/lib
--libexecdir=/opt/rtems-4.7/libexec --mandir=/opt/rtems-4.7/man
--infodir=/opt/rtems-4.7/info --datadir=/opt/rtems-4.7/share
--build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu
--target=i386-rtems4.7 --with-gnu-as --with-gnu-ld --verbose --with-newlib
--with-system-zlib --disable-nls --without-included-gettext
--disable-win32-registry --enable-version-specific-runtime-libs
--enable-threads --enable-languages=c,c++ 
Thread model: rtems 
gcc version 4.1.1 (RTEMS gcc-4.1.1/newlib-1.15.0-10.fc6) 
/opt/rtems-4.7/libexec/gcc/i386-rtems4.7/4.1.1/cc1 -quiet -v f.c -quiet
-dumpbase f.c -auxbase f -version -o f.s 
ignoring nonexistent directory
"/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/../../../../i386-rtems4.7/sys-in
clude" 
#include "..." search starts here: 
#include <...> search starts here: 
/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/include 
/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/../../../../i386-rtems4.7/include

End of search list. 
GNU C version 4.1.1 (RTEMS gcc-4.1.1/newlib-1.15.0-10.fc6) (i386-rtems4.7) 
       compiled by GNU C version 4.1.1 20070105 (Red Hat 4.1.1-51). 
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127922 
Compiler executable checksum: 89a56adc120fe790060c6d3517dc6fca


- So, this step is ok and these above paths correspond to our <INSTALL
POINT>.  After, we compiled the file f.c : 


[root at localhost test]# i386-rtems4.7-gcc -v -c f.c 

Using built-in specs. 
Target: i386-rtems4.7 
Configured with: ../gcc-4.1.1/configure --prefix=/opt/rtems-4.7
--bindir=/opt/rtems-4.7/bin --exec_prefix=/opt/rtems-4.7
--includedir=/opt/rtems-4.7/include --libdir=/opt/rtems-4.7/lib
--libexecdir=/opt/rtems-4.7/libexec --mandir=/opt/rtems-4.7/man
--infodir=/opt/rtems-4.7/info --datadir=/opt/rtems-4.7/share
--build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu
--target=i386-rtems4.7 --with-gnu-as --with-gnu-ld --verbose --with-newlib
--with-system-zlib --disable-nls --without-included-gettext
--disable-win32-registry --enable-version-specific-runtime-libs
--enable-threads --enable-languages=c,c++ 
Thread model: rtems 
gcc version 4.1.1 (RTEMS gcc-4.1.1/newlib-1.15.0-10.fc6) 
/opt/rtems-4.7/libexec/gcc/i386-rtems4.7/4.1.1/cc1 -quiet -v f.c -quiet
-dumpbase f.c -auxbase f -version -o /tmp/ccFJ3Ldy.s 
ignoring nonexistent directory
"/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/../../../../i386-rtems4.7/sys-in
clude" 
#include "..." search starts here: 
#include <...> search starts here: 
/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/include 
/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/../../../../i386-rtems4.7/include

End of search list. 
GNU C version 4.1.1 (RTEMS gcc-4.1.1/newlib-1.15.0-10.fc6) (i386-rtems4.7) 
       compiled by GNU C version 4.1.1 20070105 (Red Hat 4.1.1-51). 
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127922 
Compiler executable checksum: 89a56adc120fe790060c6d3517dc6fca 
/opt/rtems-4.7/lib/gcc/i386-rtems4.7/4.1.1/../../../../i386-rtems4.7/bin/as
-o f.o /tmp/ccFJ3Ldy.s 

-Conclusion : The cross compiler is able to find the cross assembler!

-Then, we Made a build directory in order to build the RTEMS product in this
directory with the following command : 

[root at localhost build_directory]# make all install 

- Unfortunately, we have some problems yet and the compilation doesn’t
finish  at this point: 

configure: error: no acceptable cc found in $PATH
gmake[2]: *** [pc386] Error 1
gmake[2]: Leaving directory `/rtems/i386-rtems/c'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/rtems/i386-rtems/c'
make: *** [all-recursive] Error 1

-But we found on the rtems mailing-list a solution to this problem by
specifying and exporting the CC variable. Actually, we don’t know if it’s
right to do that : 
CC=gcc ; export CC
-Now, if we try to compile, we haven’t the same error, but there is still a
problem : 
gmake[7]: Entering directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit/score/c
pu/i386' 
gcc --pipe -DHAVE_CONFIG_H   -I../../..
-I../../../../cpukit/../../../pc386/lib/include  -Wall -fasm -O2 -g -MT
libscorecpu_a-cpu.o -MD -MP -MF .deps/libscorecpu_a-cpu.Tpo -c -o
libscorecpu_a-cpu.o `test -f 'cpu.c' || echo
'/root/Desktop/rtems-4.7.1/c/src/../../cpukit/score/cpu/i386/'`cpu.c 
mv -f .deps/libscorecpu_a-cpu.Tpo .deps/libscorecpu_a-cpu.Po 
gcc --pipe -DHAVE_CONFIG_H   -I../../..
-I../../../../cpukit/../../../pc386/lib/include  -DASM -O2 -g -O2 -g -MT
libscorecpu_a-cpu_asm.o -MD -MP -MF .deps/libscorecpu_a-cpu_asm.Tpo -c -o
libscorecpu_a-cpu_asm.o `test -f 'cpu_asm.S' || echo
'/root/Desktop/rtems-4.7.1/c/src/../../cpukit/score/cpu/i386/'`cpu_asm.S 
mv -f .deps/libscorecpu_a-cpu_asm.Tpo .deps/libscorecpu_a-cpu_asm.Po 
rm -f libscorecpu.a 
no cru libscorecpu.a libscorecpu_a-cpu.o libscorecpu_a-cpu_asm.o 
gmake[7]: no: Command not found 
gmake[7]: *** [libscorecpu.a] Error 127 
gmake[7]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit/score/c
pu/i386' 
gmake[6]: *** [all-recursive] Error 1 
gmake[6]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit/score/c
pu' 
gmake[5]: *** [all-recursive] Error 1 
gmake[5]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit/score' 
gmake[4]: *** [all-recursive] Error 1 
gmake[4]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit' 
gmake[3]: *** [all] Error 2 
gmake[3]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386/cpukit' 
gmake[2]: *** [all-recursive] Error 1 
gmake[2]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c/pc386' 
gmake[1]: *** [all-recursive] Error 1 
gmake[1]: Leaving directory
`/root/Desktop/rtems-4.7.1/tools/build_directory/i386/c' 
make: *** [all-recursive] Error 1

So, i don’t understand why the compilation has a problem because we followed
your advices and the rtems-documentation. If you have new any ideas, let us
know.
Many thanks

Desarmeaux matthieu & Jean Gabriel Gonzalez
Interns in the University of Oklahoma
School of Computer Science

-----Message d'origine-----
De : Daron Chabot [mailto:daron.chabot at usask.ca] 
Envoyé : vendredi 25 mai 2007 11:17
À : Jean Gabriel Gonzalez
Cc : rtems-users at rtems.org
Objet : Re: Compilation issues under i386 for i386.

I'm pretty sure that I already responded to this... (maybe i forgot to
cc The List ?):

On Thu, 2007-05-24 at 16:51 -0500, Jean Gabriel Gonzalez wrote:
> Hello everybody,
>  
> I am working on a i386 computer in order to compile RTEMS 4.7.99.1 for
> a i386 target, but i have some compilation problems. 
> 
> I work under Fedora core 6 distribution.
>  
> So, i created a directory "/rtems" to run the configure :
>  
> /root/Desktop/rtems-4.7.99.1/configure --target=i386-rtems --enable-
> rtemsbsp=pc386

It looks like the configure option, --prefix=/rtems, is missing from
your invocation.  The default location may be under /usr/local, which is
probably not what you want.

>  
> The configure works well, i have these messages :
>  
> target architecture: i386.
> available BSPs: pc386.
> 'gmake all' will build the following BSPs: pc386.
> other BSPs can be built with 'gmake RTEMS_BSP="bsp1 bsp2 ..."'
>  
> config.status: creating Makefile
> config.status: creating make/Makefile
>  
>  
>  
> Then, like it's indicated in the documentation started.pdf ( export 
> PATH=<INSTALL_POINT>/bin:${PATH} ), i made this command :
>  
> export PATH=/rtems/bin:${PATH}
> Then I specify the CC variable like that :
>  
> # CC=gcc ;export CC
> After, i make the following command : gmake all

After a quick look through "started.pdf", I couldn't find where it
indicates that you must set CC=gcc; export CC.  This is not necessary
(and probably just wrong): correctly configuring your PATH to point to
the rtems tool-chain should suffice.

I'm assuming that you've already obtained/installed the required tool-
chain... and you have, right ?

>  
> The compilation starts but i have a problem at this point :
>  
> gmake[7]: Entering directory 
> `/rtems/i386-rtems/c/pc386/cpukit/score/cpu/i386'
> gcc --pipe -DHAVE_CONFIG_H -I../../.. 
  ^^^

I'm also pretty sure that your native gcc shouldn't be getting used
here... :-)


-- dc




More information about the users mailing list