Re: [PORTS] Compiling PostgreSQL 8.1.5 with 64-bit on a G5 SOLVED

Tom Lane <[email protected]> Mon, 27 Nov 2006 21:46:10 -0500
Newsgroups gmane.comp.db.postgresql.ports
Message-ID <[email protected]>
Brian Wipf <[email protected]> writes:
> On 27-Nov-06, at 6:39 PM, Tom Lane wrote:
>> Try "make clean; make all" in src/test/regress and watch the make output
>> to see exactly how refint.so is getting built.  I suspect your 64-bit
>> CFLAGS are not getting propagated there for some reason.

> make -C ../../../contrib/spi refint.so autoinc.so
> gcc -no-cpp-precomp -O2 -Wall -Wmissing-prototypes -Wpointer-arith - 
> Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict- 
> aliasing -arch ppc64 -Wall -Wmissing-prototypes -Wpointer-arith - 
> Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict- 
> aliasing  -DREFINT_VERBOSE -I. -I../../src/include   -c -o refint.o  
> refint.c
> gcc -no-cpp-precomp -bundle -o refint.so refint.o - 
> bundle_loader ../../src/backend/postgres

Hm, well the -arch flag is getting to the gcc -c step OK, but I wonder
whether it is needed in the gcc -bundle (ie, link) step as well?

Please try this patch and see if it makes it better.  Also, please check
how file(1) describes refint.so now, and whether it changes after
re-making with the patch.  I get
	refint.so: Mach-O bundle ppc
on a regular PPC Mac, and I bet you need it to say "ppc64".

Index: Makefile.darwin
===================================================================
RCS file: /cvsroot/pgsql/src/makefiles/Makefile.darwin,v
retrieving revision 1.9
diff -c -r1.9 Makefile.darwin
*** Makefile.darwin     19 Jan 2006 21:19:12 -0000      1.9
--- Makefile.darwin     28 Nov 2006 02:41:21 -0000
***************
*** 13,18 ****
  # Rule for building shared libs (currently used only for regression test
  # shlib ... should go away, since this is not really enough knowledge)
  %.so: %.o
!	$(CC) -bundle -o $@ $< $(BE_DLLLIBS)
  
  sqlmansect = 7
--- 13,18 ----
  # Rule for building shared libs (currently used only for regression test
  # shlib ... should go away, since this is not really enough knowledge)
  %.so: %.o
!	$(CC) $(CFLAGS) -bundle -o $@ $< $(BE_DLLLIBS)
  
  sqlmansect = 7


			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings