Bug 36139

Summary: static build with -fPIC misses some symbols
Product: Mesa Reporter: Burlen <bloring>
Component: OtherAssignee: mesa-dev
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: 7.10   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Burlen 2011-04-11 13:21:44 UTC
When building osmesa with GNU compilers as a static lib I used -fPIC (see below) but I got this error when compiling my application as shared library:

/lib/libOSMesa32.a(ir_to_mesa.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC              
/usr/common/graphics/ParaView/Mesa-7.10.1/lib/libOSMesa32.a: could not read symbols: Bad value

from config.log

./configure CC=cc CXX=CC CFLAGS=-fPIC LDFLAGS=-fPIC --prefix=/usr/common/graphics/ParaView/Mesa-7.10.1 --disable-shared --enable-static --disable-egl --disable-glw --disable-gallium --with-osmesa-bits=32 --with-driver=osmesa --enable-64-bit --disable-32-bit

Apprently -fPIC isn't passed to compiler for all targets ?

same thing occurs when using the traditional configs, eg linux-osmesa-static
Comment 1 Michel Dänzer 2011-04-12 02:53:11 UTC
You're not passing -fPIC in CXXFLAGS?
Comment 2 Burlen 2011-04-12 10:37:51 UTC
I thought mesa is a c library, and thus CXXFLAGS is not needed. Do I need it?
Comment 3 Michel Dänzer 2011-04-12 10:43:49 UTC
(In reply to comment #2)
> I thought mesa is a c library, and thus CXXFLAGS is not needed. Do I need it?

Probably; the new GLSL compiler is implemented in C++.
Comment 4 Burlen 2011-04-12 17:12:31 UTC
OK, lets close the bug until I have a chance to investigate further.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.