Description of problem: I'm currently trying to build a vanilla 64-Bit PostgreSQL installation on a RedHat AS4 platform running on an IBM pSeries p570 (Power5) machine: The installed OS is 32-Bit but runs a 64-Bit ppc64 kernel. Building 64-Bit executables on this platform should be possible with the -m64 (as some fast tests proves) compiler switch, however: ./configure --build=ppc64-redhat-linux --enable-integer-datetimes --without-readline --with-gnu-ld CFLAGS="-mpowerpc64 -m64" CC="gcc4" && make gives the following error: make[2]: Entering directory `/home/credativ/postgresql/src/postgresql-8.1.9/src/timezone' /usr/bin/ld -r -o SUBSYS.o localtime.o strftime.o pgtz.o /usr/bin/ld: Relocatable linking with relocations from format elf64-powerpc (localtime.o) to format elf32-powerpc (SUBSYS.o) is not supported My first thought was that the linker accidently wants to create a wrong output format, but trying manually gives me the following: /usr/bin/ld -b elf64-powerpc --oformat elf64-powerpc -r -o SUBSYS.o localtime.o strftime.o pgtz.o /usr/bin/ld: Relocatable linking with relocations from format elf64-powerpc (localtime.o) to format elf64-powerpc (SUBSYS.o) is not supported Version-Release number of selected component (if applicable): uname -ompi ppc64 ppc64 ppc64 GNU/Linux If you need more info, let me know...
You shouldn't be running ld directly, except in very special cases and you need to know all the details how you should invoke ld yourself. In all other cases, gcc driver should be used instead. So in the above case gcc -m64 -r -o SUBSYS.o localtime.o strftime.o pgtz.o That will take care of passing -m elf64ppc among other needed things.
Thanks for your reply Jakub. The PostgreSQL build scripts did choose calling ld directly since i can remember, i cannot believe that this behavior is that wrong. Many platforms out there aren't broken regarding this (even when using biarch build environments) However, trying your suggestion gives: gcc4 -m64 -r -o SUBSYS.o localtime.o strftime.o pgtz.o /usr/bin/ld: cannot find -lgcc_s collect2: ld returned 1 exit status The libgcc_s.so seems to be present on the system, however, gcc4 isn't able to locate them? Maybe missing dependencies, but libgcc is installed. Ah, and using gcc 3.4.6 on this platform gives a slightly different message: /usr/bin/ld: cannot find -lgcc_s_64 collect2: ld returned 1 exit status