[Rd] R trunk (2.7) build fails with -fpic, needs -fPIC (PR#10372)

From: <atp_at_piskorski.com>
Date: Wed, 24 Oct 2007 21:00:25 +0200 (CEST)

On Linux x86-64 (Ubuntu 6.06), the latest R sources from the Subversion trunk fail to build with the following "recompile with -fPIC" error:

$ ./configure --with-x=yes --prefix=$inst_dir --enable-R-shlib --with-tcltk=/usr/lib/tcl8.4 --with-tcl-config=/usr/lib/tcl8.4/tclConfig.sh
$ make

  /usr/bin/ld: ../appl/approx.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC   ../appl/approx.o: could not read symbols: Bad value

This is easy to fix by changing 4 lines in the configure script from "-fpic" to -fPIC", as shown in the patch below.

I saw this failure on an Intel x86-64 server, running Ubuntu 6.06:

$ uname -srvm

  Linux #1 SMP PREEMPT Sat Mar 31 07:46:01 EDT 2007 x86_64

$ cat /etc/lsb-release


$ grep name /proc/cpuinfo
model name : Intel(R) Xeon(TM) CPU 3.80GHz model name : Intel(R) Xeon(TM) CPU 3.80GHz
$ dpkg -l libc6
||/ Name Version Description +++-========-====================-=================================================
  ii libc6 2.3.6-0ubuntu20.4 GNU C Library: Shared libraries and Timezone data

$ apt-cache show libc6 | grep Architecture | uniq
  Architecture: amd64

Here's a patch which fixes the problem:

$ svn diff configure
Index: configure

Andrew Piskorski <atp_at_piskorski.com>

R-devel_at_r-project.org mailing list
Received on Wed 24 Oct 2007 - 19:04:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.