autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [configure.ac/uClinux] Adding code for fork/vfork?


From: Mike Frysinger
Subject: Re: [configure.ac/uClinux] Adding code for fork/vfork?
Date: Fri, 15 Apr 2011 18:41:41 -0400
User-agent: KMail/1.13.6 (Linux/2.6.37.3; KDE/4.6.0; x86_64; ; )

On Friday, April 15, 2011 18:23:03 Gilles wrote:
> On Thu, 14 Apr 2011 21:07:07 -0500 (CDT), Bob Friesenhahn
> 
> <address@hidden> wrote:
> >The proper solution for this is to have configure test for both fork()
> >and vfork() (and maybe posix_spawn()).  Then you have to decide which
> >one you prefer:
> >
> >In configure.ac:
> >
> >AC_CHECK_FUNCS([fork posix_spawnp spawnvp vfork])
> >
> >In the program:
> >
> >#if HAVE_VFORK
> >
> >   use vfork
> 
> Thanks Bob, but some applications don't use conditional compiling and
> simply use code like this:
> ============
> if (uClinux) {
>       *pid = vfork();
> } else {
>       *pid = fork();
> }
> ============

so change it to #ifdef

> Will the cross-compiler go ahead and compile that type of code?
> Currently, it refuses to proceed because fork() is not available on
> non-MMU CPU's.

it depends on the optimization level.  you need a high enough level where the 
compiler will do dead code removal, otherwise it wont link.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]