pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Symbol referencing errors
10+ messages / 6 participants
[nested] [flat]

Commits from this thread:
  2022-08-25 3fb0687d32  solaris: Use versioning scripts instead of -Bsymbolic
* Symbol referencing errors
@ 2019-04-23 03:56 Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 10+ messages in thread

From: Li Japin @ 2019-04-23 03:56 UTC (permalink / raw)
  To: pgsql-hackers

Hi,

When I compile PostgreSQL-11.2 on SmartOS, I find the following errors:

Undefined            first referenced
  symbol                  in file
per_MultiFuncCall                   adminpack.o
end_MultiFuncCall                   adminpack.o
BuildTupleFromCStrings              adminpack.o
DecodeDateTime                      adminpack.o
TupleDescGetAttInMetadata           adminpack.o
path_is_prefix_of_path              adminpack.o
canonicalize_path                   adminpack.o
text_to_cstring                     adminpack.o
errmsg                              adminpack.o
superuser                           adminpack.o
errcode_for_file_access             adminpack.o
palloc                              adminpack.o
CurrentMemoryContext                adminpack.o
pstrdup                             adminpack.o
ReadDir                             adminpack.o
FreeFile                            adminpack.o
errfinish                           adminpack.o
init_MultiFuncCall                  adminpack.o
errstart                            adminpack.o
AllocateDir                         adminpack.o
GetUserId                           adminpack.o
is_member_of_role                   adminpack.o
psprintf                            adminpack.o
DataDir                             adminpack.o
Log_filename                        adminpack.o
Log_directory                       adminpack.o
AllocateFile                        adminpack.o
path_is_relative_and_below_cwd      adminpack.o
HeapTupleHeaderGetDatum             adminpack.o
errcode                             adminpack.o
FreeDir                             adminpack.o
ParseDateTime                       adminpack.o
path_contains_parent_reference      adminpack.o
pg_detoast_datum_packed             adminpack.o
CreateTemplateTupleDesc             adminpack.o
TupleDescInitEntry                  adminpack.o
ld: warning: symbol referencing errors
make[1]: Leaving directory 
'/home/postgres/postgresql-11.2/contrib/adminpack'


My environment is:

# cat /etc/release
                                 SmartOS x86_64
               Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
                    Copyright 2015 Joyent, Inc.  All Rights Reserved.
                         Use is subject to license terms.
                    See joyent_20161108T160947Z for assembly date and time.
# $ pg_config
BINDIR = /home/postgres/pg11.2/bin
DOCDIR = /home/postgres/pg11.2/share/doc
HTMLDIR = /home/postgres/pg11.2/share/doc
INCLUDEDIR = /home/postgres/pg11.2/include
PKGINCLUDEDIR = /home/postgres/pg11.2/include
INCLUDEDIR-SERVER = /home/postgres/pg11.2/include/server
LIBDIR = /home/postgres/pg11.2/lib
PKGLIBDIR = /home/postgres/pg11.2/lib
LOCALEDIR = /home/postgres/pg11.2/share/locale
MANDIR = /home/postgres/pg11.2/share/man
SHAREDIR = /home/postgres/pg11.2/share
SYSCONFDIR = /home/postgres/pg11.2/etc
PGXS = /home/postgres/pg11.2/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/home/postgres/pg11.2' 'CFLAGS=-g -O0'
CC = gcc
CPPFLAGS =
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute 
-Wformat-security -fno-strict-aliasing -fwrapv 
-fexcess-precision=standard -g -O0
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-R'/home/postgres/pg11.2/lib'
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lnsl -lsocket -lm
VERSION = PostgreSQL 11.2

Can anyone help me out? Thanks!

Best regards!

