Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120297 - Valgrind needs -fPIC
Summary: Valgrind needs -fPIC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: GStreamer package maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-25 06:13 UTC by Heikki Pernu
Modified: 2006-03-06 04:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heikki Pernu 2006-01-25 06:13:56 UTC
Valgrind is compiled without -fPIC, affect callgrind which in turn is used
by other packages. These other packages fail to build correctly.

Applies at least to version 3.1.0
Comment 1 Caleb Tennis (RETIRED) gentoo-dev 2006-01-25 10:13:16 UTC
I don't see a problem adding -fPIC to callgrind or valgrind.
Comment 2 Maurice van der Pot (RETIRED) gentoo-dev 2006-01-25 10:20:56 UTC
Heikki, can you give some details about the problems you see?

Valgrind doesn't work well with -fpie, so it may have problems with -fPIC 
as well. I'll have to be sure -fPIC is what we want before I add it.
Comment 3 Heikki Pernu 2006-01-25 10:34:26 UTC
To my understanding, all libraries should be compiler with -fPIC to actually
work on AMD64.

Thus:
Emerge gstreamer
->
x86_64-pc-linux-gnu-gcc -shared  .libs/libgstreamer_0.8_la-gst.o .libs/libgstreamer_0.8_la-gstobject.o .libs/libgstreamer_0.8_la-gstatomic.o .libs/libgstreamer_0.8_la-gstbin.o .libs/libgstreamer_0.8_la-gstbuffer.o .libs/libgstreamer_0.8_la-gstcaps.o .libs/libgstreamer_0.8_la-gstclock.o .libs/libgstreamer_0.8_la-gstcpu.o .libs/libgstreamer_0.8_la-gstdata.o .libs/libgstreamer_0.8_la-gstelement.o .libs/libgstreamer_0.8_la-gstelementfactory.o .libs/libgstreamer_0.8_la-gsterror.o .libs/libgstreamer_0.8_la-gstevent.o .libs/libgstreamer_0.8_la-gstfilter.o .libs/libgstreamer_0.8_la-gstformat.o .libs/libgstreamer_0.8_la-gstindex.o .libs/libgstreamer_0.8_la-gstinfo.o .libs/libgstreamer_0.8_la-gstinterface.o .libs/libgstreamer_0.8_la-gstmemchunk.o .libs/libgstreamer_0.8_la-gstpad.o .libs/libgstreamer_0.8_la-gstchildproxy.o .libs/libgstreamer_0.8_la-gstpipeline.o .libs/libgstreamer_0.8_la-gstplugin.o .libs/libgstreamer_0.8_la-gstpluginfeature.o .libs/libgstreamer_0.8_la-gstprobe.o .libs/libgstreamer_0.8_la-gstqueue.o .libs/libgstreamer_0.8_la-gstquery.o .libs/libgstreamer_0.8_la-gstscheduler.o .libs/libgstreamer_0.8_la-gststructure.o .libs/libgstreamer_0.8_la-gstsystemclock.o .libs/libgstreamer_0.8_la-gsttag.o .libs/libgstreamer_0.8_la-gsttaginterface.o .libs/libgstreamer_0.8_la-gstthread.o .libs/libgstreamer_0.8_la-gsttrace.o .libs/libgstreamer_0.8_la-gsttrashstack.o .libs/libgstreamer_0.8_la-gsttypefind.o .libs/libgstreamer_0.8_la-gsturi.o .libs/libgstreamer_0.8_la-gsturitype.o .libs/libgstreamer_0.8_la-gstutils.o .libs/libgstreamer_0.8_la-gstvalue.o .libs/libgstreamer_0.8_la-gstregistry.o .libs/libgstreamer_0.8_la-gstregistrypool.o .libs/libgstreamer_0.8_la-gstparse.o .libs/libgstreamer_0.8_la-gstxml.o .libs/libgstreamer_0.8_la-gstenumtypes.o .libs/libgstreamer_0.8_la-gstmarshal.o -Wl,--whole-archive parse/.libs/libgstparse.a registries/.libs/libgstxmlregistry.a -Wl,--no-whole-archive  -L/usr/lib64/valgrind/amd64-linux /usr/lib64/libxml2.so -lz /usr/lib64/libgobject-2.0.so -L/usr/lib64 /usr/lib64/libgthread-2.0.so -lpthread /usr/lib64/libgmodule-2.0.so -ldl /usr/lib64/libglib-2.0.so /usr/lib64/libpopt.so -lcoregrind -lvex -lgcc -lm  -march=k8 -pthread -Wl,--export-dynamic -Wl,-soname -Wl,libgstreamer-0.8.so.1 -Wl,-version-script -Wl,.libs/libgstreamer-0.8.ver -o .libs/libgstreamer-0.8.so.1.4.0
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/valgrind/amd64-linux/libcoregrind.a(libcoregrind_amd64_linux_a-m_main.o): relocation R_X86_64_32S against `vgPlain_interim_stack' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/valgrind/amd64-linux/libcoregrind.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [libgstreamer-0.8.la] Error 1
Comment 4 Maurice van der Pot (RETIRED) gentoo-dev 2006-01-25 12:39:57 UTC
Looks like it requires valgrind's static library be built with -fPIC. 
We only build shared objects with -fPIC, because the rest would just generate 
unnecessary performance overhead.

I'm not sure why gstreamer would link to valgrind's libraries.
And did you mistake coregrind for callgrind?

What other packages do you see this problem with? I'd like to find out if the
package itself is pulling in valgrind or if it's something under water.
Comment 5 Heikki Pernu 2006-01-25 13:42:44 UTC
Unable to verify what other packages might need this.
This originally came up as the result of emerge -uDv --newuse world
where gstreamer is the first on list. Still blocking other updates.
Thus don't know what other packages might need this. Tetex came
through nicely without it.

I do not know why gstreamer wants to link with valgrind libraries.

However, it seems that it is trying to build a shared library and
this would need PIC. Which explains why it complains.
Don't know why it needs the libraries in question for that part, however.

Comment 6 Maurice van der Pot (RETIRED) gentoo-dev 2006-01-26 11:00:26 UTC
Reassigning to gnome (maintainers of gstreamer). 
Let's see what they know about this.
Comment 7 Zaheer Abbas Merali (RETIRED) gentoo-dev 2006-02-03 11:19:04 UTC
please check gstreamer 0.8.11 it now disables run-time valgrind checking
Comment 8 Zaheer Abbas Merali (RETIRED) gentoo-dev 2006-03-06 01:33:22 UTC
ping, anyone checked gstreamer 0.8.11 or 0.8.12?
Comment 9 Heikki Pernu 2006-03-06 01:36:20 UTC
I don't know what is the current version, latest stable in tree nonetheless
And no such problem anymore.
Comment 10 Zaheer Abbas Merali (RETIRED) gentoo-dev 2006-03-06 04:39:19 UTC
ok closing