Обсуждение: [GENERAL] PG 10 and perl

Поиск
Список
Период
Сортировка

[GENERAL] PG 10 and perl

От
Andy Colson
Дата:
I'm not subscribed to the -devel list, so hopefully I can post this here.

I'm running slackware 14.2

I have the system perl (5.24) installed, and also perlbrew with perl 5.26 installed.

In PG 9.5 this worked fine, and compiling and running PG used the 5.26 version of perl:
root@firefly:/usr/local/pg95/lib/postgresql# ldd plperl.solibperl.so =>
/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so(0x00007f81e8bde000)
 

I started playing with 10, and cannot get it to use the right version of perl.  I'll only use the system version:
root@firefly:/usr/local/pg10/lib/postgresql# ldd plperl.solibperl.so => /usr/lib64/perl5/CORE/libperl.so
(0x00007fc9c67d4000)

But, here's the thing.  The config.log reports 5.26 version:

configure:7752: checking for perl
configure:7770: found /opt/perl5/perls/perl-5.26/bin/perl
configure:7782: result: /opt/perl5/perls/perl-5.26/bin/perl
configure:7804: using perl 5.26.1
configure:7837: checking for Perl archlibexp
configure:7841: result: /opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi
configure:7843: checking for Perl privlibexp
configure:7847: result: /opt/perl5/perls/perl-5.26/lib/5.26.1
configure:7849: checking for Perl useshrplib
configure:7853: result: true
configure:7862: checking for CFLAGS recommended by Perl
configure:7865: result: -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector
-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
configure:7867: checking for CFLAGS to compile embedded Perl
configure:7870: result:
configure:7874: checking for flags to link embedded Perl
configure:7891: result:   -fstack-protector-strong -L/usr/local/lib  -L/opt/perl5/perls/perl-5.26/lib/5
.26.1/x86_64-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc

<snip>

configure:15976: checking for perl.h
configure:15976: gcc -c -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendi
f-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=s
tandard -O2 -fPIC -DLINUX_OOM_SCORE_ADJ=0  -D_GNU_SOURCE  -I/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_6
4-linux-thread-multi/CORE conftest.c >&5
configure:15976: $? = 0
configure:15976: result: yes
configure:15991: checking for libperl
configure:16007: gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-stateme
nt -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-pr
ecision=standard -O2 -fPIC -DLINUX_OOM_SCORE_ADJ=0  -D_GNU_SOURCE  -I/opt/perl5/perls/perl-5.26/lib/5.2
6.1/x86_64-linux-thread-multi/CORE   conftest.c   -fstack-protector-strong -L/usr/local/lib  -L/opt/per
l5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -l
util -lc >&5
configure:16007: $? = 0
configure:16008: result: yes


<snip>

ac_cv_path_PERL=/opt/perl5/perls/perl-5.26/bin/perl

<snip>
perl_archlibexp='/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi'
perl_embed_ccflags=''
perl_embed_ldflags='  -fstack-protector-strong -L/usr/local/lib  -L/opt/perl5/perls/perl-5.26/lib/5.26.
1/x86_64-linux-thread-multi/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc'
perl_privlibexp='/opt/perl5/perls/perl-5.26/lib/5.26.1'
perl_useshrplib='true'


Thanks for your time,

-Andy


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PG 10 and perl

От
""
Дата:
>Andy Colson wrote:
>In PG 9.5 this worked fine, and compiling and running PG used the 5.26 version of perl:
>root@firefly:/usr/local/pg95/lib/postgresql# ldd plperl.so
>    libperl.so => /opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so
(0x00007f81e8bde000)
>
>I started playing with 10, and cannot get it to use the right version of perl.  I'll only use the system version:
>root@firefly:/usr/local/pg10/lib/postgresql# ldd plperl.so
>    libperl.so => /usr/lib64/perl5/CORE/libperl.so (0x00007fc9c67d4000)
>
>But, here's the thing.  The config.log reports 5.26 version:
>
>configure:7752: checking for perl
>configure:7770: found /opt/perl5/perls/perl-5.26/bin/perl
>configure:7782: result: /opt/perl5/perls/perl-5.26/bin/perl
>configure:7804: using perl 5.26.1
>...


I'm about to go down this path to prepare for 10.0, but I haven't had time yet.

You don't show your configure command, but did you set PERL there as well as have it in your PATH? Here's what I've
donein the past:
 
   ./configure --prefix=/opt/pg-9.5 --with-system-tzdata --with-perl PERL=/opt/perl/bin/perl

and it used our custom Perl just fine. If you did that, I'm not sure what else to say at the moment. I hope to get
aroundto checking out RC1 early next week though and I'll be using 5.26 as well.
 

Hmm, given your report, I'll try to move it up my ToDo list to give myself more time. I'll report back here if I get it
towork and haven't seen a reply by you about you getting it to work also.
 

Kevin


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PG 10 and perl

От
Tom Lane
Дата:
Andy Colson <andy@squeakycode.net> writes:
> I started playing with 10, and cannot get it to use the right version of perl.  I'll only use the system version:
> root@firefly:/usr/local/pg10/lib/postgresql# ldd plperl.so
>     libperl.so => /usr/lib64/perl5/CORE/libperl.so (0x00007fc9c67d4000)

