Hi,

On Tue, 2024-03-05 at 23:10 +0100, John Paul Adrian Glaubitz wrote:
> > 
> > oks like it's built with dpkg-dev_1.22.4 but the time64 build flags are
> > only activated with 1.22.5.
> 
> Ah, that would explain it, thank you so much!
> 
> > I think there was talk about making them the default in gcc too, not
> > sure if they got there yet.
> > 
> > I suppose Perl could/should store them in its configuration so they'd be
> > passed to all XS module builds regardless of what dpkg-buildflags says.
> > But currently things from dpkg-buildflags get explicitly filtered away [1].
> > 
> > IIRC the rationale for this was that packages could opt in/out of security
> > hardening flags independently. That doesn't seem desirable here as they
> > make the XS module ABI incompatible as you've noticed.
> > 
> > [1] see https://sources.debian.org/src/perl/5.38.2-3.1/debian/rules/#L188
> >     I think -fstack-protector gets passed through there as an exception,
> >     so doing the same with the relevant time64 flags should do the trick.
> > 
> 
> Thanks! You saved me a lot of headaches!

I have run into this issue again trying to rebuild libxs-parse-keyword-perl
with a src:perl that was built with dpkg_1.22.5:

Building XS-Parse-Keyword
powerpc-linux-gnu-gcc -Isrc/ -I/usr/lib/powerpc-linux-gnu/perl/5.38/CORE -fPIC 
-I. -Ihax -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing 
-pipe -I/usr/local/include -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 
-Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -Wformat -
Werror=format-security -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -Wformat -Werror=format-
security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time 
-D_FORTIFY_SOURCE=2 -o src/infix.o src/infix.c
powerpc-linux-gnu-gcc -Isrc/ -I/usr/lib/powerpc-linux-gnu/perl/5.38/CORE -fPIC 
-I. -Ihax -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing 
-pipe -I/usr/local/include -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 
-Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -Wformat -
Werror=format-security -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -Wformat -Werror=format-
security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time 
-D_FORTIFY_SOURCE=2 -o src/keyword.o src/keyword.c
src/keyword.c: In function 'probe_piece':
src/keyword.c:348:37: warning: format '%d' expects argument of type 'int', but 
argument 2 has type 'U32' {aka 'long unsigned int'} [-Wformat=]
  348 |   croak("TODO: probe_piece on type=%d\n", type);
      |                                    ~^     ~~~~
      |                                     |     |
      |                                     int   U32 {aka long unsigned int}
      |                                    %ld
src/keyword.c: In function 'parse_piece':
src/keyword.c:828:37: warning: format '%d' expects argument of type 'int', but 
argument 2 has type 'U32' {aka 'long unsigned int'} [-Wformat=]
  828 |   croak("TODO: parse_piece on type=%d\n", type);
      |                                    ~^     ~~~~
      |                                     |     |
      |                                     int   U32 {aka long unsigned int}
      |                                    %ld
powerpc-linux-gnu-gcc -Isrc/ -I/usr/lib/powerpc-linux-gnu/perl/5.38/CORE 
-DVERSION="0.39" -DXS_VERSION="0.39" -fPIC -I. -Ihax -c -D_REENTRANT 
-D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 
-Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-
protector-strong -Wformat -Werror=format-security -g -O2 
-Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -
Wformat -Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -o lib/XS/Parse/Keyword.o 
lib/XS/Parse/Keyword.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/XS/Parse/Keyword/Keyword.bs')
powerpc-linux-gnu-gcc -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/home/glaubitz/perl-modules/libxs-parse-keyword-perl-0.39=. 
-fstack-protector-strong -Wformat -Werror=format-
security -Wl,-z,relro -Wl,-z,now -shared -L/usr/local/lib 
-fstack-protector-strong -o blib/arch/auto/XS/Parse/Keyword/Keyword.so 
lib/XS/Parse/Keyword.o src/infix.o src/keyword.o
Parser.c: loadable library and perl binaries are mismatched (got first 
handshake key 0xb600080, needed 0xb700080)
dh_auto_build: error: /usr/bin/perl Build returned exit code 1
make: *** [debian/rules:6: binary-arch] Error 1
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit 
status 2

Also, I noticed that libxs-parse-keyword-perl build-depends on 
libextutils-cbuilder-perl
which is apparently obsolete and also still depends on the old Perl API [1] 
which makes
me wonder how libxs-parse-keyword-perl was built for armhf and armel [2].

Adrian

> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060712
> [2] 
> https://buildd.debian.org/status/package.php?p=libxs-parse-keyword-perl&suite=sid

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply via email to