I know your embedded world is different. However, every embedded systems do need a compiler and an operating system. This Question falls under these two sections of embedded systems. Are not there any better way to generate code, why does it fail or take longer when compiling huge function like here main()? How long your embedded OS take to compile this. If fails, how can you fix it? Think over it before questioning others. thanks, kishuri
Actually this is an indication of extreme low resources on the development host. I just tested this on a standard PC running Linux:
bash$ time gcc -o foo foo.c
real 0m13.948s user 0m12.880s sys 0m0.230s
As you can see, it took just 14 seconds to compile your program.
And this is no high-end machine at all. It's a standard AMD XP processor at 2083 MHz with 512 MB RAM.
I have not the slightest idea where you get such a number from. To build a medium-sized project (U-Boot) with some 350k+ lines of C code (_not_ counting the header and assembler files) takes less than 20 seconds on an even slower machine (AMD Athlon at 1400 Mhz).
Your number is approx. 600 times too big!
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Web: www.denx.de
"The pathology is to want control, not that you ever get it, because
of course you never do." - Gregory Bateson
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.