LFS, pre-KDE: Fixing libmng with -fPIC and xine with a header
Fixing libmng with -fPIC
In preparation for getting KDE4 (and Qt4, and all the other dependencies) working with my Linux from Scratch install, I noticed an issue when compiling libmng:
/usr/bin/ld: libmng_chunk_io.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC libmng_chunk_io.o: could not read symbols: Bad valuecollect2: ld returned 1 exit status make: *** [libmng.so.220.127.116.11] Error 1
To fix this, you’ll have to edit the makefile in /sources/libmng-1.0.10/makefiles/makefile.linux as per this osdir mailing list thread. Line 47 currently reads:
FLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall -O3 -funroll-loops \
Add the -fPIC flag instead:
FLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall -O3 -fPIC -funroll-loops \
Then change back to /sources/libmng-1.0.10 and run make clean; cp makefiles/makefile.linux Makefile && make to successfully compile the library.
Xine appears to be missing a header, causing an xmcc compilation error. Check out the original solution and add the line with the + where indicated:
src/video_out/xxmc.h 2011-01-23 17:55:01.333928003 +0100
+++ src/video_out/xxmc.h 2011-01-23 17:54:48.509926463 +0100
@@ -79,6 +79,7 @@
+ #include <X11/extensions/XvMClib.h>
I currently run a mix of Windows, OS X and Linux systems for both work and personal use.
For Linux, I prefer Ubuntu LTS releases without Unity and still keep Windows 7 around for gaming.
Check out my profile for more information.