Bug 251375 - Compile 64-Bit PostgreSQL Installation using biarch support on RHEL4 AS
Compile 64-Bit PostgreSQL Installation using biarch support on RHEL4 AS
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: binutils (Show other bugs)
4.4
ppc64 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-08 13:10 EDT by Bernd Helmle
Modified: 2007-11-16 20:14 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-10 08:21:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernd Helmle 2007-08-08 13:10:09 EDT
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...
Comment 1 Jakub Jelinek 2007-08-10 08:21:31 EDT
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.
Comment 2 Bernd Helmle 2007-08-10 09:47:43 EDT
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

Note You need to log in before you can comment on or make changes to this bug.