Re: [RFC] building postgres with meson - perl embedding

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [RFC] building postgres with meson - perl embedding
Дата
Msg-id 1120094.1644284529@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [RFC] building postgres with meson - perl embedding  (Andres Freund <andres@anarazel.de>)
Ответы Re: [RFC] building postgres with meson - perl embedding  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [RFC] building postgres with meson - perl embedding  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> What is the reason behind subtracting ccdlflags?

It looks like the coding actually originated here:

commit f5d0c6cad5bb2706e0e63f3f8f32e431ea428100
Author: Bruce Momjian <bruce@momjian.us>
Date:   Wed Jun 20 00:26:06 2001 +0000

    Apparently, on some systems, ExtUtils::Embed and MakeMaker are slightly
    broken, and its impossible to make a shared library when compiling with
    both CCDLFLAGS and LDDLFAGS, you have to pick one or the other.

    Alex Pilosov

and Peter just copied the logic in 7662419f1.  Considering that
the point of 7662419f1 was to get rid of MakeMaker, maybe we no
longer needed that at that point.

On my RHEL box, the output of ldopts is sufficiently redundant
that the subtraction doesn't actually accomplish much:

$ perl -MExtUtils::Embed -e ldopts
-Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,relro -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld-fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl
-lpthread-lresolv -ldl -lm -lcrypt -lutil -lc 

$ perl -MConfig -e 'print $Config{ccdlflags}'
-Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld

which leads to

$ grep perl_embed_ldflags src/Makefile.global
perl_embed_ldflags      =  -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-fstack-protector-strong-L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm -lcrypt -lutil -lc 

so the only thing we actually got rid of was -Wl,--enable-new-dtags,
which I think we'll put back anyway.

Things might be different elsewhere of course, but I'm tempted
to take out the ccdlflags subtraction and see what the buildfarm
says.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [RFC] building postgres with meson - autogenerated headers
Следующее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: 2022-02-10 release announcement draft