Japin Li


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
@ 2019-04-23 04:09 ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 04:26   ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 05:23   ` Re: Symbol referencing errors Andrew Gierth <andrew@tao11.riddles.org.uk>
  0 siblings, 2 replies; 10+ messages in thread

From: Tom Lane @ 2019-04-23 04:09 UTC (permalink / raw)
  To: Li Japin <japinli@hotmail.com>; +Cc: pgsql-hackers

Li Japin <japinli@hotmail.com> writes:
> When I compile PostgreSQL-11.2 on SmartOS, I find the following errors:
> ...
> ld: warning: symbol referencing errors

Yeah, our SmartOS buildfarm members show those warnings too, eg

https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=damselfly&dt=2019-04-22%2010%3A00%...

AFAICT they're harmless, so my advice is just ignore them.

If you're sufficiently annoyed by them to find the cause
and try to fix it, go ahead, but I haven't heard anyone
else worried about it.  It might be that SmartOS wants
something like what we have to do on macOS and AIX,
ie provide the core postgres executable in some sort of
linker switch while linking shlibs that will be loaded
by that executable.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-23 04:26   ` Li Japin <japinli@hotmail.com>
  2019-04-23 07:09     ` Re: Symbol referencing errors Laurenz Albe <laurenz.albe@cybertec.at>
  1 sibling, 1 reply; 10+ messages in thread

From: Li Japin @ 2019-04-23 04:26 UTC (permalink / raw)
  To: tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers



On 4/23/19 12:09 PM, Tom Lane wrote:
> AFAICT they're harmless, so my advice is just ignore them.
>
> If you're sufficiently annoyed by them to find the cause
> and try to fix it, go ahead, but I haven't heard anyone
> else worried about it.  It might be that SmartOS wants
> something like what we have to do on macOS and AIX,
> ie provide the core postgres executable in some sort of
> linker switch while linking shlibs that will be loaded
> by that executable.
Yes, those errors does not impact the postgresql, but when
I use oracle_fdw extension, I couldn't startup the postgresql,
and I find that the dlopen throw an error which lead postmaster
exit, and there is not more information.


regards,

Japin Li



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 04:26   ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
@ 2019-04-23 07:09     ` Laurenz Albe <laurenz.albe@cybertec.at>
  2019-04-23 17:23       ` Re: Symbol referencing errors Alvaro Herrera <alvherre@2ndquadrant.com>
  2019-04-24 07:33       ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
  0 siblings, 2 replies; 10+ messages in thread

From: Laurenz Albe @ 2019-04-23 07:09 UTC (permalink / raw)
  To: Li Japin <japinli@hotmail.com>; tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers

On Tue, 2019-04-23 at 04:26 +0000, Li Japin wrote:
> Yes, those errors does not impact the postgresql, but when
> I use oracle_fdw extension, I couldn't startup the postgresql,
> and I find that the dlopen throw an error which lead postmaster
> exit, and there is not more information.

That may wall be a bug in oracle_fdw, since I have no reports of
anybody running it on that operating system.

Maybe you should open an oracle_fdw issue, but I don't know how
much I can help you, since this is the first time I have heard
of SmartOS.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 04:26   ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 07:09     ` Re: Symbol referencing errors Laurenz Albe <laurenz.albe@cybertec.at>
@ 2019-04-23 17:23       ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2019-04-23 17:27         ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 10+ messages in thread

From: Alvaro Herrera @ 2019-04-23 17:23 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Li Japin <japinli@hotmail.com>; tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>; pgsql-hackers

On 2019-Apr-23, Laurenz Albe wrote:

> Maybe you should open an oracle_fdw issue, but I don't know how
> much I can help you, since this is the first time I have heard
> of SmartOS.

SmartOS is just the continuation of OpenSolaris, AFAIU.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 04:26   ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 07:09     ` Re: Symbol referencing errors Laurenz Albe <laurenz.albe@cybertec.at>
  2019-04-23 17:23       ` Re: Symbol referencing errors Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2019-04-23 17:27         ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 10+ messages in thread

From: Tom Lane @ 2019-04-23 17:27 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Li Japin <japinli@hotmail.com>; pgsql-hackers

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Apr-23, Laurenz Albe wrote:
>> Maybe you should open an oracle_fdw issue, but I don't know how
>> much I can help you, since this is the first time I have heard
>> of SmartOS.

> SmartOS is just the continuation of OpenSolaris, AFAIU.

