Skip to content

alloca() on FreeBSD (PR#7890)

5 messages · Rainer Hurling, Simon Urbanek, Brian Ripley

#
On Mon, 23 May 2005 vangyzen@stat.duke.edu wrote:

            
It is already supposed to, so it is not finding the declaration there 
either. If you look up the definition of

AC_CHECK_DECLS([alloca], , , [#include <alloca.h>])

it searches in stdlib.h.  Can you please send us the appropriate part of 
config.log?  It may be that this is failing because alloca.h is not found
(but AC_FUNC_ALLOCA is making the same assumptions).

Perhaps the easiest way out is to override the setting on FreeBSD: can 
you please confirm that manually changing

#define HAVE_DECL_ALLOCA 1

in config.h works?
So please don't open a new report on the subject!
1 day later
#
One first reaction to your suggestions.
ripley@stats.ox.ac.uk wrote:
Changing "#define HAVE_DECL_ALLOCA" to 1
in line 81 of R-2.1.0/src/include/config.h
gives me the following stopping:


mkdir ../../../../library/grDevices/libs
building package 'graphics'
mkdir ../../../library/graphics
mkdir ../../../library/graphics/R
mkdir ../../../library/graphics/demo
mkdir ../../../library/graphics/po
mkdir ../../../library/graphics/man
Error in dyn.load(x, as.logical(local), as.logical(now)) :
         unable to load shared library 
'/usr/local/R-2.1.0/library/grDevices/libs/grDevices.so':
   /usr/local/R-2.1.0/library/grDevices/libs/grDevices.so: Undefined 
symbol "__builtin_alloca"
Execution halted
*** Error code 1
Stop in /usr/local/R-2.1.0/src/library/graphics.
*** Error code 1
Stop in /usr/local/R-2.1.0/src/library.
*** Error code 1
Stop in /usr/local/R-2.1.0/src.
*** Error code 1
Stop in /usr/local/R-2.1.0.


Because I have almost no skills in C, automake and autoconf I have no 
idea on how to go on, sorry.

Hopefully Eric makes considerable progress ...
#
On Jun 7, 2005, at 12:36 PM, Rainer Hurling wrote:

            
Did you run a new, clean build? From the output it seems as if you  
just changed the file in your old build and typed make - obviously  
that doesn't help at all, because the setting must the changed  
*before* you start building. So if you didn't do so, please remove  
the build, unpack the sources again, run configure, change the ALLOCA  
define and then build.

Cheers,
Simon
#
Simon Urbanek wrote:
Simon,
thank you, but I am absolute sure I made a new, clean built:

1.) untar R-2.1.0.tar.gz
2.) cd R-2.1.0
3.) ./configure
4.) edit src/include/config.h  [#define HAVE_DECL_ALLOCA 1]
5.) make

It seems to me that some files behave not like others in relation to 
alloca.h (resp. stdlib.h)?

Please tell me, if I can help in any way,
Rainer
#
This is a package, so it is not using config.h.  It is using

#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
extern char *alloca(size_t);
#endif

and hence will have whatever the problem is with having that declaration.

The basic problem is that autoconf assumes that if alloca is defined 
anywhere, it is defined in alloca.h.  So we need to use something other 
than the standard macros.

Is there a macro FreeBSD defines?   If so it may be easiest to just make 
use of it.
On Tue, 7 Jun 2005, Simon Urbanek wrote: