From 18a0f0c17839e3662ac86a22975ae45886ae4cf6 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 19 Oct 2022 16:41:24 +1100 Subject: [PATCH] Fix AIX compulation (break addr resolution) Revert c92c1615852ecd4be2d04203600efd3eba578a02, casting to void* cannot fool gcc. The AIX address resolution was broken anyway, so just avoid the problem and make it compile well. --- mysys/my_addr_resolve.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c index 444a47bb7c5..4948ad3e698 100644 --- a/mysys/my_addr_resolve.c +++ b/mysys/my_addr_resolve.c @@ -319,12 +319,20 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) /* Save result for future comparisons. */ strnmov(addr2line_binary, info.dli_fname, sizeof(addr2line_binary)); +#ifdef _AIX + /* + info.dli_fbase is a char on AIX and casting it doesn't fool gcc. + leave backtracing broken on AIX until a real solution can be found. + */ + addr_offset= NULL; +#else /* Check if we should use info.dli_fbase as an offset or not for the base program. This is depending on if the compilation is done with PIE or not. */ - addr_offset= (void*) info.dli_fbase; + addr_offset= info.dli_fbase; +#endif #ifndef __PIE__ if (strcmp(info.dli_fname, my_progname) == 0 && addr_resolve((void*) my_addr_resolve, loc) == 0 &&