From: pierce at hogranch.com (John R Pierce) Date: Thu, 15 Apr 2010 18:05:04 -0700 Subject: [Pljava-dev] building pljava for solaris 10 sparc 64bit In-Reply-To: References: <4BC78D22.7020809@hogranch.com> <4BC79676.8050007@hogranch.com> <4BC7A0FA.4050600@hogranch.com> Message-ID: <4BC7B7C0.40008@hogranch.com> Kris Jurka wrote: > > > On Thu, 15 Apr 2010, John R Pierce wrote: > >> org.postgresql.util.PSQLException: ERROR: could not load library >> "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation >> error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: >> referenced symbol not found > > Your hacking of the 32 bit build files is incomplete/incorrect, so > you've built a pljava that is incompatible with your server. I'm not > entirely sure what you've done, but you don't have the right setting > for FLOAT8PASSBYVAL in src/include/pg_config.h in the source tree. > I'm not sure where you've got that installed. thats a big clue, thanks, I'll dive in and see what I can make of that... k, the three files I copied from the 32bit to the 64bit pgxs/src dir in the postgres dir were Makefile.global, Makefile.port and Makefile.shlib only Makefile.global -seemed- to have anything in it that referenced wordsize kinda stuff. I changed the libdir and bindir paths. I replaced configure_arguments with the output of pg_config # Saved arguments from configure configure_args = = '--prefix=/usr/postgres/8.4-community' '--exec-prefix=/usr/postgres/8.4-community' '--bindir=/usr/postgres/8.4-community/bin/64' '--libexecdir=/usr/postgres/8.4-community/bin/64' '--sbindir=/usr/postgres/8.4-community/bin/64' '--datadir=/usr/postgres/8.4-community/share' '--sysconfdir=/usr/postgres/8.4-community/etc' '--mandir=/usr/postgres/8.4-community/man' '--libdir=/usr/postgres/8.4-community/lib/64' '--includedir=/usr/postgres/8.4-community/include' '--sharedstatedir=/var/postgres/8.4-community' '--localstatedir=/var/postgres/8.4-community' '--with-system-tzdata=/usr/share/lib/zoneinfo' '--enable-nls' '--with-docdir=/usr/postgres/8.4-community/doc' '--with-python' '--with-pam' '--with-openssl' '--with-libedit-preferred' '--with-libxml' '--with-libxslt' '--with-gssapi' '--enable-thread-safety' '--enable-dtrace' 'DTRACEFLAGS=-64' '--with-includes=/zstore/pgsql/pg84b1/proto/root_sparc/usr/include:/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/include:/usr/sfw/include' '--with-tclconfig=/usr/sfw/lib' '--with-libs=/zstore/pgsql/pg84b1/proto/root_sparc/usr/lib/64:/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/lib/64:/usr/lib/64:/usr/sfw/lib/64' 'CC=/opt/SUNWspro/bin/cc' 'CFLAGS=-xO3 -xarch=v9 -dalign -Wc,-Qiselect-regsym=0 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff ' 'LDFLAGS=-L/zstore/pgsql/pg84b1/proto/root_sparc/usr/lib/64 -L/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/lib/64 -L/usr/sfw/lib/64' 'CPPFLAGS=-I/zstore/pgsql/pg84b1/proto/root_sparc/usr/include -I/zstore/pgsql/pg84b1/proto/root_sparc/usr/sfw/include -I/usr/sfw/include' and, the CFLAGS stuff... CC = /opt/SUNWspro/bin/cc -Xa GCC = SUN_STUDIO_CC = yes CFLAGS = -xO3 -xarch=v9 -dalign -Wc,-Qiselect-regsym=0 -xspace -W0,-Lt -W2,-Rcond_elim -Xa -xildoff and... and... . oh $$$$, (expletive deleted). LDFLAGS ! I forgot/missed LDFLAGS... k, so fixing -those- up to match the pg_config output... k, gmake clean && gmake ..... builds clean. cp the .so and .jar's to my deployment directory... and. darnit, same error. :-/ k, digging deeper. one thing I noted, getting a fair number of line 47: warning: initialization type mismatch from various C sources. I assume these are normal ? for laughs, I tried running the install.sql via psql rather than the java deploy script, its getting the same error... $ psql -f ./src/sql/install.sql CREATE SCHEMA GRANT psql:./src/sql/install.sql:6: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found psql:./src/sql/install.sql:8: ERROR: function sqlj.java_call_handler() does not exist psql:./src/sql/install.sql:12: ERROR: could not load library "/opt/FIS/pljava/pljava.so": ld.so.1: postgres: fatal: relocation error: file /opt/FIS/pljava/pljava.so: symbol Int64GetDatum: referenced symbol not found psql:./src/sql/install.sql:14: ERROR: function sqlj.javau_call_handler() does not exist ......(bunch of table creates ignored).... I also have added these to the postgresql.conf file, per the Readme.html deployment instructions, I don't know if this is redundant or what. dynamic_library_path = '$libdir:/opt/FIS/pljava' custom_variable_classes = 'pljava' pljava.classpath = '/opt/FIS/pljava/pljava.jar'