-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build fails on AIX 7.1 due to thread-local storage #1287
Comments
Adding |
Running XL C with |
There'a already stuff for both autotools and CMake to check for libpthreads and to check whether it's necessary; the latter should be expanded to see whether using thread-local data requires libpthreads. |
This is what I was just going to commit: --- a/aclocal.m4
+++ b/aclocal.m4
@@ -101,6 +101,23 @@ AC_DEFUN(AC_LBL_C_INIT,
case "$host_os" in
+ aix*)
+ case "$CC" in
+ *xlc*)
+ # XL C supports the "__thread" storage class specifier
+ # and the associated "-qtls" command-line option since
+ # at least version 12.1.0, the newer "-ftls-model"
+ # option became available in version 16.1.0. By
+ # default TLS is enabled on Linux and disabled on AIX.
+ #
+ # However, XL C 17 is actually LLVM, which will require
+ # a more sophisticated workaround if and when it is
+ # available on AIX.
+ $1="$$1 -qtls"
+ ;;
+ esac
+ ;;
+
darwin*)
#
# This is assumed either to be GCC or clang, both
diff --git a/configure.ac b/configure.ac
index cb93687e..5498ba45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2079,6 +2079,9 @@ aix*)
LIBS="-lodm -lcfg"
;;
esac
+ # Thread-local storage on AIX requires libpthreads no matter if using
+ # GCC or XL C.
+ LIBS="$LIBS -lpthreads"
;;
darwin*) If you see a better solution, let me know and I will work on a different problem. |
Commit b10eefd seems to be the breaking change.
Using Autoconf and XL C 12.1:
Using Autoconf and GCC 8.3.0:
(The only description of
__get_tpointer
I managed to find is this and it seems to be 32-bit specific, which looks wrong.)The text was updated successfully, but these errors were encountered: