Robins Tharakan <thara...@gmail.com> writes:
> Unrelated, parula has been failing the libperl test (only v15 and older),
> for the past
> 3 weeks - to clarify, this test started to fail (~18 days ago) before I
> fixed the
> 'RemoveIPC' configuration (~5 days ago), so this is unrelated to that
> change.

> https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=parula&dt=2025-01-09%2003%3A13%3A18&stg=configure

> The first REL_15_STABLE test failure points to acd5c28db5 but I didn't see
> anything interesting there.

> The error seems to be around "annobin.so" and so it may be about how
> gcc is being compiled (not sure). While I figure out if GCC compilation
> needs work, I thought to bring it up here since v16+ seems to work fine on
> the same box and we may want to consider doing something similar for all
> older versions too?

In a failing build (v13) I see

checking for CFLAGS recommended by Perl... -D_REENTRANT -D_GNU_SOURCE -O2 
-ftree-vectorize -flto=auto -ffat-lto-objects -fexceptions -g 
-grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv8.2-a+crypto 
-mtune=neoverse-n1 -mbranch-protection=standard -fasynchronous-unwind-tables 
-fstack-clash-protection -fwrapv -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for CFLAGS to compile embedded Perl... 
checking for flags to link embedded Perl...  -Wl,-z,relro -Wl,--as-needed 
-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1  
-fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl 
-lpthread -lresolv -ldl -lm -lcrypt -lutil -lc

HEAD reports the same "CFLAGS recommended by Perl" but is much more
selective about what it actually adopts:

checking for CFLAGS recommended by Perl... -D_REENTRANT -D_GNU_SOURCE -O2 
-ftree-vectorize -flto=auto -ffat-lto-objects -fexceptions -g 
-grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -march=armv8.2-a+crypto 
-mtune=neoverse-n1 -mbranch-protection=standard -fasynchronous-unwind-tables 
-fstack-clash-protection -fwrapv -fno-strict-aliasing -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for CFLAGS to compile embedded Perl... 
checking for flags to link embedded Perl...   -L/usr/lib64/perl5/CORE -lperl 
-lpthread -lresolv -ldl -lm -lcrypt -lutil -lc

So it would appear that the link failure is down to those -specs
switches that we uncritically adopted.  The change in our behavior
was presumably at

commit b4e936859dc441102eb0b6fb7a104f3948c90490
Author: Peter Eisentraut <pe...@eisentraut.org>
Date:   Tue Aug 23 16:00:38 2022 +0200

    Remove further unwanted linker flags from perl_embed_ldflags
    
    Remove the contents of $Config{ldflags} from ExtUtils::Embed's ldopts,
    like we already do with $Config{ccdlflags}.  Those flags are the
    choices of those who built the Perl installation, which are not
    necessarily appropriate for building PostgreSQL.  What we really want
    from ldopts are the options identifying the location and name of the
    libperl library, but unfortunately it doesn't appear possible to get
    that separately from the other stuff.
    
    The motivation for this was to strip -mmacosx-version-min options.  We
    already did something similar for the -arch option.  Both of those are
    now covered by this more general approach.

This went into v16 and was not back-patched, which is probably wise
because there was at least one followup fix (1c3aa5450) and we still
didn't entirely understand what was happening in the Cygwin build [1].
So I'm hesitant to consider back-patching it just because your
experimental gcc isn't working.  At the very least we ought to find
out why it worked up till three weeks ago.

                        regards, tom lane

[1] 
https://www.postgresql.org/message-id/flat/8c4fcb72-2574-ff7c-4c25-1f032d4a2a57%40enterprisedb.com


Reply via email to