Search Postgresql Archives

Re: Build universal binary on Mac OS X 10.6?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Israel Brewster <israel@xxxxxxxxxxxxxxxxxx> writes:
> 1) From the second paragraph of that post:
>> If you add something like "-arch i386 -arch ppc" to CFLAGS and build  
>> normally, you get real working multiarch binaries and libraries.
> Which is exactly the problem that started this whole thread - on 10.6,  
> you DON'T (or at least I don't) get "real working multiarch binaries  
> and libraries". In fact, you don't get anything - the compile fails.  
> Already we see that this post does not address my issue in any form,  

The reason it's failing is that you continue to ignore the important
point: you need arch-specific header files.

I tried this on current sources and found that the failure occurs in
code like this:

#if SIZEOF_DATUM == 8
...
        switch (attlen) \
        { \
            case sizeof(char): \
                ...
            case sizeof(int16): \
                ...
            case sizeof(int32): \
                ...
            case sizeof(Datum): \
                ...
...
#else                            /* SIZEOF_DATUM != 8 */

Since I configured on a 64-bit Mac, the generated header file
sets SIZEOF_DATUM to 8.  When this code is fed to the 32-bit
compiler, it thinks sizeof(Datum) is 4, so it spits up on the
duplicated case values.  Had it been fed the correct header file for
a 32-bit machine, it would have gone to the other part of the #if
(which doesn't have the intended-to-be-for-8-bytes case branch).

I don't really recall whether I hit this in the experiment I did
last year.  It's possible, maybe even likely, that the code was
different then and happened not to have any compiler-visible
inconsistencies when the header was wrong for the target arch.
That doesn't change the fact that it'd fail at runtime whether
the compiler could detect a problem or not.

There's really no way around building the correct header files
if you want a usable multiarch library.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux