From darwinskernel at gmail.com  Wed Aug 15 03:11:19 2012
From: darwinskernel at gmail.com (nobody)
Date: Tue, 14 Aug 2012 21:11:19 -0400
Subject: [Rd] compile fails with x86_64-alpine-linux-uclibc-gcc
In-Reply-To: <6C27D1E7-D934-40AF-9EDE-24F8F3BE8DAD@r-project.org>
References: <20120813034532.GA17328@wall.e>
	<BE73D35E-4A05-4CCF-99DD-CB6715ECF9CF@r-project.org>
	<20120813182240.GA30033@wall.e>
	<5B4175AF-5EFE-45DE-9727-991C45FA891A@gmail.com>
	<20120814141955.GA492@wall.e>
	<6C27D1E7-D934-40AF-9EDE-24F8F3BE8DAD@r-project.org>
Message-ID: <20120815011118.GA6388@wall.e>

On Tue, Aug 14, 2012 at 10:32:22AM -0400, Simon Urbanek wrote:
> 
> On Aug 14, 2012, at 10:19 AM, nobody wrote:
> 
> > On Tue, Aug 14, 2012 at 01:48:44PM +0200, peter dalgaard wrote:
> >> 
> >> Perhaps I'm confused, but how did either of you expect to fix a problem with fgetc by modifying fgets???
> >> 
> >> -- 
> >> Peter Dalgaard, Professor
> >> Center for Statistics, Copenhagen Business School
> >> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> >> Phone: (+45)38153501
> >> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
> > 
> > i'm not well versed in C. do know how to fix this? or, as i gather, this
> > is not something trivial and it has to be fixed uclibc upstream?
> > 
> 
> What Peter is saying that my fix was useless because I was talking about fgetc but fixed fgets: P
> So the fix attempt should have been
> 
> static int fix_fgetc(FILE *stream) { return fgetc(stream); }
> #undef fgetc
> static int fgetc(FILE *stream) { return fix_fgetc(stream); }
> 
> It should still be fixed upstream because I don't think POSIX allows fgetc to be a macro.
> 
> Cheers,
> Simon

thanks, 's:^static:extern:' and it works, well sort of. now compilation
gets stuck (waited 3 hours) here:

make[6]: Entering directory `/dev/shm/portage/dev-lang/R-2.15.1/work/R-2.15.1/src/library/tools/src'
mkdir -p -- ../../../../library/tools/libs
make[6]: Leaving directory `/dev/shm/portage/dev-lang/R-2.15.1/work/R-2.15.1/src/library/tools/src'
make[5]: Leaving directory `/dev/shm/portage/dev-lang/R-2.15.1/work/R-2.15.1/src/library/tools/src'
make[4]: Leaving directory `/dev/shm/portage/dev-lang/R-2.15.1/work/R-2.15.1/src/library/tools'

it's apparently running:
/dev/shm/portage/dev-lang/R-2.15.1/work/R-2.15.1/bin/exec/R --vinalla --slave
with 100% cpu usage! i don't what it's doing to be honest :) any idea?

p.s.: i'm attaching the patch to this for the curious, hope it helps.
-------------- next part --------------
--- src/main/connections.c.orig	2012-08-14 11:47:47.105203896 -0400
+++ src/main/connections.c	2012-08-14 11:50:49.103928599 -0400
@@ -378,6 +378,16 @@
     return res;
 }
 
+#ifdef __UCLIBC__
+	extern int fix_fgetc(FILE *stream) {
+		return fgetc(stream);
+		}
+	#undef fgetc
+	extern int fgetc(FILE *stream) {
+		return fix_fgetc(stream);
+		}
+#endif
+
 int dummy_fgetc(Rconnection con)
 {
     int c;


[Rd] compile fails with x86_64-alpine-linux-uclibc-gcc
nobody