ListArc » English » Computer and Internet » Eldk » Ubuntu+12.04+and+ELDK+4.1


Ubuntu+12.04+and+ELD...


04-05-2012 03:03 PM
1


Hi,

maybe someone out there has the same problem.

Unfortunatelly eldk 4.1 doesn't work with ubuntu 12.04.
I cannot compile even a simple "hello world". On ubuntu 11.10 the same
eldk installation just works fine.

I have tested with ubuntu 12.04 in a virtual machine and I have seen the
same error messages on a colleagues fresh installation of the new ubuntu.

My compilation call is:
>>$ arm-linux-gcc hello_world.c

and i get this error message:

>>hello_world.c:1:19: error: stdio.h: No such file or directory
>>hello_world.c: In function 'main':
>>hello_world.c:5: warning: incompatible implicit declaration of
built-in function 'printf'

My colleague assumes that there are incompatibilities with newer C
libraries on the ubuntu 12.04 host.
When there is a workaround could you just tell me.

Greetings,
Franz

_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



04-05-2012 07:14 PM
2


Dear Franz,

In message <> you wrote:
>
> Unfortunatelly eldk 4.1 doesn't work with ubuntu 12.04.
> I cannot compile even a simple "hello world". On ubuntu 11.10 the same
> eldk installation just works fine.

Are you absolutely sure this is an issue with Ubuntu 12.04, and not
eventually just one with your system setup?

> My compilation call is:
> >>$ arm-linux-gcc hello_world.c

Did you set and export CROSS_COMPILE before?

> and i get this error message:
>
> >>hello_world.c:1:19: error: stdio.h: No such file or directory
> >>hello_world.c: In function 'main':
> >>hello_world.c:5: warning: incompatible implicit declaration of
> built-in function 'printf'

This is an installation error on your system. It appears you missed to
install (or copy) the header files. For me this works:

$ cat /etc/issue
Ubuntu 12.04 LTS \n \l

$ arm-linux-gcc -v
Reading specs from
/opt/eldk-4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/specs
Target: arm-linux
Configured with:
/opt/eldk/build/arm-2007-01-21/work/usr/src/denx/BUILD/crosstool-0.35/build/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/gcc-4.0.0/configure
--target=arm-linux --host=i686-host_pc-linux-gnu
--prefix=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux
--with-headers=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux/include
--with-local-prefix=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux
--disable-nls --enable-threads=posix --enable-symvers=gnu
--enable-languages=c,c++ --enable-shared --enable-c99
--enable-long-long --enable-__cxa_atexit
Thread model: posix
gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)
$ cat hello.c
#include
int main (void)
{
printf("Hello world\n");
return 0;
}
$ arm-linux-gcc -c hello.c
$ ls -l hello*
-rw-rw-r-- 1 wd wd 76 May 4 19:46 hello.c
-rw-rw-r-- 1 wd wd 828 May 4 20:00 hello.o

OK, the linker will run into problems then, but this is something
else.

> My colleague assumes that there are incompatibilities with newer C
> libraries on the ubuntu 12.04 host.

You mean like this?

$ arm-linux-gcc -o hello hello.o
/opt/eldk-4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/ld: warning: ld-linux.so.2, needed by /opt/eldk-4.1/usr/../arm/lib/libc.so.6, not found (try using -rpath or -rpath-link)
...

Well, it seems there are indeed incompatibilities. But this is to be
expected after such a long time - I'm surprised it worked that long.

Sorry, but we cannot maintain this old stuff forever, for free.
If you really need it then please feel free to contact me for
commercial support options.

> When there is a workaround could you just tell me.

The big question to me is why you are trying to run 5 year old
software on the most recent version of Ubuntu? This makes little
sense. Either you need good old ELDK 4.1 as a stable production
environment for older products; in this case you should keep the old
OS environment as well. Or you try to set up a new build system, in
which case you should be using ELDK 5.1 (or, in 2..3 days) ELDK 5.2.


Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
"Where shall I begin, please your Majesty?" he asked. "Begin at the
beginning," the King said, gravely, "and go on till you come to the
end: then stop." - Alice's Adventures in Wonderland, Lewis Carroll
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



07-05-2012 08:40 AM
3


Dear Wolfgang,

thank you for your quick reply.
I just want to ensure that there is no simple workaround for this
problem before I go on.

I think, the appropriate action to keep our toolchain is to set up a
build server with an older OS.

Best regards,

Franz

