From owner-freebsd-ports@FreeBSD.ORG Mon May 23 10:12:47 2005 Return-Path: X-Original-To: ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA57016A41C for ; Mon, 23 May 2005 10:12:47 +0000 (GMT) (envelope-from Rainer.Hurling@nfv.gwdg.de) Received: from wald.nfv.gwdg.de (Wald.NFV.gwdg.de [134.76.242.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2476D43D48 for ; Mon, 23 May 2005 10:12:46 +0000 (GMT) (envelope-from Rainer.Hurling@nfv.gwdg.de) Received: from [192.168.2.111] (Pc11B.nfv [192.168.2.111]) by wald.nfv.gwdg.de (Postfix) with ESMTP id 52F49111002; Mon, 23 May 2005 12:12:44 +0200 (MEST) Message-ID: <4291AC9C.3080607@nfv.gwdg.de> Date: Mon, 23 May 2005 12:12:44 +0200 From: Rainer Hurling Organization: Niedersaechsische Forstliche Versuchsanstalt, Abteilung Waldschutz User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050407) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eric van Gyzen References: <4290E143.6010603@mail.tele.dk> <200505221600.15092.vangyzen@stat.duke.edu> In-Reply-To: <200505221600.15092.vangyzen@stat.duke.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: ports@FreeBSD.org Subject: Re: FreeBSD Port: R-2.0.1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 10:12:47 -0000 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 :-(