Re: configure fails for perl check on CentOS8

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: andrew(dot)dunstan(at)2ndquadrant(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: configure fails for perl check on CentOS8
Date: 2019-10-17 03:39:33
Message-ID: 20191017.123933.2034577068577275172.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

# I'm almost comming back..

At Wed, 16 Oct 2019 10:41:19 -0400, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> wrote in
> On Wed, Oct 16, 2019 at 8:32 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > >> $ ./configure --with-perl CFLAGS=-O0
> > >> It is bash-aliased and survived without being found for a long time on
> > >> my Cent7 environment, but CentOS8 doesn't allow that.
> >
> > I don't quite understand why that wouldn't work.

I'm confused with make CFLAGS=..

> It looks like you need CFLAGS='-O0 -fPIC' on CentOS 8 when building with perl.

Yes, that is what my first mail said. I dug into it further.

The immediately problematic command generated by autoconf is:

gcc -o /tmp/conftest -Wall -Wmissing-prototypes -Wpointer-arith \
-Wdeclaration-after-statement -Werror=vla -Wendif-labels \
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing \
-fwrapv -fexcess-precision=standard -Wno-format-truncation \
-Wno-stringop-truncation \
-O0 \
-D_GNU_SOURCE -I/usr/lib64/perl5/CORE \
/tmp/conftest.c \
-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

/usr/bin/ld: /tmp/ccGxodNv.o: relocation R_X86_64_32 against symbol `PL_memory_wrap' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

Very interestingly I don't get the error when the "-O0" is "-O2". It
is because gcc eliminates the PL_memory_wrap maybe by inlining.

The *final* problematic command boils down to:

gcc -o /tmp/conftest /tmp/conftest_O0.o \
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lperl

That is, the problem doesn't happen without
"-specs=/usr/lib/rpm/redhat/redhat-hardened-ld".

I found the following bug report but it hasn't ever been fixed since
2016 on Fedora 24. I'm not sure about the newer versions.

https://bugzilla.redhat.com/show_bug.cgi?id=1343892

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-10-17 03:45:13 Re: Questions/Observations related to Gist vacuum
Previous Message Amit Kapila 2019-10-17 03:31:43 Re: Questions/Observations related to Gist vacuum