Bug#335199: cupsys: FTBFS: Not using -fPIC to make shared lib.
Kenshi Muto writes:
> Hi,
>
> At Sat, 22 Oct 2005 16:42:03 +0200,
> Kurt Roeckx wrote:
> > Package: cupsys
> > Version: 1.1.99.b1.r4748-1
> > Severity: serious
> > Tags: experimental
> >
> > Hi,
> >
> > Your package is failing to build on amd64 with the following
> > error:
> > Linking libcups.so.2...
> > /usr/bin/ld: array.o: relocation R_X86_64_PC32 against `cupsArrayCurrent' can not be used when making a shared object; recompile with -fPIC
> > /usr/bin/ld: final link failed: Bad value
> >
> > The build log does not show the actual commands used to compile,
> > but it probably didn't use -fPIC to make array.o and the other .o
> > files. To make a shared library you need to be using -fPIC. For
> > a static library you shouldn't be using it.
>
> I confirmed on my AMD64 but the problem isn't of -fPIC.
>
> Here is "make -n" result.
>
> echo Compiling array.c...
> cc -Wshadow -Wunused -Wall -Wno-format-y2k -fPIC -O2 -fpie -I.. -g -Wall -O2
> -fpie -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -c array.c
> echo Linking libcups.so.2...
> cc -Wl,-soname,libcups.so.2 -shared -Wshadow -Wunused -Wall -Wno-format-y2k -fPI
> C -O2 -fpie -o libcups.so.2 array.o attr.o auth.o backchannel.o dest.o dir.o emi
> t.o encode.o file.o getputfile.o globals.o http.o http-addr.o http-support.o ipp
> .o ipp-support.o langprintf.o language.o mark.o md5.o md5passwd.o normalize.o op
> tions.o page.o ppd.o snprintf.o string.o tempfile.o transcode.o usersys.o util.o
> -L/usr/lib -lgnutls -lpthread -lz
>
> I searched a similar problem, but all of I can find is only old
> resolved binutils + pragma issue.
>
> Dear gcc team, could you help me?
-fpie
-fPIE
These options are similar to -fpic and -fPIC, but generated posi-
tion independent code can be only linked into executables. Usually
these options are used when -pie GCC option will be used during
linking.
Reply to: