Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
On Sun, 21 May 2006 16:35:24 -0700 (PDT) gede wawan [EMAIL PROTECTED] wrote: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC May I ask how? I have tried to edit src/makefiles/Makefile.linux and changed -fpic to -fPIC, but it does not help. Maybe I should set the flag elsewhere? Actually, I have made some tests. I found that in the PostgreSQL document, Perl must be built as shared library: 14.2. Requirements To build the server programming language PL/Perl you need a full Perl installation, including the libperl library and the header files. Since PL/Perl will be a shared library, the libperl library must be a shared library also on most platforms. This appears to be the default in recent Perl versions, but it was not in earlier versions, and in any case it is the choice of whomever installed Perl at your site. But, on my i386 machine, I can build PL/Perl with static library (libperl.a). But I can't do that on x86_64 anymore. Can somebody tell me why, or where should I referring to? The same issue goes to PL/Python. I'm not good at Python, but I know that I was building static library before, and it works for PL/Python on i386. But it does not work anymore on x86_64, too. -- Best regards, imacat ^_*' [EMAIL PROTECTED] PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt Woman's Voice News: http://www.wov.idv.tw/ Tavern IMACAT's: http://www.imacat.idv.tw/ TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug pgpCS9MDZ9afj.pgp Description: PGP signature
Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
imacat wrote: But, on my i386 machine, I can build PL/Perl with static library (libperl.a). But I can't do that on x86_64 anymore. Can somebody tell me why, or where should I referring to? Why do you want to do this? It works perfectly well with a shared lib, and is probably more memory efficient and faster to load. cheers andrew ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
Andrew Dunstan wrote: imacat wrote: But, on my i386 machine, I can build PL/Perl with static library (libperl.a). But I can't do that on x86_64 anymore. Can somebody tell me why, or where should I referring to? Why do you want to do this? It works perfectly well with a shared lib, and is probably more memory efficient and faster to load. I assume this is for the performance gains that can be seen by loading non-PIC code over PIC code. However, this is not an option on x86_64. Dynamically loaded code must be compiled with PIC on pretty much every platform except 32-bit intel. The bigger puzzle is why you could link against non-PIC code in shared objects on 32-bit x86. (I know the answer, but it has no real merit). If you want things dynamically loadable, they must be PIC. -- // Theo Schlossnagle // Principal Engineer -- http://www.omniti.com/~jesus/ // Ecelerity: Run with it. -- http://www.omniti.com/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
On Mon, 08 May 2006 03:58:54 +0800 imacat [EMAIL PROTECTED] wrote: On Sun, 07 May 2006 13:09:48 -0400 Tom Lane [EMAIL PROTECTED] wrote: imacat [EMAIL PROTECTED] writes: I cannot compile PL/Perl and PL/Python under x86_64. Works fine for me (without any tinkering with flags) on Fedora Core 4. Will... thank you for the hint. I have tested to build with the I have successfully compiled with a shared Perl/Python libraries. Thank you for your hint. But now I have another question. Why can't I link PL/Perl and PL/Python against the static Perl/Python libraries, as I did on 32-bit machines? I have added -fPIC when linking Perl statically, but it still doesn't work. Is ther any reason that it doesn't work to link that way? -- Best regards, imacat ^_*' [EMAIL PROTECTED] PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt Woman's Voice News: http://www.wov.idv.tw/ Tavern IMACAT's: http://www.imacat.idv.tw/ TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug pgpsOCu9TWTjB.pgp Description: PGP signature
Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
imacat [EMAIL PROTECTED] writes: I cannot compile PL/Perl and PL/Python under x86_64. Works fine for me (without any tinkering with flags) on Fedora Core 4. Maybe you don't have 64-bit versions of the perl and python libraries? regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [HACKERS] Compiling PL/Perl and Pl/Python on x86_64
On Sun, 07 May 2006 13:09:48 -0400 Tom Lane [EMAIL PROTECTED] wrote: imacat [EMAIL PROTECTED] writes: I cannot compile PL/Perl and PL/Python under x86_64. Works fine for me (without any tinkering with flags) on Fedora Core 4. Maybe you don't have 64-bit versions of the perl and python libraries? Will... thank you for the hint. I have tested to build with the precompiled binary perl 5.8.4 that comes with the Debian distribution, and it works. It now seems that the problem resides on my perl compilation. I'll go for that direction. -- Best regards, imacat ^_*' [EMAIL PROTECTED] PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt Woman's Voice News: http://www.wov.idv.tw/ Tavern IMACAT's: http://www.imacat.idv.tw/ TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug pgpvnk5Hrg97u.pgp Description: PGP signature