cancel
Showing results for 
Search instead for 
Did you mean: 

Default include when compiling uClinux?

juan2
Associate II
Posted on March 08, 2006 at 07:49

Default include when compiling uClinux?

6 REPLIES 6
juan2
Associate II
Posted on August 05, 2005 at 06:22

Hi there,

I am trying to compile uClinux (uClinux-dist-20040408.tar.gz) with the patch uClinux-dist-20040408-str710-patch.tar.gz.

On the configuration utility I select the following settings:

Vendor: ST

ST products: STR710

Kernel Version: Linux-2.4.x

Libc: uClibc

Besides i included the ''libZ'' (under ''Customize Vendor/User Settings'') 'cause i would get even more erros without it (such as: unknown -lz...)

After running menuconfig, i did as follow:

make dep

make lib_only

make user_only

I got errors in the last make, as below:

gcc -I/usr/include -o build/erase erase.c

erase.c:9:27: linux/mtd/mtd.h: Datei oder Verzeichnis nicht gefunden

erase.c: In Funktion »region_erase«:

erase.c:13: error: `region_info_t' undeclared (first use in this function)

erase.c:13: error: (Each undeclared identifier is reported only once

erase.c:13: error: for each function it appears in.)

erase.c:13: error: `reginfo' undeclared (first use in this function)

erase.c:20: error: `MEMGETREGIONINFO' undeclared (first use in this function)

erase.c:32: error: `r' undeclared (first use in this function)

erase.c:50: error: `erase_info_t' undeclared (first use in this function)

erase.c:50: error: Syntaxfehler before ''erase''

erase.c:53: error: `erase' undeclared (first use in this function)

erase.c:58: error: `MEMUNLOCK' undeclared (first use in this function)

erase.c:68: error: `MEMERASE' undeclared (first use in this function)

erase.c: In Funktion »non_region_erase«:

erase.c:91: error: `mtd_info_t' undeclared (first use in this function)

erase.c:91: error: Syntaxfehler before ''meminfo''

erase.c:93: error: `MEMGETINFO' undeclared (first use in this function)

erase.c:93: error: `meminfo' undeclared (first use in this function)

erase.c:95: error: `erase_info_t' undeclared (first use in this function)

erase.c:95: error: Syntaxfehler before ''erase''

erase.c:97: error: `erase' undeclared (first use in this function)

erase.c:111: error: `MEMUNLOCK' undeclared (first use in this function)

erase.c:119: error: `MEMERASE' undeclared (first use in this function)

erase.c: In Funktion »main«:

erase.c:172: error: `MEMGETREGIONCOUNT' undeclared (first use in this function)

make[2]: *** [build/erase] Fehler 1

make[2]: Leaving directory `/home/juan/Desktop/Downloads/uClinux-dist/user/mtd-utils'

make[1]: *** [all] Fehler 2

make[1]: Leaving directory `/home/juan/Desktop/Downloads/uClinux-dist/user'

make: *** [user_only] Fehler 2

After a long search, i found out that those errors are because of the compiler looks for the *.h in the false directories (such as: ''/usr'' or ''/usr/local/arm-elf'') instead of looking for them within uClinux distribution. Although i checked several Makefiles within uClinux in order to find where the include directories are set, i did not succeed. I guess that if i could change those include directories i would get rid of the above shown errors, wouldn't i?

I would really appreciate some kind of help, thank you very much.

Juan Fco.

sjo
Associate II
Posted on August 05, 2005 at 12:42

What version of gcc are you using and does it work for simple compile ?

It sounds like an installation problem as I have built uclinux under both windows and linux hosts.

Regards

sjo

juan2
Associate II
Posted on August 05, 2005 at 14:52

First of all, thank you for your quick answer.

So, the gcc version is: gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from

http://fiddes.net/coldfire/

)

And i made it to compile a ''hello_world'' program as follow:

arm-elf-gcc -v -Wall -Wl,-elf2flt -g -o hello hello.c

I hope that you can help me further with this information (under Linux). I would lbe also interested to know how you made it work out under a Windows host (which compiler you used and which computer you run it on). Thank you very much in advance.

Best regards,

Juanfco.

sjo
Associate II
Posted on August 08, 2005 at 06:51

Using the compiler mentioned in the st app note I had no problems building under linux. I would recommend you try that first.

Regarding cygwin (windows) it was a bit more complicated.

first the following have to be ported to run under cygwin - elf2flt, genromfs, flthdr and jffs2.

build a arm-elf gcc toolchain under cygwin, add the tools above, then copy ld to ld.real replacing with a script that calls elf2flt.

I had to modify the config not to build mtd-utils as it is built above.

I have not tested as much as building under linux but everything seems to work including debugging.

Regards

sjo

antti
Associate II
Posted on March 06, 2006 at 11:15

I have exactly the same problem and I haven't been able to resolve it. It looks like the makefile doesn't create rules for every file. It compiles everything with arm-elf-gcc until the erase.c file is compiled. Make does not create a rule for this file and it tries to use gcc compiler with default options.

I'm not sure if my host system could be the reason for this behaviour. I'm running make 3.80 on latest Ubuntu i386 kernel.

Single compile to erase.c with arm-elf-gcc works, but the make seems broken. Any help would be much appreciated.

[ This message was edited by: Antti on 06-03-2006 15:51 ]

antti
Associate II
Posted on March 08, 2006 at 07:49

Problem solved.

The problem was with Ubuntu's Kernel header files. They seem to be broken and re-installing them won't help. One possible solution would be to leave mtd utils out of build. I solved problem simply by changing to Red Hat, which worked perfectly.