Thu, 04 Oct 2012 20:04:22 +0200
Correct very nasty code segment linkage problem when building perl DSO.
This problem leads to segfaults in libpixman called by RRDs::Simple, as
diagnosed by gdb(1) indicating 'print var... cannot access memory at
address' or something similar.
1.1 --- a/libpixman/libpixman.spec Thu Oct 04 20:00:55 2012 +0200 1.2 +++ b/libpixman/libpixman.spec Thu Oct 04 20:04:22 2012 +0200 1.3 @@ -32,7 +32,10 @@ 1.4 Group: XWindow 1.5 License: MIT-style 1.6 Version: 0.26.2 1.7 -Release: 20120630 1.8 +Release: 20120800 1.9 + 1.10 +# package options 1.11 +%option with_pic no 1.12 1.13 # list of sources 1.14 Source0: http://cairographics.org/releases/pixman-%{version}.tar.gz 1.15 @@ -59,7 +62,12 @@ 1.16 1.17 %build 1.18 CC="%{l_cc}" \ 1.19 +%if "%{with_pic}" == "yes" 1.20 + CFLAGS="%{l_cflags -O} -fPIC" \ 1.21 + LDFLAGS="%{l_cflags -O} -fPIC" \ 1.22 +%else 1.23 CFLAGS="%{l_cflags -O}" \ 1.24 +%endif 1.25 ./configure \ 1.26 --prefix=%{l_prefix} \ 1.27 --disable-gtk \
2.1 --- a/rrdtool/rrdtool.patch Thu Oct 04 20:00:55 2012 +0200 2.2 +++ b/rrdtool/rrdtool.patch Thu Oct 04 20:04:22 2012 +0200 2.3 @@ -116,7 +116,7 @@ 2.4 - } else { 2.5 - $librrd = "-L../../src/.libs/ $R -lrrd"; 2.6 - } 2.7 -+ my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib -lcairo -lpangocairo -lpixman-1 -lpango -lpangoft2 -lfreetype -lpng -lgobject -lgio -lgmodule -lglib -lfontconfig -lfreetype -lxml2 -lexpat -lpcre -lz -liconv -lintl"; 2.8 ++ my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib -lcairo -lpangocairo -lpixman-1 -lpango -lpangoft2 -lfreetype -lpng -lgobject -lgio -lgmodule -lglib -lfontconfig -lfreetype -lxml2 -lexpat -lpcre -lz -liconv -lintl -lffi"; 2.9 2.10 WriteMakefile( 2.11 'NAME' => 'RRDs',
3.1 --- a/rrdtool/rrdtool.spec Thu Oct 04 20:00:55 2012 +0200 3.2 +++ b/rrdtool/rrdtool.spec Thu Oct 04 20:04:22 2012 +0200 3.3 @@ -54,11 +54,11 @@ 3.4 # build information 3.5 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make, pkgconfig, perl-openpkg >= 5.8.3-20040126, perl-module, intltool 3.6 PreReq: OpenPKG, openpkg >= 20100101 3.7 -BuildPreReq: png, zlib, freetype, pango, cairo, libxml 3.8 -PreReq: png, zlib, freetype, pango, cairo, libxml 3.9 +BuildPreReq: png, zlib, freetype, pango, cairo, libpixman, libxml, libffi 3.10 +PreReq: png, zlib, freetype, pango, cairo, libpixman, libxml, libffi 3.11 %if "%{with_perl}" == "yes" 3.12 -BuildPreReq: perl 3.13 -PreReq: perl 3.14 +BuildPreReq: perl, libpixman::with_pic = yes 3.15 +PreReq: perl, libpixman::with_pic = yes 3.16 %endif 3.17 %if "%{with_python}" == "yes" 3.18 BuildPreReq: python 3.19 @@ -117,8 +117,13 @@ 3.20 echo "ac_cv_path_PERL=no" >config.cache 3.21 CC="%{l_cc}" \ 3.22 CPPFLAGS="%{l_cppflags}" \ 3.23 +%if "%{with_perl}" == "yes" 3.24 + CFLAGS="%{l_cflags -O} -fPIC" \ 3.25 + LDLAGS="%{l_ldflags} -fPIC" \ 3.26 +%else 3.27 CFLAGS="%{l_cflags -O}" \ 3.28 LDLAGS="%{l_ldflags}" \ 3.29 +%endif 3.30 LIBS="`pkg-config pangocairo --libs`" \ 3.31 ./configure \ 3.32 --cache-file=./config.cache \ 3.33 @@ -155,7 +160,7 @@ 3.34 -e 's/^\(install-data-am:\).*/\1/' \ 3.35 Makefile 3.36 %{l_make} %{l_mflags} install \ 3.37 - DESTDIR=$RPM_BUILD_ROOT AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" 3.38 + DESTDIR=$RPM_BUILD_ROOT DESTDIR="$RPM_BUILD_ROOT" 3.39 3.40 # install Perl part 3.41 %if "%{with_perl}" == "yes"