ports/133290: [PATCH] devel/pcre: doesn't use -fPIC for static libraries on amd64

Dmitry Marakasov amdmi3 at amdmi3.ru
Thu Apr 2 00:20:04 UTC 2009

>Number:         133290
>Category:       ports
>Synopsis:       [PATCH] devel/pcre: doesn't use -fPIC for static libraries on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 02 00:20:03 UTC 2009
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Sat Mar 21 18:50:30 MSK 2009
Each pcre source is built twice, so one object file goes into shared library, and another into static one.
However, the object files the go into static libs are built without -fPIC, which make it impossible to link other code with static pcre library on amd64 (and other 64 bit archs is suppose). The example is lang/qscheme which is broken on amd64 because of that.

--- from pcre build log:
===>  Building for pcre-7.8
make  all-am
/bin/sh ./libtool --tag=CC    --mode=compile cc -DHAVE_CONFIG_H -I.      -O2 -fno-strict-aliasing -pipe -march=nocona -MT pcre_compile.lo -MD -MP -MF .deps/pcre_compile.Tpo -c -o pcre_compile.lo pcre_compile.c
mkdir .libs
 cc -DHAVE_CONFIG_H -I. -O2 -fno-strict-aliasing -pipe -march=nocona -MT pcre_compile.lo -MD -MP -MF .deps/pcre_compile.Tpo -c pcre_compile.c  -fPIC -DPIC -o .libs/pcre_compile.o
 cc -DHAVE_CONFIG_H -I. -O2 -fno-strict-aliasing -pipe -march=nocona -MT pcre_compile.lo -MD -MP -MF .deps/pcre_compile.Tpo -c pcre_compile.c -o pcre_compile.o >/dev/null 2>&1
mv -f .deps/pcre_compile.Tpo .deps/pcre_compile.Plo

--- from qscheme error log:
cc -DHAVE_CONFIG_H -I. -I. -I.     -O2 -fno-strict-aliasing -pipe -march=nocona  -I/usr/local/include -I/usr/local/include -o regex.so -shared -fPIC -I/usr/local/include ./regex.c /usr/local/lib/libpcre.a
/usr/bin/ld: /usr/local/lib/libpcre.a(pcre_compile.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpcre.a: could not read symbols: Bad value
gmake[2]: *** [regex.so] Error 1
gmake[2]: Leaving directory `/usr/work/usr/home/amdmi3/qscheme/work/qscheme-0.5.1'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/work/usr/home/amdmi3/qscheme/work/qscheme-0.5.1'
gmake: *** [all-recursive-am] Error 2
*** Error code 1

Stop in /usr/home/amdmi3/qscheme.

Port maintainer (krion at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77

More information about the freebsd-ports-bugs mailing list