Discussion:
[uClinux-dev] Perl isn't compiling and other random questions
Mark Bishop
2012-08-28 16:26:04 UTC
Permalink
I'm getting errors building perl from the SVN head. Should I just
move the offending line from fork() to vfork() and be done with it or
is this something bigger? My goal is to use perl for some simple CGI
web pages from boa. Would python be a better option? (However, I
have no experience with python.) I'm not sure if miniperl has
everything I need until I try it.

mark at linux-hez9:~/new_image/uclinux-dist-ipc> make user/perl_only
make[1]: Entering directory `/home/mark/new_image/uclinux-dist-ipc/user'
touch perl/.sgbuilt_user && make -C perl -j1
make[2]: Entering directory `/home/mark/new_image/uclinux-dist-ipc/user/perl'
bfin-linux-uclibc-gcc -mcpu=bf548-0.2 -o miniperl \
miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc
libperl.a(util.o): In function `Perl_my_fork':
/home/mark/new_image/uclinux-dist-ipc/user/perl/util.c:2360: undefined
reference to `_fork'
/home/mark/new_image/uclinux-dist-ipc/user/perl/util.c:2360: undefined
reference to `_fork'
/home/mark/new_image/uclinux-dist-ipc/user/perl/util.c:2360: undefined
reference to `_fork'
collect2: ld returned 1 exit status
make[2]: *** [miniperl] Error 1
make[2]: Leaving directory `/home/mark/new_image/uclinux-dist-ipc/user/perl'
make[1]: *** [perl_only] Error 2
make[1]: Leaving directory `/home/mark/new_image/uclinux-dist-ipc/user'
make: *** [user/perl_only] Error 2
mark at linux-hez9:~/new_image/uclinux-dist-ipc>

Offending code in util.c:

Pid_t
Perl_my_fork(void)
{
#if defined(HAS_FORK)
Pid_t pid;
#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) &&
!defined(HAS_PTHREAD_ATFORK)
atfork_lock();
pid = fork();
atfork_unlock();
#else
/* atfork_lock() and atfork_unlock() are installed as pthread_atfork()
* handlers elsewhere in the code */
pid = fork(); <<<------ HERE
#endif
return pid;
#else
/* this "canna happen" since nothing should be calling here if
!HAS_FORK */
Perl_croak_nocontext("fork() not available");
return 0;
#endif /* HAS_FORK */
}
Stuart Small
2012-08-28 15:53:18 UTC
Permalink
I'm guessing you are on a MMU-less system? We had tried to get perl to
work on ours by a simple find and replace fork w vfork but we ran into
issues. This was a few years back, but if I remember right anytime we'd
pass something off to the shell it would generate a segmentation fault.

