FreeBSD Port: R-2.0.1
Rainer Hurling
Rainer.Hurling at nfv.gwdg.de
Mon May 23 03:12:47 PDT 2005
Eric,
at the last weekend I found a quick dirty workaround for our compilation
problem. Before making the port (thank you for your patch) I contacted
Prof Brian Ripley from R Core Team for a more general solution.
Eric van Gyzen wrote:
> Klaus F. Østergaard wrote:
>
>>When do you plan to upgrade R to the current 2.1.0?
> When I can coerce it into compilation:
> errors.o(.text+0x154b): In function `do_gettext':
> /tmp/R-2.1.0/src/main/errors.c:779:
> undefined reference to `__builtin_alloca'
> ...
> errors.o(.text+0x274d):/tmp/R-2.1.0/src/main/errors.c:829:
> more undefined references to `__builtin_alloca' follow
>
> I gladly welcome suggestions. :-/
This is what I wrote to Prof Brian Ripley:
FreeBSD has no system-wide 'alloca.h'. Instead it uses a routine in
'stdlib.h' for this. Here is a copy of the section in /usr/include/stdlib.h:
/*
* The alloca() function can't be implemented in C, and on some
* platforms it can't be implemented at all as a callable function.
* The GNU C compiler provides a built-in alloca() which we can use;
* in all other cases, provide a prototype, mainly to pacify various
* incarnations of lint. On platforms where alloca() is not in libc,
* programs which use it will fail to link when compiled with non-GNU
* compilers.
*/
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
#undef alloca /* some GNU bits try to get cute and define this on
their own */
#define alloca(sz) __builtin_alloca(sz)
#elif defined(lint)
void *alloca(size_t);
#endif
Obviously it should be possible to use 'stdlib.h' instead of 'alloca.h'.
So I replaced all code entries from 'alloca.h' to 'stdlib.h'.
The following files where affected in R-2.1.0:
./configure
./src/library/grDevice/src/devPS.c
./src/main/errors.c
./src/main/gram.c
./src/main/gram.y
./src/main/pcre.c
./src/main/vfonts.c
./src/main/util.c
After the changes, I had been able to build the source tree and to
install it. It works like a charm :-)
Now I am looking for somebody, who can adapt the configure scripts of R
to change the behaviour for FreeBSD systems to work with 'stdlib.h'
instead of 'alloca.h'.
Yet I have no answer from Ripley.
Regards,
Rainer Hurling
P.S.: With your patch for the port I run into the same problem with
alloca.h :-(
More information about the freebsd-ports
mailing list