On Dec 3, 2009, at 10:54 AM, Tom Lane wrote:

Israel Brewster <isr...@frontierflying.com> 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.

So it WAS just me being dense. Figures :P Your explanation makes perfect sense now, thanks. Although in my defense, everything that I read up till now implied that the compile should work, it would just be the generated binaries that wouldn't (how else do you interpret that quite I included?). However with your explanation, it makes sense why the compile would fail. Again, my apologies.

So what it boils down to, if I now understand you correctly, is that (since you obviously can only have one set of headers per build) the only way to make this work is pretty much exactly what I ended up doing: build for each architecture separately (even if on the same machine) and then lipo the results together. I can live with that.

Then the reason this is necessary on Postgres, and not with other software I have dealt with is that Postgres has 64 bit specific code, while the others don't? I know my code doesn't. Or maybe I was just doing 32 bit builds of the others, and so never ran into this sort of thing. Hmm. Oh well, it works. My profuse thanks for the explanations and bearing with me.

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.

Or perhaps the 10.6 compiler has better error checking than the 10.5? That would explain why the build would succeed on 10.5 (but give unusable binaries for other platforms) but die on 10.6.

That doesn't change the fact that it'd fail at runtime whether
the compiler could detect a problem or not.

Well, the libraries I created in the past from the 8.2 code work just fine on both PPC 32 bit and Intel 64 bit. But then, that was 8.2. The code probably changed between 8.2 and 8.4 though :-D. Thanks again!


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

                        regards, tom lane

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------

BEGIN:VCARD
VERSION:3.0
N:Brewster;Israel;;;
FN:Israel Brewster
ORG:Frontier Flying Service;MIS
TITLE:PC Support Tech II
EMAIL;type=INTERNET;type=WORK;type=pref:isr...@frontierflying.com
TEL;type=WORK;type=pref:907-450-7293
item1.ADR;type=WORK;type=pref:;;5245 Airport Industrial Wy;Fairbanks;AK;99701;
item1.X-ABADR:us
CATEGORIES:General
X-ABUID:36305438-95EA-4410-91AB-45D16CABCDDC\:ABPerson
END:VCARD


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

Reply via email to