Am 04.05.2012 20:14, schrieb Wolfgang Denk:
> Dear Franz,
>
> In message<> you wrote:
>> Unfortunatelly eldk 4.1 doesn't work with ubuntu 12.04.
>> I cannot compile even a simple "hello world". On ubuntu 11.10 the same
>> eldk installation just works fine.
> Are you absolutely sure this is an issue with Ubuntu 12.04, and not
> eventually just one with your system setup?
>
>> My compilation call is:
>> >>$ arm-linux-gcc hello_world.c
> Did you set and export CROSS_COMPILE before?
>
>> and i get this error message:
>>
>> >>hello_world.c:1:19: error: stdio.h: No such file or directory
>> >>hello_world.c: In function 'main':
>> >>hello_world.c:5: warning: incompatible implicit declaration of
>> built-in function 'printf'
> This is an installation error on your system. It appears you missed to
> install (or copy) the header files. For me this works:
>
> $ cat /etc/issue
> Ubuntu 12.04 LTS \n \l
>
> $ arm-linux-gcc -v
> Reading specs from
> /opt/eldk-4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/specs
> Target: arm-linux
> Configured with:
> /opt/eldk/build/arm-2007-01-21/work/usr/src/denx/BUILD/crosstool-0.35/build/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/gcc-4.0.0/configure
> --target=arm-linux --host=i686-host_pc-linux-gnu
> --prefix=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux
> --with-headers=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux/include
> --with-local-prefix=/var/tmp/eldk.bMi2nK/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/arm-linux/arm-linux
> --disable-nls --enable-threads=posix --enable-symvers=gnu
> --enable-languages=c,c++ --enable-shared --enable-c99
> --enable-long-long --enable-__cxa_atexit
> Thread model: posix
> gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)
> $ cat hello.c
> #include
> int main (void)
> {
> printf("Hello world\n");
> return 0;
> }
> $ arm-linux-gcc -c hello.c
> $ ls -l hello*
> -rw-rw-r-- 1 wd wd 76 May 4 19:46 hello.c
> -rw-rw-r-- 1 wd wd 828 May 4 20:00 hello.o
>
> OK, the linker will run into problems then, but this is something
> else.
>
>> My colleague assumes that there are incompatibilities with newer C
>> libraries on the ubuntu 12.04 host.
> You mean like this?
>
> $ arm-linux-gcc -o hello hello.o
> /opt/eldk-4.1/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/ld: warning: ld-linux.so.2, needed by /opt/eldk-4.1/usr/../arm/lib/libc.so.6, not found (try using -rpath or -rpath-link)
> ...
>
> Well, it seems there are indeed incompatibilities. But this is to be
> expected after such a long time - I'm surprised it worked that long.
>
> Sorry, but we cannot maintain this old stuff forever, for free.
> If you really need it then please feel free to contact me for
> commercial support options.
>
>> When there is a workaround could you just tell me.
> The big question to me is why you are trying to run 5 year old
> software on the most recent version of Ubuntu? This makes little
> sense. Either you need good old ELDK 4.1 as a stable production
> environment for older products; in this case you should keep the old
> OS environment as well. Or you try to set up a new build system, in
> which case you should be using ELDK 5.1 (or, in 2..3 days) ELDK 5.2.
>
>
> Best regards,
>
> Wolfgang Denk
>

_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



17-05-2012 12:44 PM
4


Franz Fuchshuber writes:

>
> Hi,
>
> maybe someone out there has the same problem.
>
> Unfortunatelly eldk 4.1 doesn't work with ubuntu 12.04.
> I cannot compile even a simple "hello world". On ubuntu 11.10 the same
> eldk installation just works fine.
>

eldk 4.2 doesn't work with Ubuntu 12.04 as well.
It would be better for me if eldk-4.x could work in Ubuntu 12.04 rather than
setting up a compilation server or downgrading my Ubuntu host.


Regards, Kautzmann

_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



17-05-2012 07:40 PM
5


Dear Kautzmann,

In message you wrote:
>
> eldk 4.2 doesn't work with Ubuntu 12.04 as well.

ELDK 4.2 is also more than 4 years old. It supports Linux releases
starting with something as RedHat Linux 7.3 of May 2002; covering a
whole decade of Linux distributions is actually pretty good, I think.

If it now brakes with the most recent releases, so be it.

> It would be better for me if eldk-4.x could work in Ubuntu 12.04 rather than
> setting up a compilation server or downgrading my Ubuntu host.

ELDK is Free Software. You have all options with it: if you like, you
can analyze the issue and eventually fix it (note that for rebuilding
ELDk 4.2 you will need an old (virtual) system running RedHat Linux
7.3). Alternatively you can hire somebody else to do this for you.
DENX is offering such services, so please feel free to contact me for
a quotation.

But please understand that with the free support we focus on
maintaining only less geriatric code.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
When you die, the first thing you lose is your life. The next thing
is the illusions. - Terry Pratchett, _Pyramids_
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



25-06-2012 02:39 PM
6


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

http://lists.denx.de/mailman/listinfo/eldk
)



25-06-2012 03:19 PM
7


Dear "Dmitry S. Vasilchenko",

In message you wrote:
>
> 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.

I'm not exactly sure what you are trying to do here, but please note
that this method to run the ELDK tool chain is almost always wrong.
Please stick to the documetnation provided in the manula, i. e. set
CROSS_COMPILE correctly, and then use ${CROSS_COMPILE}gcc to run the
compiler.

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

Of course this is possible, and using "gcc" is actually pretty
dangerous.

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

I don;t know what you are trying to do but for all supported modes of
operation this is NOT needed!

> So, concluding: the WA to fix ELDK compiler on Ubuntu 12.04 is to

ELDK 4.2 works just find in Ubuntu 12.04, without modifications.
Just follow the documentation and use the supported ways to use it,
then all this should not be needed.


Bye the way: ELDK 4.2 is really obsolete; we are at ELDK 5.2 now (and
actually ELDK v5.2.1 is on the verge of being released).

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
Everyting looks interesting until you do it. Then you find it's just
another job. - Terry Pratchett, _Moving Pictures_
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



25-06-2012 04:00 PM
8


Wolfgang,

Thank you for the answer! Sorry, maybe I was not clear in the frist message.

On Mon, Jun 25, 2012 at 6:19 PM, Wolfgang Denk <> wrote:
> I'm not exactly sure what you are trying to do here, but please note
> that this method to run the ELDK tool chain is almost always wrong.
> Please stick to the documetnation provided in the manula, i. e. set
> CROSS_COMPILE correctly, and then use ${CROSS_COMPILE}gcc to run the
> compiler.

From the ELDK Manual (3.8.2, Rebuilding Target Packages):
<<<<
The $CROSS_COMPILE environment variable must be set as appropriate for
the target CPU family.
The /usr/ppc-linux/bin directory must be in PATH before the
/usr/bin directory. This is to make sure that the command gcc results
in the fact that the ELDK cross compiler is invoked, rather than the
host gcc.
>>>>

That is exactly what I did:
$ cd /opt/eldk
$ . eldk_init ppc_6xx
$ export PATH=/opt/eldk/usr/ppc-linux/bin:$PATH

Saddly, a lot of packages still have no notion of cross-compilation
and do need cross compiler to be invoked as gcc for cross-building.

>
> Bye the way: ELDK 4.2 is really obsolete; we are at ELDK 5.2 now (and
> actually ELDK v5.2.1 is on the verge of being released).

Yep, we are moving toward it, but still have to support the old system...

--
Best regards,
Dmitry S. Vasilchenko
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



25-06-2012 04:07 PM
9


Wolfgang,

Thank you for the answer! Sorry, maybe I was not clear in the frist message.

> I'm not exactly sure what you are trying to do here, but please note
> that this method to run the ELDK tool chain is almost always wrong.
> Please stick to the documetnation provided in the manula, i. e. set
> CROSS_COMPILE correctly, and then use ${CROSS_COMPILE}gcc to run the
> compiler.

From the ELDK Manual (3.8.2, Rebuilding Target Packages):
================
The $CROSS_COMPILE environment variable must be set as appropriate for
the target CPU family.
The /usr/ppc-linux/bin directory must be in PATH before the
/usr/bin directory. This is to make sure that the command gcc results
in the fact that the ELDK cross compiler is invoked, rather than the
host gcc.
================

That is exactly what I did:
$ cd /opt/eldk
$ . eldk_init ppc_6xx
$ export PATH=/opt/eldk/usr/ppc-linux/bin:$PATH

Saddly, a lot of packages still have no notion of cross-compilation
and do need cross compiler to be invoked as gcc for cross-building.

>
> Bye the way: ELDK 4.2 is really obsolete; we are at ELDK 5.2 now (and
> actually ELDK v5.2.1 is on the verge of being released).

Yep, we are moving toward it, but still have to support the old system...

--
Best regards,
Dmitry S. Vasilchenko

P.S. The previous message was damaged for some reason, so I send it again.
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)



25-06-2012 08:20 PM
10


Dear Dmitry,

In message you wrote:
>
> From the ELDK Manual (3.8.2, Rebuilding Target Packages):
-------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^

All this applies only to the very specifiituation that you are trying
to rebuild target RPM.

Do NOT use this for any other purpose.

> Saddly, a lot of packages still have no notion of cross-compilation
> and do need cross compiler to be invoked as gcc for cross-building.

Yes. In ELDK 4.x considerable efforts were needed to adapt a new
package for building in the ELDK environment. In general, you cannot
just take a source RPM from some distro and compile it as a target
RPM. It would be nice if this worked, but things are not that easy.


Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
The only way to learn a new programming language is by writing pro-
grams in it. - Brian Kernighan
_______________________________________________
eldk mailing list

http://lists.denx.de/mailman/listinfo/eldk
)