Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Ivan Shvedunov <ivan4th <at> gmail.com>
Subject: Re: linux-armel fixes for clisp and ffcall
Newsgroups: gmane.lisp.clisp.devel
Date: Tuesday 26th January 2010 09:59:21 UTC (over 7 years ago)
On Tue, Jan 26, 2010 at 12:33 AM, Sam Steingold  wrote:
> Ivan Shvedunov wrote:
>>
>>   I'm attaching the results of my laborious yet ultimately successful
>> attempt of making CLISP & ffcall work on Maemo Fremantle OS used in
>> Nokia N900 phone.
>
> thanks a lot for the patch and the detailed explanation.
>
> a few remarks:
>
> 1. please include a ChangeLog entry (it should be shorter than your
e-mail but
> contain just an much information :-)
>
> 2. please do not include changes in the generated files (configure,
config.h.in)

Ok, I'll update patch.

> 3. the --with-shell part of the clisp patch should be a separate patch,
> especially since it is not obvious at all that this is the right
approach.
> specifically, maybe the user shell should be settable at run time?
> even if it is to be a configure-time option, SHELL_OVERRIDE should have
the
> default value of "/bin/sh" instead of undefined.
> also, maybe configure could just check whether /bin/sh understands "-c"?
> also, configure scripts assume that sh understands "-c" - if yours does
not,
> how do you manage to configure clisp in the first place.

I've researched the problem a bit further. It's really the following:
busybox which is used as the shell on N900 (and many routers / other
appliances and embedded Linux systems too) is an all-in-one executable
that sits and /bin and has /bin/sh and many common UNIX commands
(/bin/cp, /bin/ls, /usr/bin/find) symlinked to it. When busybox is
started, it first determines which command should be run (the commands
it supports are called applets). It first looks at argv[0], and if it
points immediatelly (without symlinks) to /bin/busybox, it uses
argv[1] as the applet name. When EXT:RUN-PROGRAM is invoked, it uses
EXT:SHELL which invokes EXT:EXECUTE with the shell executable path
(/bin/sh) as the first argument. EXT:EXECUTE for some reason seems to
be following symlinks that are passed to it and thus busybox gets
/bin/busybox instead of /bin/sh as argv[0]. It uses argv[1] as the
applet name then, which happens to be -c, so the user gets an error
message "-c: applet not found". When invoked as /bin/sh, it does
understand -c flag though, thus configure and other scripts work fine.

The problem is, I'm not sure what is the best way to handle this
situation. Possible solutions:

1. Use the original path or keep symlinks in argv[0] in
EXT:EXECUTE. This may be the right way as busybox is not the only
program that uses this symlink dispatch approach. Do you know of
anything that may break this way?

2. Detect busybox in the configure script and use some kind of
workaround for it. This feels ugly.

3. ?..

What do you think about it?

> 4.
> +AC_DEFUN([CL_MEMALIGN],
> +[
> +AC_CHECK_FUNC(posix_memalign,[
> +  AC_DEFINE(HAVE_POSIX_MEMALIGN, 1, [whether memalign() is available])
> +])
> +])
>
> shouldn't it just be
>
> +AC_DEFUN([CL_MEMALIGN],AC_CHECK_FUNCS(posix_memalign))

Ok, will fix it, sorry, I didn't touch autoconf stuff for about 10
years :)

Another remark: after trying to build clisp deb packages for armel,
I've noticed that debian clisp configuration causes CFFI callback
tests to crash (in plain configuration they don't). Will research this
further, but I'll mark armel support as experimental in the changelog
anyway in the updated patch, which I will send a bit later.

Ivan

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the
business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
 
CD: 2ms