Summary: | libgs.so gets built with _start etc with gcc 4.5.3 | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Brian Modra <epailty> |
Component: | Build Process | Assignee: | Chris Liddell (chrisl) <chris.liddell> |
Status: | RESOLVED INVALID | ||
Severity: | major | CC: | jackie.rosen |
Priority: | P4 | ||
Version: | 9.05 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
Brian Modra
2012-06-10 18:57:12 UTC
I don't have access to gcc 4.5.3 just now, but all the versions I have access to (4.2.1, 4.3.4 and 4.6.1) all build the shared library with the "-shared" option, I can't see any reason 4.5.3 would be any different. Especially since the option is defined in "base/unix-dll.mak", so is not dependant on any tests run by configure. Could you post the contents of the file "./soobj/ldt.tr", please? (In reply to comment #0) > /bin/sh <./soobj/ldt.tr A few lines before this, there should be ./soobj/aux/echogs -w ./soobj/ldt.tr -n - gcc -shared -Wl,-soname=libgs.so.9 -o ./sobin/libgs.so.9.04 ./soobj/aux/echogs -a ./soobj/ldt.tr -n -s ./soobj/gsromfs1.o ./soobj/gs.o -s cat ./soobj/ld.tr >>./soobj/ldt.tr These should put "-shared" right at the top of the ./soobj/ldt.tr > rm -f ./sobin/libgs.so.9 > ln -s libgs.so.9.04 ./sobin/libgs.so.9 > rm -f ./sobin/libgs.so > ln -s libgs.so.9.04 ./sobin/libgs.so > x86_64-pc-linux-gnu-gcc -DHAVE_MKSTEMP -DHAVE_FILE64 -DHAVE_MKSTEMP64 > -DHAVE_FONTCONFIG -DHAVE_SETLOCALE -DHAVE_SSE2 -DHAVE_BSWAP32 -DHAVE_BYTESl > -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes > -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement > -fno-bHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long int" -O2 -pipe > -DUSE_LIBPAPER -DGS_DEVS_SHARED > -DGS_DEVS_SHARED_DIR=\"/usr/lib64/ghostscript/9.0e -DWHICH_CMS="lcms" -g -o > ./sobin/gsc ./psi/dxmainc.c \ > -Wl,-O1 -Wl,--as-needed -L./sobin -lgs ^^^^^^^^^^^^^^^^^^^^^^^ Please do not override the linker flag. In particular, I think "-Wl,--as-needed" is known not to work, so please do not do that. Have a search around old bug reports. (In reply to comment #2) > Please do not override the linker flag. In particular, I think > "-Wl,--as-needed" is known not to work, so please do not do that. It is a gentoo problem, so I'll report it to their bugzilla. Thanks for pointing me in the right direction. I just used the gentoo portage system to install the package without any changes: config.log:LDFLAGS='-Wl,-O1 -Wl,--as-needed' ./soobj/aux/echogs -w ./soobj/ldt.tr -n - x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -o ./sobin/libgs.so.9.04 ./soobj/aux/echogs -a ./soobj/ldt.tr -n -s ./soobj/gsromfs0.o ./soobj/gs.o -s cat ./soobj/ld.tr >>./soobj/ldt.tr ./soobj/aux/echogs -a ./soobj/ldt.tr -s - -ldl -lm -lpaper -rdynamic -ldl -lfontconfig -lfreetype -lpthread -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 <./soobj/ldt.tr rm -f ./sobin/libgs.so.9 ln -s libgs.so.9.04 ./sobin/libgs.so.9 rm -f ./sobin/libgs.so ln -s libgs.so.9.04 ./sobin/libgs.so This is how ldt.tr looked before I added the -shared: x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -o ./sobin/libgs.so.9.05 ./soobj/gsromfs0.o ./soobj/gs.o ./soobj/gp_getnv.o \ ./soobj/gp_upapr.o \ ./soobj/gp_unix.o \ ./soobj/gp_unifs.o \ ./soobj/gp_unifn.o \ ... ./soobj/gsrop.o \ ./soobj/gp_strdl.o \ -llcms2 \ -ltiff \ -ljpeg \ -lpng \ -ljbig2dec \ -lz \ -ldl -lm -lpaper -ltiff -rdynamic -ldl -lfontconfig -lfreetype -lpthread -lm Oops, I hit the commit button too quickly.... Thanks for confirming it's a Gentoo problem. I've closed this bug, but you can reopen it if there is any more fall-out related to it. |