[Bug 192158] Ccache generates relocation errors

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jul 27 11:40:31 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192158

--- Comment #2 from melvyn at magemana.nl ---
Definitely an issue with libtool:

/bin/sh ../libtool  --tag=CC   --mode=link cc -I/usr/local/include/libxml2
-I/usr/include -O2 -pipe -fno-strict-aliasing -Wall 
-Wl,--version-script=./libxslt.syms -version-info 2:28:1 -L/usr/local/lib -fPIC
-o libxslt.la -rpath /usr/local/lib attrvt.lo xslt.lo xsltlocale.lo
xsltutils.lo pattern.lo templates.lo variables.lo keys.lo numbers.lo
extensions.lo extra.lo functions.lo namespaces.lo imports.lo attributes.lo
documents.lo preproc.lo transform.lo security.lo -L/usr/local/lib -lxml2 -lz
-L/usr/lib -lm
libtool: link: cc -shared   .libs/attrvt.o .libs/xslt.o .libs/xsltlocale.o
.libs/xsltutils.o .libs/pattern.o .libs/templates.o .libs/variables.o
.libs/keys.o .libs/numbers.o .libs/extensions.o .libs/extra.o .libs/functions.o
.libs/namespaces.o .libs/imports.o .libs/attributes.o .libs/documents.o
.libs/preproc.o .libs/transform.o .libs/security.o    -Wl,-rpath
-Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib
/usr/local/lib/libxml2.so -lz -L/usr/lib -lm  -O2
-Wl,--version-script=./libxslt.syms   -Wl,-soname -Wl,libxslt.so.2 -o
.libs/libxslt.so.2
/usr/bin/ld: .libs/attrvt.o: relocation R_X86_64_32 against `a local symbol'
can not be used when making a shared object; recompile with -fPIC
.libs/attrvt.o: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)

LDFLAGS ammended with -fPIC, passed on to libtool, but when called for link
it's been deleted.

Zooming in more:
configure:9679: checking if cc PIC flag -fPIC -DPIC works
configure:9697: cc -c -O2 -pipe -fno-strict-aliasing -I/usr/local/include -fPIC
-DPIC -DPIC conftest.c >&5
cc: warning: argument unused during compilation: '-L/usr/local/lib'
configure:9701: $? = 0
configure:9714: result: no

So, exit status is OK, but it still finds result no:

     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null;
the
n
       lt_cv_prog_compiler_pic_works=yes
     fi

The unused argument generates stderr output that makes libtool think it doesn't
support it, even though $? is 0. Braindead by design.

Adding -Qunused-arguments fixes the issue. I still don't get how it relates to
ccache and why adding NO_CCACHE to a port's Makefile fixes things.
Is there some magic that adds -Qunused-arguments if CC = clang and that fails
to detect that CC=clang when CC=ccache?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list