Hm, I don't think we've changed anything about that in v10.

> But, here's the thing.  The config.log reports 5.26 version:

That's good, but what's probably missing is an "rpath" specification when
linking plperl.so.  Did you build with --disable-rpath, perhaps?  That's
the usual recommendation when building for Linux, but if you want to use
any non-default libraries, you can't do it.

Go into src/pl/plperl, remove and remake plperl.so, and see whether the
link command includes anything like
-Wl,-rpath,'/usr/lib64/perl5/CORE',--enable-new-dtags

(That's what I see when building with a stock Linux Perl configuration and
rpath enabled.)  If there's no such switch, or if it doesn't point to
where the libperl.so that you want to use is, then there's your problem.
        regards, tom lane


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PG 10 and perl

От
Andy Colson
Дата:
On 9/29/2017 9:28 AM, kbrannen@pwhome.com wrote:
>> Andy Colson wrote:
>> In PG 9.5 this worked fine, and compiling and running PG used the 5.26 version of perl:
>> root@firefly:/usr/local/pg95/lib/postgresql# ldd plperl.so
>>     libperl.so => /opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so
(0x00007f81e8bde000)
>>
>> I started playing with 10, and cannot get it to use the right version of perl.  I'll only use the system version:
>> root@firefly:/usr/local/pg10/lib/postgresql# ldd plperl.so
>>     libperl.so => /usr/lib64/perl5/CORE/libperl.so (0x00007fc9c67d4000)
>>
>> But, here's the thing.  The config.log reports 5.26 version:
>>
>> configure:7752: checking for perl
>> configure:7770: found /opt/perl5/perls/perl-5.26/bin/perl
>> configure:7782: result: /opt/perl5/perls/perl-5.26/bin/perl
>> configure:7804: using perl 5.26.1
>> ...
> 
> 
> I'm about to go down this path to prepare for 10.0, but I haven't had time yet.
> 
> You don't show your configure command, but did you set PERL there as well as have it in your PATH? Here's what I've
donein the past:
 
> 
>      ./configure --prefix=/opt/pg-9.5 --with-system-tzdata --with-perl PERL=/opt/perl/bin/perl
> 
> and it used our custom Perl just fine. If you did that, I'm not sure what else to say at the moment. I hope to get
aroundto checking out RC1 early next week though and I'll be using 5.26 as well.
 
> 
> Hmm, given your report, I'll try to move it up my ToDo list to give myself more time. I'll report back here if I get
itto work and haven't seen a reply by you about you getting it to work also.
 
> 
> Kevin
> 
> 

I only use --with-perl, that's all I've ever used.  I didnt know you 
could pass PERL=/opt/perl/bin/perl.

-Andy


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] PG 10 and perl

От
Andy Colson
Дата:
On 09/29/2017 09:32 AM, Tom Lane wrote:
> Andy Colson <andy@squeakycode.net> writes:
>> I started playing with 10, and cannot get it to use the right version of perl.  I'll only use the system version:
>> root@firefly:/usr/local/pg10/lib/postgresql# ldd plperl.so
>>     libperl.so => /usr/lib64/perl5/CORE/libperl.so (0x00007fc9c67d4000)
> 
> Hm, I don't think we've changed anything about that in v10.
> 
>> But, here's the thing.  The config.log reports 5.26 version:
> 
> That's good, but what's probably missing is an "rpath" specification when
> linking plperl.so.  Did you build with --disable-rpath, perhaps?  That's
> the usual recommendation when building for Linux, but if you want to use
> any non-default libraries, you can't do it.
> 
> Go into src/pl/plperl, remove and remake plperl.so, and see whether the
> link command includes anything like
> 
>     -Wl,-rpath,'/usr/lib64/perl5/CORE',--enable-new-dtags
> 
> (That's what I see when building with a stock Linux Perl configuration and
> rpath enabled.)  If there's no such switch, or if it doesn't point to
> where the libperl.so that you want to use is, then there's your problem.
> 
>             regards, tom lane
> 

tldr: PG 10 compiles fine and works with perlbrew fine, I confused install paths.

I removed the plperl.so, and typed make:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security-fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -DLINUX_OOM_SCORE_ADJ=0 -fPIC
-shared-o plperl.so plperl.o SPI.o Util.o  -L../../../src/port -L../../../src/common -Wl,--as-needed
-Wl,-rpath,'/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE',--enable-new-dtags
-fstack-protector-strong-L/usr/local/lib  -L/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE -lperl
-lpthread-lnsl -ldl -lm -lcrypt -lutil -lc
 


And in the src dir:
root@firefly:/tmp/SBo/postgresql-10rc1# ldd ./src/pl/plperl/plperl.solibperl.so =>
/opt/perl5/perls/perl-5.26/lib/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so(0x00007f33b9f87000)
 


I had 10beta1 installed to /usr/local/pg10.
The SlackBuild script I'm using installs to /usr/local/pg95 still.  So I was compiling and installing 10rc1 into pg95.

Sorry for the noise (and thanks Tom).

-Andy


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general