Hi!

On Wed, 2016-11-23 at 23:42:56 +0300, Roman Tsisyk wrote:
> Package: libdpkg-perl
> Version: 1.18.15
> Severity: serious

> I use cdbs with cmake, which automatically adds the following
> compilation flags gcc/g++/ld:
> 
>     -DCMAKE_C_FLAGS="-g -O2 -fdebug-prefix-map=<sourcedir> =. 
> -specs=/usr/share/dpkg/no-pie-compile.specs -Wformat -Werror=format-security 
> -Wdate-time -D_FORTIFY_SOURCE=2" 
>     -DCMAKE_CXX_FLAGS="-g -O2 -fdebug-prefix-map=<sourcedir>=. 
> -specs=/usr/share/dpkg/no-pie-compile.specs -Wformat -Werror=format-security 
> -Wdate-time -D_FORTIFY_SOURCE=2" 
>     -DCMAKE_MODULE_LINKER_FLAGS="-specs=/usr/share/dpkg/no-pie-link.specs 
> -Wl,-z,relro" 
>     -DCMAKE_SHARED_LINKER_FLAGS="-specs=/usr/share/dpkg/no-pie-link.specs 
> -Wl,-z,relro" 

> gcc can't compile even a simple C program using this spec:
> 
> ----------
> #include <stdio.h>
> 
> int
> main(void)
> {
>         printf("hello\n");
>         return 0;
> }
> ----------
> 
> ----------
> gcc xx.c -o xx -specs=/usr/share/dpkg/no-pie-compile.specs
> /usr/bin/ld: /tmp/ccEbzEVn.o: relocation R_X86_64_32 against `.rodata' can 
> not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> ----------
> 
> This spec file is owned by libdpkg-perl package.  Please consider to
> fix this spec or to revert the latest changes.

The problem is that whatever is linking that code is not passing the
correct flags. There is a missing LDFLAGS somewhere. If you retry with:

  $ gcc -o xx xx.c \
      -specs=/usr/share/dpkg/no-pie-compile.specs \
      -specs=/usr/share/dpkg/no-pie-link.specs

it will work.

> Severity is serious because this spec file is completely unusable
> for everyone.

Only if used incorrectly. ;) Otherwise big parts of the Debian archive
would be already completely broken!

So I'd like more information to know to what package to reassign this
to? Either cdbs, cmake or perhaps this is a problem in the package you
are trying to build (either in Debian or local)? Otherise I'll just
close this bug as invalid (at least when it comes to libdpkg-perl
itself).

Regards,
Guillem

Reply via email to