Re: [GENERAL] Can't Build 7.3.4 on OS X

From: Marko Karppinen <karppinen(at)pobox(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Can't Build 7.3.4 on OS X
Date: 2003-09-23 16:51:53
Message-ID: 3C150879-EDE6-11D7-B9FE-000A958D89B8@pobox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-hackers

On 23.9.2003, at 19:01, Tom Lane wrote:
> 1. Doesn't this break backward compatibility with Darwin 1.0-1.2?
> (If so, does anyone care anymore?)

No. The two-level namespace feature was added in 10.1, and the
-flat_namespace hack was included in pgsql to unbreak the compile
on 10.1 and later. This change hence doesn't have any effect on
10.0 / Darwin 1.x -- except for gcc warnings about unknown flags.

The other change we discussed, ie. using -no-cpp-precomp instead
of -traditional-cpp, will break Darwin 1.x support.

> 2. Why is the postgres executable added to LINK.shared? Doesn't this
> break building shlibs that are not intended to be linked into the
> backend (eg libpq)?

When linking a shared object, the Darwin linker wants to know that all
the symbols are accounted for -- it doesn't allow undefined symbols.
The bundle_loader flag gives the linker a hint: these symbols will be
provided by the application that loads us, so you don't need raise
an error about them being undefined.

In other words, the -bundle_loader /path/to/postgresql doesn't affect
the build results at all. In the case where there are no undefined
symbols
(like in libpq), the flag is ignored.

> 3. What's with the WITHOUT_DARWIN_BUNDLE_LOADER hack for ecpg?

The linker doesn't like symbols that are defined both in the shared
object
that's being linked and the bundle_loader binary. ecpg contains symbols
that are in the postgresql binary, too, leading to the link failing with
multiply-defined errors.

The easiest way for me to fix this -- I don't really know my way around
the
source base -- was to specify by hand that the -bundle-loader flag isn't
used on these occasions. Perhaps a more prudent way would be to
examine which shared objects actually have undefined symbols and
use the bundle-loader flag only when linking them, but I think it'd lead
to much more maintenance and bloated Makefiles.

cheers
mk

> Marko Karppinen <karppinen(at)pobox(dot)com> writes:
>> While we're on a Mac-related note, I managed to compile PostgreSQL on
>> Mac OS X 10.2 Jaguar with two-level namespace support.
>> <http://developer.apple.com/documentation/ReleaseNotes/DeveloperTools/
>> TwoLevelNamespaces.html> This is quite useful, so I hope you can look
>> into incorporating the changes.
>
>> http://www.markokarppinen.com/pg-two-level-namespace.diff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-09-23 17:28:48 Re: [GENERAL] Can't Build 7.3.4 on OS X
Previous Message Tom Lane 2003-09-23 16:01:14 Re: [GENERAL] Can't Build 7.3.4 on OS X

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2003-09-23 16:54:47 Re: About GPL and proprietary software
Previous Message Andrew Ayers 2003-09-23 16:43:28 Re: About GPL and proprietary software

Browse pgsql-hackers by date

  From Date Subject
Next Message scott.marlowe 2003-09-23 16:53:36 Re: postgres 6.2 vacuum
Previous Message Irina Sourikova 2003-09-23 16:47:16 bug in vacuumlo?