Yeah.  You can see these same link warnings on castoroides and
protosciurus, though they're no longer building HEAD for
lack of C99-compliant system headers.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 04:26   ` Re: Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 07:09     ` Re: Symbol referencing errors Laurenz Albe <laurenz.albe@cybertec.at>
@ 2019-04-24 07:33       ` Li Japin <japinli@hotmail.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Li Japin @ 2019-04-24 07:33 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; tgl@sss.pgh.pa.us <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers

Hi,

Finally, I find this crash is caused by shmget_osm, which does not support SmartOS (maybe,
I am not sure). When I install Oracle Instant Client 12.2.0.1.0, it works.

https://github.com/laurenz/oracle_fdw/issues/313


On 4/23/19 3:09 PM, Laurenz Albe wrote:

On Tue, 2019-04-23 at 04:26 +0000, Li Japin wrote:


Yes, those errors does not impact the postgresql, but when
I use oracle_fdw extension, I couldn't startup the postgresql,
and I find that the dlopen throw an error which lead postmaster
exit, and there is not more information.


That may wall be a bug in oracle_fdw, since I have no reports of
anybody running it on that operating system.

Maybe you should open an oracle_fdw issue, but I don't know how
much I can help you, since this is the first time I have heard
of SmartOS.



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-04-23 05:23   ` Andrew Gierth <andrew@tao11.riddles.org.uk>
  2022-08-23 08:34     ` Re: Symbol referencing errors Andres Freund <andres@anarazel.de>
  1 sibling, 1 reply; 10+ messages in thread

From: Andrew Gierth @ 2019-04-23 05:23 UTC (permalink / raw)
  To: Li Japin <japinli@hotmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> When I compile PostgreSQL-11.2 on SmartOS, I find the following errors:
 >> ...
 >> ld: warning: symbol referencing errors

 Tom> Yeah, our SmartOS buildfarm members show those warnings too, eg

 Tom> https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=damselfly&dt=2019-04-22%2010%3A00%...

 Tom> AFAICT they're harmless, so my advice is just ignore them.

 Tom> If you're sufficiently annoyed by them to find the cause
 Tom> and try to fix it, go ahead, but I haven't heard anyone
 Tom> else worried about it.  It might be that SmartOS wants
 Tom> something like what we have to do on macOS and AIX,
 Tom> ie provide the core postgres executable in some sort of
 Tom> linker switch while linking shlibs that will be loaded
 Tom> by that executable.

I wonder if it's the use of -Bsymbolic that causes this (buildfarm logs
don't seem to go back far enough to check). (Note to original poster:
-Bsymbolic is there for a reason, you can't just remove it - but see
below.)

Since this is an ELF platform - arguably the closest thing to the
original reference ELF platform, at least by descent - it should not
require the kinds of tricks used on macOS and AIX; but we haven't done
the work needed to test using version scripts in place of -Bsymbolic for
fixing the symbol conflict problems. That ought to be a relatively
straightforward project for someone with access to a system to test on
(and I'm happy to advise on it).

The thing to do would be to try and copy the changes made to the *BSD
ports in commit e3d77ea6b instead of the change made in 4fa3741d1. The
contrib/postgres_fdw tests should show whether it worked or not.

-- 
Andrew (irc:RhodiumToad)





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 05:23   ` Re: Symbol referencing errors Andrew Gierth <andrew@tao11.riddles.org.uk>
@ 2022-08-23 08:34     ` Andres Freund <andres@anarazel.de>
  2022-08-24 02:04       ` Re: Symbol referencing errors Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 10+ messages in thread

From: Andres Freund @ 2022-08-23 08:34 UTC (permalink / raw)
  To: Andrew Gierth <andrew@tao11.riddles.org.uk>; +Cc: Li Japin <japinli@hotmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers

Hi,

On 2019-04-23 06:23:13 +0100, Andrew Gierth wrote:
> I wonder if it's the use of -Bsymbolic that causes this (buildfarm logs
> don't seem to go back far enough to check). (Note to original poster:
> -Bsymbolic is there for a reason, you can't just remove it - but see
> below.)

For the record, yes, the "ld: warning: symbol referencing errors" warnings are
due to -Bsymbolic while linking extensions. The man page says:
"The link-editor issues warnings for undefined symbols  unless -z defs overrides"


