Re: PGXS problem with pdftotext - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PGXS problem with pdftotext
Date
Msg-id 22384.1246646701@sss.pgh.pa.us
Whole thread Raw
In response to Re: PGXS problem with pdftotext  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: PGXS problem with pdftotext
Re: PGXS problem with pdftotext
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Leaving off -shared was OK, but when I left off -fpic, I got this:
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld:
> poppler_compat.o: relocation R_X86_64_32 against `a local symbol' can
> not be used when making a shared object; recompile with -fPIC
> poppler_compat.o: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [libpdftotext.so.0.0] Error 1

Huh.  On Linux platforms, the PG makefiles should include -fpic in
CFLAGS (via CFLAGS_SL) automatically; you should not need to repeat it
in CPPFLAGS.  For instance, if I go into contrib/adminpack and make, I see

sed 's,MODULE_PATHNAME,$libdir/adminpack,g' adminpack.sql.in >adminpack.sql
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv-g -fpic -I../../src/interfaces/libpq -I. -I../../src/include -D_GNU_SOURCE   -c -o adminpack.o adminpack.c
 
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv-g -fpic -shared  adminpack.o   -L../../src/port  -Wl,-rpath,'/home/tgl/testversion/lib' -o adminpack.so
 

What do you get?  What does pg_config report for the various FLAGS
variables?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [pgsql-www] commitfest.postgresql.org
Next
From: Robert Haas
Date:
Subject: Re: [pgsql-www] commitfest.postgresql.org