Bug 689396 - ghostscript-gpl-8.60 fails to compile on 64bit linux
ghostscript-gpl-8.60 fails to compile on 64bit linux
Status: RESOLVED FIXED
Product: Ghostscript
Classification: Unclassified
Component: Build Process
8.60
Other Linux
: P4 normal
Assigned To: Hin-Tak Leung
Bug traffic
:
: 689527 689575 689834 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-08 03:12 PDT by Timo Gurr
Modified: 2010-05-21 09:33 PDT (History)
4 users (show)

See Also:
Customer:
Word Size: ---


Attachments
ghostscript-fPIC-64bit.patch (381 bytes, text/plain)
2007-08-08 03:13 PDT, Timo Gurr
Details
ghostscript-fPIC-64bit.patch (232 bytes, text/plain)
2007-08-10 01:22 PDT, Timo Gurr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Gurr 2007-08-08 03:12:26 PDT
System: x86_64-pc-linux-gnu
GCC: 4.1.2
CFLAGS:-march=k8 -O2 -pipe

writing node 'lib/FAPIfontmap' len=1468
writing node 'lib/FAPIconfig' len=805
writing node 'lib/FAPIcidfmap' len=1483
writing node 'lib/FCOfontmap-PCLPS2' len=3018
writing node 'lib/gs_cet.ps' len=1817
Total %rom% structure size is 3458264 bytes.
x86_64-pc-linux-gnu-gcc  -DHAVE_MKSTEMP -DHAVE_HYPOT -DHAVE_FILE64 -DHAVE_FONTCONFIG -O2  -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned 
long 
int"  -march=k8 -O2 -pipe    -I./obj/../soobj -I./src  -o ./obj/../soobj/gsromfs.o -c ./obj/../soobj/gsromfs.c
x86_64-pc-linux-gnu-gcc  -DHAVE_MKSTEMP -DHAVE_HYPOT -DHAVE_FILE64 -DHAVE_FONTCONFIG -O2  -Wall -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned 
long 
int"  -march=k8 -O2 -pipe    -I./src -I./obj/../soobj -I./obj/../soobj -I./src  -o ./obj/../soobj/iccinit1.o -c ./src/iccinit1.c
./obj/../soobj/echogs -w ./obj/../soobj/ldt.tr -n - 
x86_64-pc-linux-gnu-gcc -L/usr/lib64  -L/usr/lib64 -shared -Wl,-soname=libgs.so.8 -o ./bin/../sobin/libgs.so.8.60
./obj/../soobj/echogs -a ./obj/../soobj/ldt.tr -n -s ./obj/../soobj/gs.o -s
cat ./obj/../soobj/ld.tr >>./obj/../soobj/ldt.tr
./obj/../soobj/echogs -a ./obj/../soobj/ldt.tr -s - -lcupsimage -lcups -L/usr/lib64 -lgnutls -L/usr/lib64 -ltasn1 -L/usr/lib64 -lgcrypt -L/usr/lib64 -lgpg-error -lz -lpthread -lm -lcrypt -ldl -lm  -lstdc++  -lfontconfig   -lm
if [ x != x ]; then LD_RUN_PATH=; export LD_RUN_PATH; fi; \
        XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \
        FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \
        DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \
        DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \
        DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \
        DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \
        DEVICE_DEVS_EXTRA= \
        /bin/sh <./obj/../soobj/ldt.tr
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: ./obj/../soobj/gs.o: 
relocation R_X86_64_32 against `a local symbol' can not be used when making a 
shared object; recompile with -fPIC
./obj/../soobj/gs.o: could not read symbols: Bad value
collect2: ld gab 1 als Ende-Status zurück
make[1]: *** [bin/../sobin/libgs.so.8.60] Error 1
make[1]: Leaving directory 
`/var/tmp/portage/app-text/ghostscript-gpl-8.60/work/ghostscript-8.60'
make: *** [so] Error 2

Attached is a patch which adds -fPIC to the shared libs compilation.
Comment 1 Timo Gurr 2007-08-08 03:13:19 PDT
Created attachment 3268 [details]
ghostscript-fPIC-64bit.patch
Comment 2 Hin-Tak Leung 2007-08-09 15:08:15 PDT
While I am aware of the need of the extra -fPIC occasionally in 64-bit
compilation, I don't think the place where the submitted patch modified 
is the appropriate place... the appropriate place is probably 
in the configure script.
Comment 3 Timo Gurr 2007-08-10 01:22:10 PDT
Uh, I should have looked at the configure script before. Many thanks for your 
suggestion! I attached a working configure patch, but I also discovered that I 
can pass --enable-dynamic to configure to activate -fPIC. So what is the 
preffered way to handle this?
Comment 4 Timo Gurr 2007-08-10 01:22:48 PDT
Created attachment 3273 [details]
ghostscript-fPIC-64bit.patch
Comment 5 Till Kamppeter 2007-09-05 14:58:05 PDT
I get it to work by adding "-fPIC" to the general CFLAGS:

CFLAGS="$CFLAGS -fPIC" ./configure ...
Comment 6 Ralph Giles 2007-10-23 09:48:55 PDT
*** Bug 689527 has been marked as a duplicate of this bug. ***
Comment 7 Ralph Giles 2007-11-27 09:51:16 PST
*** Bug 689575 has been marked as a duplicate of this bug. ***
Comment 8 Hin-Tak Leung 2008-08-28 05:33:45 PDT
*** Bug 689834 has been marked as a duplicate of this bug. ***
Comment 9 Hin-Tak Leung 2010-05-02 03:12:40 PDT
Grabbing a Ralph's bugs.
Comment 10 Hin-Tak Leung 2010-05-15 10:21:10 PDT
Both 
    "./configure --enable-dynamic && make so" 
and 
    "ln -s base/unix-gcc.mak makefile && make so"
are documented. (I updated the documentation in r11253 for the former).

The latter has not been working for a while but a few commits leading up to r11258 makes it work again.
Comment 11 Jean-Pierre .Vial 2010-05-21 09:33:40 PDT
(In reply to comment #10)
> Both 
>     "./configure --enable-dynamic && make so" 

it works fine for me on the SVN version (21/05/2010)
on Suse Linux 11.2  X86_64

(the release 8.71 failed on "make so" even with
both --enable-dynamic as configure option and an environment variable
CFLAGS="-fPIC")