[Klone-users] Compilation for elf m68k

thomas fossati tho at koanlogic.com
Wed Apr 9 07:08:35 EDT 2008


Hi Mickael,

On Apr 9, 2008, at 12:15 PM, Mickael Auger wrote:
> The compilation is correct and the execution on embedded system is OK.

good, which execution model are you using (iterative, fork or pre- 
fork) ?

> After the first compilation I add my .kl1 file in  
> "klone-2.0.2_m68k_bis/webapp/" and which contains :
>
>     <%!
>         #include <string.h>
>         #include <sys/types.h>
>         #include <dirent.h>
>     %>
>
>     <html>
>     <body>
>     <%
>         char* mot = "coucou";
>         io_printf(out, "%s", mot);
>     %>
>     </body>
>     </html>
>
>
> I compile with "make" but the compilation displays
>
> [SNIP]
>
> However if my kl1 file contains :
>
>     <%!
>         #include <string.h>
>         #include <sys/types.h>
>         #include <dirent.h>
>
>         char* mot = "coucou";
>     %>
>
>     <html>
>     <body>
>     <%
>         io_printf(out, "%s", mot);
>     %>
>     </body>
>     </html>
>
> The compilation and the execution are correct. Why ?

$ m68k-elf-gcc -v
gives 2.95.3.

This GCC version does not support mixing declarations and statements  
in the function body (which comes with GCC 3), hence all your  
variables must be declared within the <%! /* declaration block */ %> .

For a better understading, take a quick tour in the klone-2.0.2/build/ 
target/klone-core-2.0.2/site/ directory and search for the translated  
kl1 pages (the C files with the pg_ prefix) to see how the C/C++ code  
you write is reassembled into the exec_page() context.

> I haven't the problem before. But my m68k-elf compilater is strict  
> for the C language.
>
> To resolve this problem I with to use the C++ compiler, how to  
> specify to use C++ compiler (given in m68k-elf.tc) ?

Two (untested) options are:

1) change the CC variable in toolchain from m68k-elf-gcc to m68k-elf-g+ 
+ (flags should be compatible)
2) change your pages' extension from .kl1 to .klx (which automatically  
switches to the C++ compiler)

ciao, t.





More information about the klone-users mailing list