antirez/redis — Issue #134: 32-bit Redis won't make install on 64-bit RHEL 6
Author: WheresWardy
Created: 2011-10-11 10:01:09+00:00
State: open

I was having an issue where `ld` was complaining that it's input object files (which were 32-bit due to `make 32bit`) weren't compatible with the linker as it was expecting 64-bit object files (as this is a 64-bit server). Came down to the `-m32` not being passed to the linker during `make install` by the Makefile, which was solved when I added it to the `CCLINK` options, but presumably a prettier architecture-independent solution is needed.

Error was as follows:

[root@niggle1 src]# make install
MAKE hiredis
cd ../deps/hiredis && make static ARCH=""
make[1]: Entering directory `/root/redis-2.2.14/deps/hiredis'
make[1]: Nothing to be done for `static'.
make[1]: Leaving directory `/root/redis-2.2.14/deps/hiredis'
MAKE linenoise
cd ../deps/linenoise && make ARCH=""
make[1]: Entering directory `/root/redis-2.2.14/deps/linenoise'
make[1]: `linenoise_example' is up to date.
make[1]: Leaving directory `/root/redis-2.2.14/deps/linenoise'
MAKE hiredis
cd ../deps/hiredis && make static ARCH=""
make[1]: Entering directory `/root/redis-2.2.14/deps/hiredis'
make[1]: Nothing to be done for `static'.
make[1]: Leaving directory `/root/redis-2.2.14/deps/hiredis'
LINK redis-benchmark
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: i386 architecture of input file `ae.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `anet.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `redis-benchmark.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `sds.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `adlist.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `zmalloc.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `../deps/hiredis/libhiredis.a(hiredis.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `../deps/hiredis/libhiredis.a(net.o)' is incompatible with i386:x86-64 output
make: *** [redis-benchmark] Error 1

I also tried various versions of make install, like make 32bit install and make install 32bit but they all produced the same error (presumably because the Makefile isn't trying to influence the input to the linker at all).