Build system problem in 8.3.x - Mailing list pgsql-hackers

From Boszormenyi Zoltan
Subject Build system problem in 8.3.x
Date
Msg-id 4A965325.8080606@cybertec.at
Whole thread Raw
Responses Re: Build system problem in 8.3.x  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Build system problem in 8.3.x  (Bernd Helmle <mailings@oopsware.de>)
List pgsql-hackers
Hi,

we have come across a problem in 8.3.x (8.3.5 and 8.3.7 was tested)
while building PostgreSQL for 32-bit on 64-bit RHEL5 and Fedora 9.

The following defines were used before running configure:

export CFLAGS="-m32"
export LD="ld -melf_i386"

The above are needed because when SUBSYS.o files are created,
the $(LD) ... lines don't contain $(LDFLAGS) anywhere, so overriding
$(LD) on the command line has to be done instead.

However, there's one additional problem that can be solved by the
attached one liner. The problem is that during building the core,
something (test/regress) requires contrib/spi/refint.so to be built.
The error follows:

make -C ../../../contrib/spi refint.so autoinc.so
make[3]: Entering directory
`/home/zozo/Schönig-számlák/lucent/postgresql-8.3.5/contrib/spi'
gcc -m32 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement
-Wendif-labels -fno-strict-aliasing -fwrapv -fpic -DREFINT_VERBOSE -I.
-I../../src/include
-D_GNU_SOURCE   -c -o refint.o refint.c
gcc -shared -o refint.so refint.o
/usr/bin/ld: i386 architecture of input file `refint.o' is incompatible
with i386:x86-64 output

I tried building contrib manually, but it turned out that the same
error happens whenever contrib/*/Makefile contains MODULES
instead of MODULE_big.

I modified Makefile.port in the attached patch, and now
all the contrib files also build correctly.

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

*** src/Makefile.port.old    2009-08-27 10:56:46.000000000 +0200
--- src/Makefile.port    2009-08-27 10:56:46.000000000 +0200
***************
*** 11,16 ****
  endif

  %.so: %.o
!     $(CC) -shared -o $@ $<

  sqlmansect = 7
--- 11,16 ----
  endif

  %.so: %.o
!     $(CC) $(CFLAGS) -shared -o $@ $<

  sqlmansect = 7

pgsql-hackers by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: MySQL Compatibility WAS: 8.5 release timetable, again
Next
From: Paul Matthews
Date:
Subject: Patches for static check on geo_ops.c