PostgreSQL 10beta1 / OpenBSD : compilation failed with libxml

Started by Pierre-Emmanuel Andréalmost 9 years ago3 messageshackers
Jump to latest
#1Pierre-Emmanuel André
postgresql@raveland.org

Hi,

I still have an issue with OpenBSD -current and PostgreSQL 10beta1.
I tried to build it with these options: --with-openssl=/usr --with-perl --with-pam=no --with-uuid=bsd --enable-integer-datetimes --with-system-tzdata=/usr/share/zoneinfo --with-openssl --disable-thread-safety --with-libxml

And I have this error:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 command.o common.o conditional.o copy.o crosstabview.o describe.o help.o input.o large_obj.o mainloop.o prompt.o psqlscanslash.o sql_help.o startup.o stringutils.o tab-complete.o variables.o -L../../../src/common -lpgcommon -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port -L../../../src/common -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/local/lib -Wl,-Bdynamic -Wl,-R'/usr/local/pgsql/lib' -L../../../src/fe_utils -lpgfeutils -lpq -lpgcommon -lpgport -lxml2 -lssl -lcrypto -lz -lreadline -ltermcap -lm -o psql
command.o: In function `exec_command_set':
command.c:(.text+0x4e9a): warning: warning: strcat() is almost always misused, please use strlcat()
describe.o: In function `listTSParsers':
describe.c:(.text+0x4e06): warning: warning: sprintf() is often misused, please use snprintf()
large_obj.o: In function `do_lo_import':
large_obj.c:(.text+0x637): warning: warning: strcpy() is almost always misused, please use strlcpy()
common.o: In function `psql_get_variable':
common.c:(.text+0x114c): undefined reference to `appendShellStringNoError'
mainloop.o: In function `MainLoop':
mainloop.c:(.text+0xcd): undefined reference to `psql_scan_set_passthrough'
startup.o: In function `main':
startup.c:(.text+0x1b01): undefined reference to `psql_scan_set_passthrough'
collect2: ld returned 1 exit status
gmake[3]: *** [Makefile:34: psql] Error 1

When i remove --libxml everything runs fine.
Any ideas ?

Regards,

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pierre-Emmanuel André (#1)
Re: PostgreSQL 10beta1 / OpenBSD : compilation failed with libxml

Pierre-Emmanuel =?iso-8859-15?Q?Andr=E9?= <postgresql@raveland.org> writes:

I still have an issue with OpenBSD -current and PostgreSQL 10beta1.

common.o: In function `psql_get_variable':
common.c:(.text+0x114c): undefined reference to `appendShellStringNoError'
mainloop.o: In function `MainLoop':
mainloop.c:(.text+0xcd): undefined reference to `psql_scan_set_passthrough'
startup.o: In function `main':
startup.c:(.text+0x1b01): undefined reference to `psql_scan_set_passthrough'
collect2: ld returned 1 exit status

It looks like you are somehow linking to a pre-v10 version of
libpgfeutils.a. Maybe that is installed in /usr/local/lib or someplace?

When i remove --libxml everything runs fine.

That's odd. I think --with-libxml changes the set of -L directives,
which could be a mechanism to explain that, but it's sure not clear
why libxml would be bringing libpgfeutils along with it.

Note to hackers: seems like we'd better arrange for
-L../../../src/fe_utils to appear earlier in psql's link command
than it now does. I think we thought we could get away with being
sloppy because we weren't planning on libpgfeutils getting installed
anywhere ... but that idea seems to have gone by the wayside.

regards, tom lane

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

#3Pierre-Emmanuel André
postgresql@raveland.org
In reply to: Tom Lane (#2)
Re: PostgreSQL 10beta1 / OpenBSD : compilation failed with libxml

On Mon, May 22, 2017 at 10:36:41AM -0400, Tom Lane wrote:

Pierre-Emmanuel =?iso-8859-15?Q?Andr=E9?= <postgresql@raveland.org> writes:

I still have an issue with OpenBSD -current and PostgreSQL 10beta1.

common.o: In function `psql_get_variable':
common.c:(.text+0x114c): undefined reference to `appendShellStringNoError'
mainloop.o: In function `MainLoop':
mainloop.c:(.text+0xcd): undefined reference to `psql_scan_set_passthrough'
startup.o: In function `main':
startup.c:(.text+0x1b01): undefined reference to `psql_scan_set_passthrough'
collect2: ld returned 1 exit status

It looks like you are somehow linking to a pre-v10 version of
libpgfeutils.a. Maybe that is installed in /usr/local/lib or someplace?

When i remove --libxml everything runs fine.

That's odd. I think --with-libxml changes the set of -L directives,
which could be a mechanism to explain that, but it's sure not clear
why libxml would be bringing libpgfeutils along with it.

Note to hackers: seems like we'd better arrange for
-L../../../src/fe_utils to appear earlier in psql's link command
than it now does. I think we thought we could get away with being
sloppy because we weren't planning on libpgfeutils getting installed
anywhere ... but that idea seems to have gone by the wayside.

Hi Tom,

You're right. My build environnement was fucked up (2 versions of PostgreSQL).
I cleaned up and now everything runs fine:

# select version() ;
version
-----------------------------------------------------------------------------------------------
PostgreSQL 10beta1 on x86_64-unknown-openbsd6.1, compiled by cc (GCC) 4.2.1 20070719 , 64-bit

(But it seems that libxml changes the order of -L directives)

Sorry for the noise.

Regards,

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