For us we were just playing around, so didn't dig too deep trying to get it
running on our system.
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option? (However, I have no experience
with python.) I'm not sure if miniperl has everything I need until I try
it.
mark at linux-hez9:~/new_image/**uclinux-dist-ipc> make user/perl_only
make[1]: Entering directory `/home/mark/new_image/uclinux-**dist-ipc/user'
touch perl/.sgbuilt_user && make -C perl -j1
make[2]: Entering directory `/home/mark/new_image/uclinux-**
dist-ipc/user/perl'
bfin-linux-uclibc-gcc -mcpu=bf548-0.2 -o miniperl \
miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc
undefined reference to `_fork'
undefined reference to `_fork'
undefined reference to `_fork'
collect2: ld returned 1 exit status
make[2]: *** [miniperl] Error 1
make[2]: Leaving directory `/home/mark/new_image/uclinux-**
dist-ipc/user/perl'
make[1]: *** [perl_only] Error 2
make[1]: Leaving directory `/home/mark/new_image/uclinux-**dist-ipc/user'
make: *** [user/perl_only] Error 2
mark at linux-hez9:~/new_image/**uclinux-dist-ipc>
Pid_t
Perl_my_fork(void)
{
#if defined(HAS_FORK)
Pid_t pid;
#if (defined(USE_5005THREADS) || defined(USE_ITHREADS)) &&
!defined(HAS_PTHREAD_ATFORK)
atfork_lock();
pid = fork();
atfork_unlock();
#else
/* atfork_lock() and atfork_unlock() are installed as pthread_atfork()
* handlers elsewhere in the code */
pid = fork(); <<<------ HERE
#endif
return pid;
#else
/* this "canna happen" since nothing should be calling here if
!HAS_FORK */
Perl_croak_nocontext("fork() not available");
return 0;
#endif /* HAS_FORK */
}
______________________________**_________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/**mailman/listinfo/uclinux-dev<http://mailman.uclinux.org/mailman/listinfo/uclinux-dev>
This message was resent by uclinux-dev at uclinux.org
http://mailman.uclinux.org/**mailman/options/uclinux-dev<http://mailman.uclinux.org/mailman/options/uclinux-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20120828/8559b59f/attachment.html>
GLHS329
2012-08-28 16:04:54 UTC
Permalink
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option?
I recommend you check out Haserl (haserl.sourceforge.net). I have not used
it on an MMU-less system, but I think you'll find it's much lighter weight
than Perl or Python.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.uclinux.org/pipermail/uclinux-dev/attachments/20120828/f42c23fb/attachment.html>
Mark Bishop
2012-08-28 18:31:00 UTC
Permalink
Post by GLHS329
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option?
I recommend you check out Haserl (haserl.sourceforge.net). I have not used
it on an MMU-less system, but I think you'll find it's much lighter weight
than Perl or Python.
haserl in trunk also bombs on fork(). However, there are only two
occurrences of fork() in the code. I'll change them to vfork() and
give it a go.
Mark Bishop
2012-08-28 18:54:16 UTC
Permalink
Post by Mark Bishop
Post by GLHS329
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option?
I recommend you check out Haserl (haserl.sourceforge.net). I have not used
it on an MMU-less system, but I think you'll find it's much lighter weight
than Perl or Python.
haserl in trunk also bombs on fork(). However, there are only two
occurrences of fork() in the code. I'll change them to vfork() and
give it a go.
It's like this patch was unapplied:

http://mailman.uclinux.org/pipermail/uclinux-dev/2008-May/046569.html

None of these changes/patches are in the SVN/GIT repository.

http://blackfin.uclinux.org/git/?p=readonly-mirrors/uclinux-dist.git;a=tree;f=user/haserl/haserl-0.9.25;h=63cf9039fbf978ab733fd7f407e705514a236eab;hb=HEAD

I made the changes to h_bash.c and rfc2388.c and I am still reading
the patch for haser1.c
Greg Ungerer
2012-08-29 00:58:52 UTC
Permalink
Hi Mark,
Post by Mark Bishop
Post by Mark Bishop
Post by GLHS329
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option?
I recommend you check out Haserl (haserl.sourceforge.net). I have not used
it on an MMU-less system, but I think you'll find it's much lighter weight
than Perl or Python.
haserl in trunk also bombs on fork(). However, there are only two
occurrences of fork() in the code. I'll change them to vfork() and
give it a go.
http://mailman.uclinux.org/pipermail/uclinux-dev/2008-May/046569.html
When I send messages like that it means applied to the sources that
are released at http://www.uclinux.org/pub/uClinux/dist/.

And that patch is in the sources packages there (after May/2008).

Note that there is no git/svn/cvs access to these.
Post by Mark Bishop
None of these changes/patches are in the SVN/GIT repository.
http://blackfin.uclinux.org/git/?p=readonly-mirrors/uclinux-dist.git;a=tree;f=user/haserl/haserl-0.9.25;h=63cf9039fbf978ab733fd7f407e705514a236eab;hb=HEAD
All other archives, like this one, and the many others around the internet,
are maintained by others. I really have no idea who, or even if, they track
the uClinux-dist releases or are even maintained at all.

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg at snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
Mark Bishop
2012-08-29 04:41:56 UTC
Permalink
Post by Greg Ungerer
Hi Mark,
Post by Mark Bishop
Post by Mark Bishop
Post by GLHS329
I'm getting errors building perl from the SVN head. Should I just move
the offending line from fork() to vfork() and be done with it or is this
something bigger? My goal is to use perl for some simple CGI web pages
from boa. Would python be a better option?
I recommend you check out Haserl (haserl.sourceforge.net). I have not used
it on an MMU-less system, but I think you'll find it's much lighter weight
than Perl or Python.
haserl in trunk also bombs on fork(). However, there are only two
occurrences of fork() in the code. I'll change them to vfork() and
give it a go.
http://mailman.uclinux.org/pipermail/uclinux-dev/2008-May/046569.html
When I send messages like that it means applied to the sources that
are released at http://www.uclinux.org/pub/uClinux/dist/.
And that patch is in the sources packages there (after May/2008).
Note that there is no git/svn/cvs access to these.
Post by Mark Bishop
None of these changes/patches are in the SVN/GIT repository.
http://blackfin.uclinux.org/git/?p=readonly-mirrors/uclinux-dist.git;a=tree;f=user/haserl/haserl-0.9.25;h=63cf9039fbf978ab733fd7f407e705514a236eab;hb=HEAD
All other archives, like this one, and the many others around the internet,
are maintained by others. I really have no idea who, or even if, they track
the uClinux-dist releases or are even maintained at all.
Regards
Greg
My apologies. I didn't know that there were so many varieties of
uClinux. This makes it absolutely confusing as to get things working
as that some varieties of uClinux have certain packages working and
others don't. It looks like your version is pretty consistent.

I appreciate the reply Greg.

Continue reading on narkive:
Loading...