i386-rtems

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Aug 15 10:19:54 UTC 2000


Damjan Lampret wrote:
> 
> On Tue, 15 Aug 2000, Ralf Corsepius wrote:
> 
> > Damjan Lampret wrote:
> [cut]
> > > # rtems-ss-20000811/configure --target=i386-rtems --enable-rtemsbsp=pc386
> > > --disable-posix --disable-itron
> > >
> >
> > There are several potential issues with this command line:
> >
> > 1. Are you having the source-tree in a subdirectory of you
> > build-directory? This might interfere with building, because the
> > process of building creates directories. Please use a separate and
> > empty build-directory instead.
> >
> 
> Actually I do. OK, I'll try emptry build directory.
> 
> > 2. Not specifying --prefix means installing to /usr/local. This
> > should not hurt wrt. rtems, but might interfere with other packages,
> 
> You just gave me an idea. Instead of using --prefix-program I put
> /opt/rtems/bin in my PATH variable (so that configure can find correct
> tools). Should I rather use --prefix-program instead of setting my PATH?

No. Having the cross tools (i386-rtems-gcc etc.) in $PATH is
correct.

This is what I am using:
# echo $PATH
/opt/rtems/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin
# which gcc
/usr/bin/gcc
# which i386-rtems-gcc
/opt/rtems/bin/i386-rtems-gcc

--prefix=<directory> specifies the directory where a packages (here:
RTEMS) gets installed to when invoking 'make install'. 
The issue I was talking about is that a native gcc has
/usr/local/include in its default include-path by default. Therefore
headers installed to /usr/local/include might interfere with the
system's headers (/usr/include) for native compilation, because
/usr/local/include has precedence over /usr/include in a native
gcc's include-path.

E.g.:
# gcc -v hello.c -o hello
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/lib/gcc-lib/i486-suse-linux/2.95.2/cpp -lang-c -v -D__GNUC__=2
-D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__
-D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix)
-Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486
-D__i486 -D__i486__ hello.c /tmp/ccWVYnEB.i
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i486-suse-linux/2.95.2/include
 /usr/include
End of search list.
[..]

Now, if a cross-package accidentially installs its headers to
/usr/local/include, /usr/local/include will contain cross-headers
and your system will be corrupted. Never using the default prefix
(/usr/local) for configuring cross-packages (gcc/binutils/RTEMS) is
a simple means of precaution to avoid such conflicts.

Ralf

-- 
Ralf Corsepius 
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung
(FAW)
Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
mailto:corsepiu at faw.uni-ulm.de           FAX: +49/731/501-999  
http://www.faw.uni-ulm.de



More information about the users mailing list