Re: Missing plpgsql.o Symbols on OS X

Lists: pgsql-hackers
From: David E(dot) Wheeler <david(at)justatheory(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Missing plpgsql.o Symbols on OS X
Date: 2014-08-27 15:59:03
Message-ID: C185ED93-3648-42F0-AA48-5E9D8672AE1A@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hackers,

I’m trying to build Pavel’s plpgsql_check against the 9.4 beta on OS X 10.9, but get these errors:

make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/pgsql/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -bundle -multiply_defined suppress -o plpgsql_check.so plpgsql_check.o -L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/local/lib -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres
Undefined symbols for architecture x86_64:
"_exec_get_datum_type", referenced from:
_check_target in plpgsql_check.o
"_plpgsql_build_datatype", referenced from:
_check_stmt in plpgsql_check.o
"_plpgsql_compile", referenced from:
_check_plpgsql_function in plpgsql_check.o
"_plpgsql_parser_setup", referenced from:
_prepare_expr in plpgsql_check.o
"_plpgsql_stmt_typename", referenced from:
_put_error in plpgsql_check.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [plpgsql_check.so] Error 1

Which is odd, because plpgsql_check.c includes plpgsql.h, and those symbols do appear to be in plpgsql.so:

$ nm /usr/local/pgsql/lib/plpgsql.so | grep _exec_get_datum_type
000000000000f110 T _exec_get_datum_type
000000000000f380 T _exec_get_datum_type_info

So, uh, what gives? Do I need to something extra to get it to properly find plpgsql.so?

Thanks,

David


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Missing plpgsql.o Symbols on OS X
Date: 2014-08-27 23:20:40
Message-ID: 8180.1409181640@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"David E. Wheeler" <david(at)justatheory(dot)com> writes:
> Hackers,
> Im trying to build Pavels plpgsql_check against the 9.4 beta on OS X 10.9, but get these errors:

> make
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -I/usr/local/pgsql/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -bundle -multiply_defined suppress -o plpgsql_check.so plpgsql_check.o -L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/local/lib -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres
> Undefined symbols for architecture x86_64:
> "_exec_get_datum_type", referenced from:
> _check_target in plpgsql_check.o
> "_plpgsql_build_datatype", referenced from:
> _check_stmt in plpgsql_check.o
> "_plpgsql_compile", referenced from:
> _check_plpgsql_function in plpgsql_check.o
> "_plpgsql_parser_setup", referenced from:
> _prepare_expr in plpgsql_check.o
> "_plpgsql_stmt_typename", referenced from:
> _put_error in plpgsql_check.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [plpgsql_check.so] Error 1

> Which is odd, because plpgsql_check.c includes plpgsql.h, and those symbols do appear to be in plpgsql.so:

> $ nm /usr/local/pgsql/lib/plpgsql.so | grep _exec_get_datum_type
> 000000000000f110 T _exec_get_datum_type
> 000000000000f380 T _exec_get_datum_type_info

Yeah, but plpgsql.so is mentioned nowhere on your command line.

I'm not too sure about the dynamic-linking rules on OS X, but I'd not be
surprised if you need to provide a reference to plpgsql.so in its final
installed location (ie, a reference to it in the build tree may appear to
link and then fail at runtime).

regards, tom lane


From: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Missing plpgsql.o Symbols on OS X
Date: 2014-08-28 04:53:45
Message-ID: CAG7mmozvknL_hjjpm1QNPHFP-rmuV_B-5j=ST0Z9J0voWm8_TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Please add -arch x86_64 to your LD_FLAGS and CFLAGS in your make file.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company
<http://www.enterprisedb.com>

*http://www.linkedin.com/in/asheshvashi*
<http://www.linkedin.com/in/asheshvashi>

On Wed, Aug 27, 2014 at 9:29 PM, David E. Wheeler <david(at)justatheory(dot)com>
wrote:

> Hackers,
>
> I’m trying to build Pavel’s plpgsql_check against the 9.4 beta on OS X
> 10.9, but get these errors:
>
> make
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
> -Wformat-security -fno-strict-aliasing -fwrapv
> -I/usr/local/pgsql/lib/pgxs/src/makefiles/../../src/pl/plpgsql/src -bundle
> -multiply_defined suppress -o plpgsql_check.so plpgsql_check.o
> -L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/local/lib
> -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres
> Undefined symbols for architecture x86_64:
> "_exec_get_datum_type", referenced from:
> _check_target in plpgsql_check.o
> "_plpgsql_build_datatype", referenced from:
> _check_stmt in plpgsql_check.o
> "_plpgsql_compile", referenced from:
> _check_plpgsql_function in plpgsql_check.o
> "_plpgsql_parser_setup", referenced from:
> _prepare_expr in plpgsql_check.o
> "_plpgsql_stmt_typename", referenced from:
> _put_error in plpgsql_check.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make: *** [plpgsql_check.so] Error 1
>
> Which is odd, because plpgsql_check.c includes plpgsql.h, and those
> symbols do appear to be in plpgsql.so:
>
> $ nm /usr/local/pgsql/lib/plpgsql.so | grep _exec_get_datum_type
> 000000000000f110 T _exec_get_datum_type
> 000000000000f380 T _exec_get_datum_type_info
>
> So, uh, what gives? Do I need to something extra to get it to properly
> find plpgsql.so?
>
> Thanks,
>
> David
>
>


From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Missing plpgsql.o Symbols on OS X
Date: 2014-08-28 17:54:52
Message-ID: EFCE93CE-9770-42E2-9364-0C4DE7F4988B@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Aug 27, 2014, at 9:53 PM, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:

> Please add -arch x86_64 to your LD_FLAGS and CFLAGS in your make file.

This made no difference:

LDFLAGS = -arch x86_64
CFLAGS = -arch x86_64

Best,

David


From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Missing plpgsql.o Symbols on OS X
Date: 2014-08-28 17:56:21
Message-ID: E29677E0-0F98-4A24-B748-7D6A4956BFAF@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Aug 27, 2014, at 4:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Yeah, but plpgsql.so is mentioned nowhere on your command line.
>
> I'm not too sure about the dynamic-linking rules on OS X, but I'd not be
> surprised if you need to provide a reference to plpgsql.so in its final
> installed location (ie, a reference to it in the build tree may appear to
> link and then fail at runtime).

Ah. Is there a recommended way to do that in a PGXS-powered Makefile?

Thanks,

David