812 | @@ -813,6 +813,11 @@ AX_GCC_FUNC_ATTRIBUTE([dllimport])
813 | if test x$use_glibc_compat != xno; then
814 | AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
815 | AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
816 | + case $host in
817 | + powerpc64* | ppc64*)
818 | + AX_CHECK_LINK_FLAG([[-Wl,--no-tls-get-addr-optimize]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--no-tls-get-addr-optimize"])
Does this disable some optimization related to thread local storage? Is there a way to avoid that?
(just wondering why this is here; not an objection if it's needed)
I don't know.
@luke-jr ?
If this is a workaround for a platform-specific compiler issue, let's add a comment (preferably mentioning the upstream issue) so that it can be removed when no longer necessary.
Older glibc don't have support for the optimisation (hence it being part of glibc compat ;) )
@luke-jr Yes, of course. I guess my question is: do we know whether that has any performance impact (presumably not much for now, as thread_local variables are only used for thread names AFAIK), and/or has the alternative of requiring a higher minimum glibc been considered?
No problem if the answer is we don't know, or there are reasons for doing it this way. I just want to make sure we don't end up years from now chasing a weird performance regression on POWER9 in release binaries.
FWIW in #18851 I had implemented the thread name system without use of TLS, which would have dropped that entire dependency.
That said, I doubt for our use (one query per log message?) a slightly slower TLS makes any noticeable difference in performance.