From bc83d3f088ec25f6e176231581ce385b2cb717ee Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 31 Oct 2020 12:53:37 -0700 Subject: redis: Fix build on 32bit targets and clang Signed-off-by: Khem Raj --- meta-oe/recipes-extended/redis/redis/ilp32.patch | 29 ++++++++++++++++++++++++ meta-oe/recipes-extended/redis/redis_6.0.8.bb | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta-oe/recipes-extended/redis/redis/ilp32.patch (limited to 'meta-oe/recipes-extended') diff --git a/meta-oe/recipes-extended/redis/redis/ilp32.patch b/meta-oe/recipes-extended/redis/redis/ilp32.patch new file mode 100644 index 000000000..48d01a1d6 --- /dev/null +++ b/meta-oe/recipes-extended/redis/redis/ilp32.patch @@ -0,0 +1,29 @@ +__ILP32__ is defined for all 32bit architectures with clang e.g. +which is right but it is causing issues on non-x86 architectures +where this condition becomes true and wrongly starts using this +code, this issue is hidden with gcc becuase gcc does not define +__ILP32__ for all 32bit architectures but for selected 64bit arches +who choose to use 32bit ABI e.g. x32 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- a/src/debug.c ++++ b/src/debug.c +@@ -944,7 +944,7 @@ static void *getMcontextEip(ucontext_t * + /* Linux */ + #if defined(__riscv) && __riscv_xlen == 32 + return (void*) uc->uc_mcontext.__gregs[REG_PC]; +- #elif defined(__i386__) || defined(__ILP32__) ++ #elif defined(__i386__) || (defined(__X86_64__) && defined(__ILP32__)) + return (void*) uc->uc_mcontext.gregs[14]; /* Linux 32 */ + #elif defined(__X86_64__) || defined(__x86_64__) + return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */ +@@ -1125,7 +1125,7 @@ void logRegisters(ucontext_t *uc) { + ); + logStackContent((void**)uc->uc_mcontext.__gregs[REG_SP]); + /* Linux x86 */ +- #elif defined(__i386__) || defined(__ILP32__) ++ #elif defined(__i386__) || ( defined(__X86_64__) && defined(__ILP32__)) + serverLog(LL_WARNING, + "\n" + "EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n" diff --git a/meta-oe/recipes-extended/redis/redis_6.0.8.bb b/meta-oe/recipes-extended/redis/redis_6.0.8.bb index 546332851..14091b565 100644 --- a/meta-oe/recipes-extended/redis/redis_6.0.8.bb +++ b/meta-oe/recipes-extended/redis/redis_6.0.8.bb @@ -16,6 +16,7 @@ SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \ file://0001-src-Do-not-reset-FINAL_LIBS.patch \ file://GNU_SOURCE.patch \ file://riscv32.patch \ + file://ilp32.patch \ " SRC_URI[md5sum] = "70113b4b8ea7ee4c7e148be62b5d1e0b" -- cgit v1.2.3-54-g00ecf