[Klone-users] Compilation for elf m68k

thomas fossati tho at koanlogic.com
Tue Apr 8 11:24:01 EDT 2008


Hi Mickael,

On Apr 8, 2008, at 4:29 PM, Mickael Auger wrote:
> However the symbolic link "kloned" is invalid because the link  
> "klone-2.0.2/kloned" doesn't exists. But the real program  
> "klone-2.0.2/buil/target/klone-core-2.0.2/src/kloned/kloned" is  
> present.

yes, we shall fix it.

> My mainly folder contains :
>
>    - klone-2.0.2.tar.gz (from http://koanlogic.com/download/klone/klone-2.0.2.tar.gz)
>    - klapp.mk (from http://koanlogic.com/klone/klapp.mk)
>    - makl.patch
>    - Makefile
>    - m68k-elf.tc
>
> In mainly folder I only enter :
>
>     make
>
> and it's OK.

very good.

> After upload the "kloned" program on my embedded system,
> my new problem go with the execution on the embedded when I enter :
>     ./kloned -F              or                ./kloned
>
> indeed this execution print "daemon error" for the second command,  
> because 'server.c' use the "fork()" function that is unvailable on  
> my embedded. But my embedded knows the "vfork()" function. My log  
> file displays many time :
>
>     [wrn][232:server.c:556:server_fork_child] fork error
>     [wrn][232:server.c:561:server_fork_child] errno: 38 (Function  
> not implemented)
>     [dbg][232:server.c:842:server_spawn_child] (rc =  
> server_fork_child(s, be)) < 0
>     [dbg][232:server.c:885:server_spawn_children]  
> server_spawn_child(s, be)
>     [dbg][232:server.c:928:server_loop] server_spawn_children(s)
>
> Can you have an idea ?

mmm, I thought that uclinux treated the fork->vfork aliasing  
transparently (via #define or something like that...), clearly I was  
wrong :)

So, you can try a couple of solutions:

1) use the iterative server model by setting "model iterative"  
directive in your kloned.conf file, e.g.:

=-=-=-=-=-=-=-=-=-=-=-=
server_list	main

main.model	iterative  <== set this explicitly (otherwise it pre-forks)
main.type	http
main.addr.type	IPv4
main.addr.port	8080
...
=-=-=-=-=-=-=-=-=-=-=-=

2) try out the attached patch which basically does a s/fork/vfork over  
the whole klone source tree (just 3/4 hits).  I haven't tried it on a  
real system (so you are the very first beta tester :)).
Don't forget to append the vfork patch to the KLONE_TARGET_PATCH_FILE  
variable in the top-level Makefile:

=-=-=-=-=-=-=-=-=-=-=-=
KLONE_TARGET_PATCH_FILE = $(CURDIR)/makl.patch
KLONE_TARGET_PATCH_FILE += $(CURDIR)/uclinux-vfork.KLONE_REL_2_0_2.patch
=-=-=-=-=-=-=-=-=-=-=-=

ciao and tell us about your findings and issues !
t.


PS: if the iterative mode fails, use -F (i.e. do not call daemon(3)).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclinux-vfork.KLONE_REL_2_0_2.patch
Type: application/octet-stream
Size: 1622 bytes
Desc: not available
Url : http://koanlogic.com/pipermail/klone-users/attachments/20080408/0eedd397/uclinux-vfork.KLONE_REL_2_0_2.obj
-------------- next part --------------






More information about the klone-users mailing list