64-bit compilation in FC3

Gary Byers gb at clozure.com
Fri Mar 25 16:18:05 UTC 2005


I installed FC-3 on an IBM 7043-260 (a POWER3) a few weeks ago; the
installation went fairly smoothly.  If I remember correctly, I did a
"workstation" install.

I find that compiling (linking) C programs in 64-bit mode doesn't work
(or at least doesn't work as I expect):

shell> cc -m64 hello.c
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/3.4.2/../../../libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/3.4.2/../../../libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

I tried installing the gcc4 RPMs; it seemed able to find libc, but picked
up the wrong versions of some runtime object files:

gcc4 -m64 hello.c
/usr/bin/ld: warning: powerpc:common architecture of input file `/usr/lib/gcc/ppc64-redhat-linux/4.0.0/../../../crt1.o' is incompatible with powerpc:common64 output
/usr/bin/ld: warning: powerpc:common architecture of input file `/usr/lib/gcc/ppc64-redhat-linux/4.0.0/../../../crti.o' is incompatible with powerpc:common64 output
/usr/bin/ld: warning: powerpc:common architecture of input file `/usr/lib/gcc/ppc64-redhat-linux/4.0.0/../../../crtn.o' is incompatible with powerpc:common64 output
/usr/bin/ld: can not size stub section: Bad value
/usr/lib/gcc/ppc64-redhat-linux/4.0.0/../../../crt1.o(.text+0x20): In function `_start':
: relocation truncated to fit: R_PPC_REL24 __libc_start_main
/usr/lib/gcc/ppc64-redhat-linux/4.0.0/../../../crti.o(.text+0x10): In function `call_gmon_start':
: undefined reference to `_GLOBAL_OFFSET_TABLE_'
/usr/bin/ld: /tmp/ccKMVHW4.o(.text+0x18): unresolvable R_PPC64_REL24 relocation against symbol `puts@@GLIBC_2.3'
/tmp/ccKMVHW4.o(.text+0x18): relocation truncated to fit: R_PPC64_REL24 puts@@GLIBC_2.3
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

Which of the following is closest to being accurate:
  a) I'm missing something obvious; I need to say something more than
     just "-m64" here.
  b) linking 64-bit applications doesn't work in FC3
  c) linking 64-bit applications works in FC3, but I need to install a
     few things that a "workstation" install doesn't install
  d) none of the above, the real probem is _____.

The C compilers (both 3.4.2 and 4.0) do seem able to generate ppc64
assembly code, and the assembler seems able to assemble it; the problem
seems to be some combination of bad specs file/missing files/bad gcc
driver.

If the answer is (b) or something like that, are things better in FC4T1 ?

Thanks.

Gary Byers
gb at clozure.com




More information about the ppc mailing list