Re: PostgreSQL 9.5 Alpha 1 build fail with perl 5.22 - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: PostgreSQL 9.5 Alpha 1 build fail with perl 5.22
Date
Msg-id 55A3DAF3.7080700@dunslane.net
Whole thread Raw
In response to Re: PostgreSQL 9.5 Alpha 1 build fail with perl 5.22  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PostgreSQL 9.5 Alpha 1 build fail with perl 5.22
List pgsql-hackers
On 07/12/2015 05:06 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>>> On 07/04/2015 11:02 AM, Tom Lane wrote:
>>>> It's not apparent to me how that works at all.
>> BTW, the .a files being linked to above are not like Unix .a static
>> archives - they are import library files, which I think they are only
>> used at link time, not run time. The path to the DLLs isn't being hardcoded.
> Ah, I see.  So then what Marco is suggesting is copying a coding pattern
> that does work.
>
>> Unless there is further argument I propose to commit something very like
>> Marco's suggestion for hstore_plperl, hstore_plpython and ltree_plpython
> No objection here.
>
>

OK, I tried the attached patch.

but when trying to build with python 3 I get this (no such problems with
python2, which builds and tests fine):

    make -C hstore_plpython all
    make[1]: Entering directory
    '/home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython'
    ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
    -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g -O2 -I../../src/pl/plpython
    -I/usr/include/python3.4m -I../../contrib/hstore -I. -I.
    -I../../src/include -I/usr/include/libxml2   -c -o hstore_plpython.o
    hstore_plpython.c
    ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
    -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g -O2   -shared -o
    hstore_plpython3.dll  hstore_plpython.o  -L../../src/port
    -L../../src/common -Wl,--allow-multiple-definition
    -Wl,--enable-auto-import -L/usr/lib  -L/usr/local/lib
    -Wl,--as-needed   -L../../src/backend -lpostgres -L../hstore
    -lhstore -L../../src/pl/plpython -lplpython3
    -L/usr/lib/python3.4/config-3.4m -lpython3.4m -lpgcommon -lpgport
    -lxslt -lxml2 -lssl -lcrypto -lz -lreadline -lcrypt
    hstore_plpython.o: In function `hstore_to_plpython':
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:35:
    undefined reference to `PLyUnicode_FromStringAndSize'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:35:(.text+0x99):
    relocation truncated to fit: R_X86_64_PC32 against undefined symbol
    `PLyUnicode_FromStringAndSize'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:28:
    undefined reference to `PLyUnicode_FromStringAndSize'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:28:(.text+0xf1):
    relocation truncated to fit: R_X86_64_PC32 against undefined symbol
    `PLyUnicode_FromStringAndSize'
    hstore_plpython.o: In function `plpython_to_hstore':
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:96:
    undefined reference to `PLyObject_AsString'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:96:(.text+0x2cc):
    relocation truncated to fit: R_X86_64_PC32 against undefined symbol
    `PLyObject_AsString'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:84:
    undefined reference to `PLyObject_AsString'
    /home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython/hstore_plpython.c:84:(.text+0x321):
    relocation truncated to fit: R_X86_64_PC32 against undefined symbol
    `PLyObject_AsString'
    collect2: error: ld returned 1 exit status
    ../../src/Makefile.shlib:358: recipe for target
    'hstore_plpython3.dll' failed
    make[1]: *** [hstore_plpython3.dll] Error 1
    make[1]: Leaving directory
    '/home/andrew/bf64/root/HEAD/pgsql/contrib/hstore_plpython'
    Makefile:92: recipe for target 'all-hstore_plpython-recurse' failed
    make: *** [all-hstore_plpython-recurse] Error 2

I'd like to get that fixed before applying anything. Marco, any ideas?

To build with python 3, set the environment like this:
PYTHON=/usr/bin/python3 - this can be done in the config file.


cheers

andrew


Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: dead assignment src/bin/scripts/print.c line 421
Next
From: Marco Atzeri
Date:
Subject: Re: PostgreSQL 9.5 Alpha 1 build fail with perl 5.22