Re: Compile errors when building 32-bit on 64-bit system

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

 




That sounds like you hadn't yet figured out to set CFLAGS too.
Google or no Google, you're setting the wrong variable.

I had to install PG 8.3.7 on another couple of machines today, and got exactly the same issue (setting all 3 variables) again on the SPI module. Please see as follows:

Configure line: CFLAGS="-m32" LD="ld -melf_i386" LDFLAGS="-m32" ./configure .... etc ....

"make" fails with the error:

gcc -shared -o refint.so refint.o
/usr/bin/ld: warning: i386 architecture of input file `refint.o' is incompatible with i386:x86-64 output
refint.o: In function `check_primary_key':
refint.c:(.text+0x8f): undefined reference to `elog_start'
refint.c:(.text+0xa5): undefined reference to `elog_finish'
... etc ...

Running the following commands manually allows the install to continue - notice how I have to add "-m32" to the second gcc command:

# cd 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 -I/opt/nmail32/libxml2/include/libxml2 -I/opt/nmail32/libxml2/include/libxml2 -I/opt/nmail32/zlib/include -I/opt/nmail32/readline/include -I/opt/nmail32/openssl/include -I/opt/nmail32/ncurses/include -c -o refint.o refint.c
# gcc -m32 -shared -o refint.so refint.o

And the same for "autoinc.o":

# 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 -I/opt/nmail32/libxml2/include/libxml2 -I/opt/nmail32/libxml2/include/libxml2 -I/opt/nmail32/zlib/include -I/opt/nmail32/readline/include -I/opt/nmail32/openssl/include -I/opt/nmail32/ncurses/include -c -o autoinc.o autoinc.c
# gcc -m32 -shared -o autoinc.so autoinc.o

# make
........
All of PostgreSQL successfully made. Ready to install.

So it appears the SPI module is respecting CFLAGS, but ignoring LDFLAGS.

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux