AIX compilation problems (was Re: Proposal ...)

Started by Zeugswetter Andreas SB SDover 23 years ago10 messages
#1Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
1 attachment(s)

and mb conversions (pg_ascii2mic and pg_mic2ascii not
found in the postmaster and not included from elsewhere)

shared libs on AIX need to be able to resolve all symbols at linkage time.
Those two symbols are in backend/utils/SUBSYS.o but not in the postgres
executable.

They are defined in backend/utils/mb/conv.c and declared in
include/mb/pg_wchar.h. They're also linked into the
postmaster. I don't see anything unusual.

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Please apply to current (only affects AIX).

The _LARGE_FILES problem is unfortunately still open, unless Peter
has fixed it per his recent idea.

Thanx
Andreas

Attachments:

mb_link_patch4.gzapplication/x-gzip; name=mb_link_patch4.gzDownload
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Zeugswetter Andreas SB SD (#1)
Re: AIX compilation problems (was Re: Proposal ...)

Zeugswetter Andreas SB SD writes:

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

--
Peter Eisentraut peter_e@gmx.net

#3Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Peter Eisentraut (#2)
Re: AIX compilation problems (was Re: Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading the man page,
but the method was previously not good since it involved the following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to the end of the link line,
then the linker knows not to throw a duplicate symbol warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the duplicate symbol warnings since their
link line should actually not include postgres.imp . I did not see how to make a difference
between loadable modules (need postgres.imp) and interface libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

I tested both gcc and xlc including regression tests.

Andreas

#4Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Zeugswetter Andreas SB SD (#3)
1 attachment(s)
Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading
the man page,
but the method was previously not good since it involved the
following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to
the end of the link line,
then the linker knows not to throw a duplicate symbol
warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted
to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the
duplicate symbol warnings since their
link line should actually not include postgres.imp . I did
not see how to make a difference
between loadable modules (need postgres.imp) and interface
libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

Note that this behavior did thus not change.

I tested both gcc and xlc including regression tests.

What happens with this now ?

Thanx
Andreas

Attachments:

mb_link_patch4.gzapplication/x-gzip; name=mb_link_patch4.gzDownload
#5Samuel A Horwitz
horwitz@argoscomp.com
In reply to: Zeugswetter Andreas SB SD (#3)
Re: AIX compilation problems (was Re: Proposal ...)

has this patched been applied to the CVS yet?

On Tue, 1 Oct 2002, Zeugswetter
Andreas SB SD wrote:

Date: Tue, 1 Oct 2002 10:23:13 +0200
From: Zeugswetter Andreas SB SD <ZeugswetterA@spardat.at>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading the man page,
but the method was previously not good since it involved the following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to the end of the link line,
then the linker knows not to throw a duplicate symbol warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the duplicate symbol warnings since their
link line should actually not include postgres.imp . I did not see how to make a difference
between loadable modules (need postgres.imp) and interface libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

I tested both gcc and xlc including regression tests.

Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

horwitz@argoscomp.com (Samuel A Horwitz)

#6Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Samuel A Horwitz (#5)
Re: AIX compilation problems (was Re: Proposal ...)

Samuel A Horwitz wrote:

has this patched been applied to the CVS yet?

No, I was waiting to see if there were any negative comments, but seeing
none, I will add it to the patch queue today.

---------------------------------------------------------------------------

On Tue, 1 Oct 2002, Zeugswetter
Andreas SB SD wrote:

Date: Tue, 1 Oct 2002 10:23:13 +0200
From: Zeugswetter Andreas SB SD <ZeugswetterA@spardat.at>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading the man page,
but the method was previously not good since it involved the following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to the end of the link line,
then the linker knows not to throw a duplicate symbol warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the duplicate symbol warnings since their
link line should actually not include postgres.imp . I did not see how to make a difference
between loadable modules (need postgres.imp) and interface libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

I tested both gcc and xlc including regression tests.

Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

horwitz@argoscomp.com (Samuel A Horwitz)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Zeugswetter Andreas SB SD (#1)
Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Zeugswetter Andreas SB SD wrote:

and mb conversions (pg_ascii2mic and pg_mic2ascii not
found in the postmaster and not included from elsewhere)

shared libs on AIX need to be able to resolve all symbols at linkage time.
Those two symbols are in backend/utils/SUBSYS.o but not in the postgres
executable.

They are defined in backend/utils/mb/conv.c and declared in
include/mb/pg_wchar.h. They're also linked into the
postmaster. I don't see anything unusual.

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Please apply to current (only affects AIX).

The _LARGE_FILES problem is unfortunately still open, unless Peter
has fixed it per his recent idea.

Thanx
Andreas

Content-Description: mb_link_patch4.gz

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#8Samuel A Horwitz
horwitz@argoscomp.com
In reply to: Zeugswetter Andreas SB SD (#3)
Re: AIX compilation problems (was Re: Proposal ...)

Has this fix been applied to the cvs yet, I am still getting the same
error

On Tue, 1 Oct 2002, Zeugswetter Andreas SB SD wrote:

Date: Tue, 1 Oct 2002 10:23:13 +0200
From: Zeugswetter Andreas SB SD <ZeugswetterA@spardat.at>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading the man page,
but the method was previously not good since it involved the following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to the end of the link line,
then the linker knows not to throw a duplicate symbol warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the duplicate symbol warnings since their
link line should actually not include postgres.imp . I did not see how to make a difference
between loadable modules (need postgres.imp) and interface libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

I tested both gcc and xlc including regression tests.

Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

horwitz@argoscomp.com (Samuel A Horwitz)

#9Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Samuel A Horwitz (#8)
Re: AIX compilation problems (was Re: Proposal ...)

Still in queue. I will apply today.

---------------------------------------------------------------------------

Samuel A Horwitz wrote:

Has this fix been applied to the cvs yet, I am still getting the same
error

On Tue, 1 Oct 2002, Zeugswetter Andreas SB SD wrote:

Date: Tue, 1 Oct 2002 10:23:13 +0200
From: Zeugswetter Andreas SB SD <ZeugswetterA@spardat.at>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Can you explain the method behind your patch? Have you tried -bnogc?

-bnogc would (probably) have been the correct switch reading the man page,
but the method was previously not good since it involved the following:

1. create a static postgres executable from the SUBSYS.o's
2. create an exports file from above
3. recreate a shared postgres executable

This naturally had a cyclic dependency, that could not properly be
reflected in the Makefile (thus a second make sometimes left you with
a static postgres unless you manually removed postgres.imp).

Now it does:
postgres.imp: $(OBJS)
create a temporary SUBSYS.o from all $(OBJS)
create a postgres.imp from SUBSYS.o
rm temporary SUBSYS.o

postgres: postgres.imp
link a shared postgres

A second change was to move the import and export files to the end of the link line,
then the linker knows not to throw a duplicate symbol warning, and keeps all symbols
that are mentioned in the exports file (== -bnogc restricted to $(OBJS) symbols).

Thus now only libpq.so and libecpg.so still show the duplicate symbol warnings since their
link line should actually not include postgres.imp . I did not see how to make a difference
between loadable modules (need postgres.imp) and interface libraries (do not need postgres.imp),
but since the resulting libs are ok, I left it at that.

I tested both gcc and xlc including regression tests.

Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

horwitz@argoscomp.com (Samuel A Horwitz)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#10Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Zeugswetter Andreas SB SD (#1)
Re: AIX compilation problems (was Re: [HACKERS] Proposal ...)

Patch applied. Thanks.

---------------------------------------------------------------------------

Zeugswetter Andreas SB SD wrote:

and mb conversions (pg_ascii2mic and pg_mic2ascii not
found in the postmaster and not included from elsewhere)

shared libs on AIX need to be able to resolve all symbols at linkage time.
Those two symbols are in backend/utils/SUBSYS.o but not in the postgres
executable.

They are defined in backend/utils/mb/conv.c and declared in
include/mb/pg_wchar.h. They're also linked into the
postmaster. I don't see anything unusual.

Attached is a patch to fix the mb linking problems on AIX. As a nice side effect
it reduces the duplicate symbol warnings to linking libpq.so and libecpg.so
(all shlibs that are not postmaster loadable modules).

Please apply to current (only affects AIX).

The _LARGE_FILES problem is unfortunately still open, unless Peter
has fixed it per his recent idea.

Thanx
Andreas

Content-Description: mb_link_patch4.gz

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073