Bug 251375 - Compile 64-Bit PostgreSQL Installation using biarch support on RHEL4 AS
Summary: Compile 64-Bit PostgreSQL Installation using biarch support on RHEL4 AS
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: binutils
Version: 4.4
Hardware: ppc64
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-08 17:10 UTC by Bernd Helmle
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-10 12:21:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bernd Helmle 2007-08-08 17:10:09 UTC
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 12:21:31 UTC
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 13:47:43 UTC
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.