Hello,

Since I have met the same problem with ELDK 4.2 and Ubuntu 12.04 and
was able to fix (or at list WA) it, hope that this information might
be usefull.

1. build@build:/opt/eldk$ which gcc
/opt/eldk/usr/ppc-linux/bin/gcc

build@build:/opt/eldk$ gcc -o test main.c
/opt/eldk/usr/bin/../lib/gcc/powerpc-linux/4.2.2/../../../../powerpc-linux/bin/ld:
crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status

build@build:/opt/eldk$ ls -la /opt/eldk/usr/ppc-linux/bin/gcc
lrwxrwxrwx 1 build build 27 Jun 25 17:12
/opt/eldk/usr/ppc-linux/bin/gcc -> ../../bin/powerpc-linux-gcc

build@build:/opt/eldk$
/opt/eldk/usr/ppc-linux/bin/../../bin/powerpc-linux-gcc -o test main.c
Success!

It is possible to run compiler directly (not via a symbolic link "gcc").

2. Further investigation revealed, that a symbolic link with an
absolute path is OK:

build@build:/opt/eldk$ rm /opt/eldk/usr/ppc-linux/bin/gcc
build@build:/opt/eldk$ ln -s /opt/eldk/usr/bin/powerpc-linux-gcc
/opt/eldk/usr/ppc-linux/bin/gcc
build@build:/opt/eldk$ gcc -o test main.c
Success!

3. The "strace" tool showed that the problem appears on the step of
unrolling relative path in the symbolic link:
lstat64("/opt/eldk/usr/ppc-linux/bin/gcc", {st_mode=S_IFLNK|0777,
st_size=27, ...}) = 0
readlink("/opt/eldk/usr/ppc-linux/bin/gcc",
"../../bin/powerpc-linux-gcc", 4096) = 27
lstat64("/opt/eldk/usr/ppc-linux/.owerpc-owerpc-linux-gcc",
0xbfdde670) = -1 ENOENT (No such file or directory)  <<<--- SMTH goes
wrong here!


So, concluding: the WA to fix ELDK compiler on Ubuntu 12.04 is to
replace each relative symbolic link in $ELDK_PREFIX/usr/ppc-linux/bin/
with the link containing an absolute path, e.g. (for powerpc!):
$ cd $ELDK_PREFIX/usr/ppc-linux/bin;
$ for X in ar as  g++ gcc ld ldd nm objdump ranlib strip; do
$   rm $X;
$   ln -s $ELDK_PREFIX/usr/bin/powerpc-linux-$X $X;
$ done


-- 
Best regards,
Dmitry S. Vasilchenko
_______________________________________________
eldk mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/eldk

Reply via email to