> Since this is an ELF platform - arguably the closest thing to the
> original reference ELF platform, at least by descent - it should not
> require the kinds of tricks used on macOS and AIX; but we haven't done
> the work needed to test using version scripts in place of -Bsymbolic for
> fixing the symbol conflict problems. That ought to be a relatively
> straightforward project for someone with access to a system to test on
> (and I'm happy to advise on it).

It's indeed trivial - the only change needed from linux is to replace
-Wl,--version-script=... with -Wl,-M...

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Symbol referencing errors
  2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
  2019-04-23 04:09 ` Re: Symbol referencing errors Tom Lane <tgl@sss.pgh.pa.us>
  2019-04-23 05:23   ` Re: Symbol referencing errors Andrew Gierth <andrew@tao11.riddles.org.uk>
  2022-08-23 08:34     ` Re: Symbol referencing errors Andres Freund <andres@anarazel.de>
@ 2022-08-24 02:04       ` Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 10+ messages in thread

From: Andres Freund @ 2022-08-24 02:04 UTC (permalink / raw)
  To: Andrew Gierth <andrew@tao11.riddles.org.uk>; +Cc: Li Japin <japinli@hotmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers

Hi,

On 2022-08-23 01:34:36 -0700, Andres Freund wrote:
> On 2019-04-23 06:23:13 +0100, Andrew Gierth wrote:
> > I wonder if it's the use of -Bsymbolic that causes this (buildfarm logs
> > don't seem to go back far enough to check). (Note to original poster:
> > -Bsymbolic is there for a reason, you can't just remove it - but see
> > below.)
> 
> For the record, yes, the "ld: warning: symbol referencing errors" warnings are
> due to -Bsymbolic while linking extensions. The man page says:
> "The link-editor issues warnings for undefined symbols  unless -z defs overrides"
> 
> 
> > Since this is an ELF platform - arguably the closest thing to the
> > original reference ELF platform, at least by descent - it should not
> > require the kinds of tricks used on macOS and AIX; but we haven't done
> > the work needed to test using version scripts in place of -Bsymbolic for
> > fixing the symbol conflict problems. That ought to be a relatively
> > straightforward project for someone with access to a system to test on
> > (and I'm happy to advise on it).
> 
> It's indeed trivial - the only change needed from linux is to replace
> -Wl,--version-script=... with -Wl,-M...

Patch attached. Passed check-world (without tap tests, didn't install the perl
mods) on solaris.  Does anybody see a reason not to apply? Even just having
less noisy build logs seem like an advantage.

Greetings,

Andres Freund

Attachments:

v1-0001-solaris-Use-versioning-scripts-instead-of-Bsymbol.patch (text/x-diff, 1.2K) download From 176c8c31a74e01d3005cc7df6bae5fcd951b2f0c Mon Sep 17 00:00:00 2001 From: Andres Freund <andres@anarazel.de> Date: Tue, 23 Aug 2022 01:50:29 -0700 Subject: [PATCH v1] solaris: Use versioning scripts instead of -Bsymbolic -Bsymbolic causes a lot of "ld: warning: symbol referencing errors" warnings. It's quite easy to add the symbol versioning script, we just need a slightly different parameter name. Discussion: https://postgr.es/m/20220823083436.whtntk3bn3qpnvmb@awork3.anarazel.de --- src/Makefile.shlib | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 2af6192f0f3..3202b2e67de 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -188,10 +188,15 @@ ifeq ($(PORTNAME), linux) endif ifeq ($(PORTNAME), solaris) - LINK.shared = $(COMPILER) -shared -Wl,-Bsymbolic + LINK.shared = $(COMPILER) -shared ifdef soname LINK.shared += -Wl,-soname,$(soname) endif + BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@ + exports_file = $(SHLIB_EXPORTS:%.txt=%.list) + ifneq (,$(exports_file)) + LINK.shared += -Wl,-M$(exports_file) + endif endif ifeq ($(PORTNAME), cygwin) -- 2.37.0.3.g30cc8d0f14
^ permalink raw reply [nested|flat] 10+ messages in thread


end of thread, other threads:[~2022-08-24 02:04 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 03:56 Symbol referencing errors Li Japin <japinli@hotmail.com>
2019-04-23 04:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-04-23 04:26   ` Li Japin <japinli@hotmail.com>
2019-04-23 07:09     ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-04-23 17:23       ` Alvaro Herrera <alvherre@2ndquadrant.com>
2019-04-23 17:27         ` Tom Lane <tgl@sss.pgh.pa.us>
2019-04-24 07:33       ` Li Japin <japinli@hotmail.com>
2019-04-23 05:23   ` Andrew Gierth <andrew@tao11.riddles.org.uk>
2022-08-23 08:34     ` Andres Freund <andres@anarazel.de>
2022-08-24 02:04       ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox