[ELDK] Ubuntu 12.04 and ELDK 4.1

Niclas Lindgren niclas.lindgren at gmail.com
Fri Aug 17 15:54:56 CEST 2012


Hello Stefano,

Thanks for your input!

> >>>
> >>> The best thing would probably be to recompile the compiler with the
> >>> same cross tool settings under Ubuntu 12.04, which I might try
> >>> later,
> >>
> >> This could be a very time intensive task. Up to ELDK-4.2, we use a
> >> virtual machine under Red Hat 7.3 (very old) to produce the whole
> >> distro. This
> > made
> >> ELDK working on a lot of distros for a long time, but I know it
> >> cannot be produced clean with new distros.
> >>
> >
> > I would only have to rebuild the compiler itself, not the libs or any
> > packages though, those I could use form the standard ELDK tree. As I
> > believe if the compiler is just linked against the latest libc
> > properly it should work.
> 
> But again, before you start this task, I have Ubuntu 12.04, libc 2.15, and
it works
> (I used it also last week for PowerQuick III).
> 
> Then I am doubting that it is related to the libc.
> 

It is very easy to test. Which platform to you target, we target ppc_82xx

All I have to do to see the problem is to create a c file with
------

#include <assert.h>

extern char SHA1_Init ();

int main(int argc, char** argv)
{
    return SHA1_Init ();
}

-----

In it, and then do

niclas.lindgren at ubuntu:~$ . /opt/eldk-4.2/eldk_init ppc_82xx
ARCH=ppc
CROSS_COMPILE=ppc_82xx-
DEPMOD=/opt/eldk-4.2/usr/bin/depmod.pl
PATH=/opt/eldk-4.2/usr/bin:/opt/eldk-4.2/bin:/usr/lib/lightdm/lightdm:/usr/l
ocal/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
niclas.lindgren at ubuntu:~$ ppc_82xx-gcc -c test.c
niclas.lindgren at ubuntu:~$

And it will work to compile.

"ppc_82xx-cpp -c test.c" will work, 

but ppc_82xx-cpp -v test.c will produce an error and the search path shows
it is missing the default includes
test.c:1:20: error: assert.h: No such file or directory

It also won't link, even though the libs are in the default path.
ppc_82xx-cpp -c test.c -lcrypto
/opt/eldk-4.2/usr/bin/../lib/gcc/powerpc-linux/4.2.2/../../../../powerpc-lin
ux/bin/ld: warning: libdl.so.2, needed by
/opt/eldk-4.2/usr/../ppc_82xx/usr/lib/libcrypto.so, not found (try using
-rpath or -rpath-link)
/opt/eldk-4.2/usr/bin/../lib/gcc/powerpc-linux/4.2.2/../../../../powerpc-lin
ux/bin/ld: warning: libz.so.1, needed by
/opt/eldk-4.2/usr/../ppc_82xx/usr/lib/libcrypto.so, not found (try using
-rpath or -rpath-link)

If I add this to the gcc spec (those folders should already be found by
default)

*link:
%{!static:--eh-frame-hdr} %{!-rpath-link*:-rpath-link
/opt/eldk-4.2/ppc_82xx/lib/:/opt/eldk-4.2/ppc_82xx/usr/lib/} %{h*} %{v:-V}
%{!msdata=none:%{G*}} %{msdata=none:-G0} %{YP,*} %{$

It links properly. But if I try to do something like

ppc_82xx-gcc -L/home/i4m/lib -ltest

And home i4m lib has a softlink from libtest.so to libtest.so.1 to
libtest.so.2.3, it won't find libtest.so.1

The directory layout (eldk is eldk 2.1)
niclas.lindgren at ubuntu:~$ ls -la /opt/
total 20
drwxr-xr-x  5 root root 4096 aug 17 14:09 .
drwxr-xr-x 22 root root 4096 aug 16 15:06 ..
drwxr-xr-x  9 root root 4096 jul  7  2004 eldk
drwxr-xr-x  8 root root 4096 aug 17 03:14 eldk-4.2
drwxr-xr-x  3 root root 4096 jun 19  2010 google


Note that none if the build script or code change when I got this problem, I
only upgraded Ubuntu. Even a fresh install has the same problem (only
install Ubuntu, eldk 4.2 and try to compile test.c). Which works fine on
Ubuntu 11.10, freshly installed.

Perhaps it isn't the libc, but It is my main culprit at the moment,
something change in the API to somehow change how softlinks are resolved.

Cheers,
Niclas



More information about the eldk mailing list