incorrect ./src/Makefile CFLAGS="-mbe32" LDFLAGS="-mbe32" on RaspberryPi 4 using 32bit option

root@jack:/opt/redis-6.0.9# uname -a Linux jack 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux

make 32bit BUILD_TLS=yes USE_SYSTEMD=yes fails with error messsage, see error below

root@jack:/opt/redis-6.0.9# make 32bit BUILD_TLS=yes USE_SYSTEMD=yes cd src && make 32bit make[1]: Entering directory '/opt/redis-6.0.9/src'

WARNING: if it fails under Linux you probably need to install libc6-dev-i386

make CFLAGS="-m32" LDFLAGS="-m32" make[2]: Entering directory '/opt/redis-6.0.9/src' rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof .o .gcda .gcno .gcov redis.info lcov-html Makefile.dep dict-benchmark rm -f adlist.d quicklist.d ae.d anet.d dict.d server.d sds.d zmalloc.d lzf_c.d lzf_d.d pqsort.d zipmap.d sha1.d ziplist.d release.d networking.d util.d object.d db.d replication.d rdb.d t_string.d t_list.d t_set.d t_zset.d t_hash.d config.d aof.d pubsub.d multi.d debug.d sort.d intset.d syncio.d cluster.d crc16.d endianconv.d slowlog.d scripting.d bio.d rio.d rand.d memtest.d crcspeed.d crc64.d bitops.d sentinel.d notify.d setproctitle.d blocked.d hyperloglog.d latency.d sparkline.d redis-check-rdb.d redis-check-aof.d geo.d lazyfree.d module.d evict.d expire.d geohash.d geohash_helper.d childinfo.d defrag.d siphash.d rax.d t_stream.d listpack.d localtime.d lolwut.d lolwut5.d lolwut6.d acl.d gopher.d tracking.d connection.d tls.d sha256.d timeout.d setcpuaffinity.d anet.d adlist.d dict.d redis-cli.d zmalloc.d release.d ae.d crcspeed.d crc64.d siphash.d crc16.d ae.d anet.d redis-benchmark.d adlist.d dict.d zmalloc.d siphash.d (cd ../deps && make distclean) make[3]: Entering directory '/opt/redis-6.0.9/deps' (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (rm -f .make-) make[3]: Leaving directory '/opt/redis-6.0.9/deps' (rm -f .make-) echo STD=-std=c11 -pedantic -DREDIS_STATIC= >> .make-settings echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings echo OPT=-O2 >> .make-settings echo MALLOC=libc >> .make-settings echo BUILD_TLS=yes >> .make-settings echo USE_SYSTEMD=yes >> .make-settings echo CFLAGS=-m32 >> .make-settings echo LDFLAGS=-m32 >> .make-settings echo REDIS_CFLAGS= >> .make-settings echo REDIS_LDFLAGS= >> .make-settings echo PREV_FINAL_CFLAGS=-std=c11 -pedantic -DREDIS_STATIC= -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -m32 -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DHAVE_LIBSYSTEMD -DUSE_OPENSSL >> .make-settings echo PREV_FINAL_LDFLAGS=-m32 -g -ggdb -rdynamic >> .make-settings (cd ../deps && make hiredis linenoise lua) make[3]: Entering directory '/opt/redis-6.0.9/deps' (cd hiredis && make clean) > /dev/null || true (cd linenoise && make clean) > /dev/null || true (cd lua && make clean) > /dev/null || true (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true (rm -f .make-*) (echo "-m32" > .make-cflags) (echo "-m32" > .make-ldflags) MAKE hiredis cd hiredis && make static USE_SSL=1 make[4]: Entering directory '/opt/redis-6.0.9/deps/hiredis' cc -std=c99 -pedantic -c -O3 -fPIC -m32 -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb net.c cc: error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’? make[4]: *** [Makefile:201: net.o] Error 1 make[4]: Leaving directory '/opt/redis-6.0.9/deps/hiredis' make[3]: *** [Makefile:50: hiredis] Error 2 make[3]: Leaving directory '/opt/redis-6.0.9/deps' make[2]: [Makefile:283: persist-settings] Error 2 (ignored) CC adlist.o cc: error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’? make[2]: *** [Makefile:334: adlist.o] Error 1 make[2]: Leaving directory '/opt/redis-6.0.9/src' make[1]: *** [Makefile:375: 32bit] Error 2 make[1]: Leaving directory '/opt/redis-6.0.9/src' make: *** [Makefile:6: 32bit] Error 2 root@jack:/opt/redis-6.0.9#

Expected behavior

No errors

Additional information

I followed the suggested instructions in error message and in .src/Makefile 32bit: changed flags to mbe32 and make worked

Comment From: oranagra

indeed -m32 is x86 only. but what you used seems invalid (or unneeded) for your platform. armv7l is 32bit little endian, so a default build is 32bit.

When linking a big-endian image select between BE8 and BE32 formats. The option has no effect for little-endian images and is ignored

Comment From: oranagra

i would also like to add that make 32bit is just a convenience target. if you have anything specific for your platform you can just modify the CFLAGS like so: make REDIS_CFLAGS='-march=armv7-a' or any other flag you like. i'm closing this issue, feel free to re-open or respond if you disagree.