compiling for 64 bit processor

Emilie Ann Phillips emilie at alumni.cmu.edu
Tue Jul 25 11:25:29 UTC 2006


I had been having issues with my usb printer. I tracked the problem
down to this message in /var/log/messages
    ioctl32(hald-probe-prin:6453): Unknown cmd fd(4) cmd(44005001){04}
arg(ff991528) on /dev/usblp0

This is cause by a 32 bit process (hald-probe-printer) making a call
into a 64 bit kernel that does not support 32 to 64 bit conversion for
that ioctl.

We think the solution is to recompile the hald utilities as 64 bit.
Attempting to re-install hal from source using dpkg resulted in 32 bit
utilities.

We then attempted to build a 64 bit hello world using
   make CFLAGS=-m64 hello
This failed on attempting to link to libgcc_s as it could not be
found. We installed lib64gccl and libc6-pcc64. The linker was unable
to find the 64 bit libc. There was no libc.so symlink to the 64 bit
libc. We then added /lib64 to /etc/ld.so.conf and ran ldconfig. This
did not help. I manually made a symlink in /lib64 and added a -L/lib64
to the make command.

The compile failed with these errors:
emilie at montcervin:~/test-m64$ make CFLAGS="-L/lib64 -m64" hello
cc -L/lib64 -m64    hello.c   -o hello
/usr/bin/ld: warning: powerpc:common architecture of input file
`/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crt1.o' is incompatible
with powerpc:common64 output
/usr/bin/ld: warning: powerpc:common architecture of input file
`/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crti.o' is incompatible
with powerpc:common64 output
/usr/bin/ld: warning: powerpc:common architecture of input file
`/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crtn.o' is incompatible
with powerpc:common64 output
/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crt1.o: In function
`_start':../sysdeps/powerpc/powerpc32/elf/start.S:86: relocation
truncated to fit: R_PPC_REL24 against `__libc_start_main'
/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crti.o: In function
`call_gmon_start':/build/buildd/glibc-2.3.6/build-tree/powerpc-libc/csu/crti.S:16:
undefined reference to `_GLOBAL_OFFSET_TABLE_'
/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crt1.o:(.rodata+0x0):
undefined reference to `_SDA_BASE_'
/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crt1.o:(.rodata+0x8):
undefined reference to `__libc_csu_init'
/usr/lib/gcc/powerpc-linux-gnu/4.0.3/../../../crt1.o:(.rodata+0xc):
undefined reference to `__libc_csu_fini'
collect2: ld returned 1 exit status
make: *** [hello] Error 1

Firstly, is there a better way to get the usb printer to work?
Secondly, how is one supposed to compile 64 bit utilities?

Note, I am running kubuntu 6.06 on a mac G5.

Thanks,
Emilie




More information about the ubuntu-users mailing list