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
-pthread appended to CFLAGS even though the compiler is IBM XLC #8276
Comments
The patch back then seems to suggest to check for 1.Isn't there a chance that gcc/clang can run on AIX and have such an option? |
I think it would make sense if you would write up a PR for the change you think makes sense for you on that platform. We don't have many AIX users or developers around. |
You are right, of course, I'm aware it's not a real fix but it allows a user to pass the -qthreaded flag to C/CPPFLAGS manually (not much of an improvement, I admit) and, most of all, it doesn't backfire and result in having profiling enabled.
I've found some literature about gcc working on AIX, but it's not supported by IBM and it feels like a "hack". I'd rather have XLC fully supported (apart from this little issue, curl is building fine).
I'd love to. The main reason why I opened this issue was to (indirectly) ask whether some patch was already being implemented; if you don't mind, I'm going to test a possible solution and submit it as a PR. Thank you for your patience and your quick reply. |
I fully support that. I was only suggesting that if gcc (might) (or in fact another compiler in general) run on AIX, then checking for the OS in configure is the wrong way to detect the compiler.
Awesome! |
@dcassioli can I get your help with #8541? I do not have an AIX system to test against. |
The fix for curl#8276 proposed in curl#8374 set `CFLAGS="$CFLAGS -pthead"` earlier than it used to be set, applying it in cases where it should not have been applied. This moves the AIX XLC check to a new `case $host in` block inside of the `if test "$USE_THREADS_POSIX" != "1"` block, where `CFLAGS="$CFLAGS -pthead"` used to happen.
Sure, but I won't be able to test it until Monday. I'll let you know as soon as it's done. |
The fix for #8276 proposed in #8374 set `CFLAGS="$CFLAGS -pthead"` earlier than it used to be set, applying it in cases where it should not have been applied. This moves the AIX XLC check to a new `case $host in` block inside of the `if test "$USE_THREADS_POSIX" != "1"` block, where `CFLAGS="$CFLAGS -pthead"` used to happen. Fixes #8541 Closes #8542
https://github.com/curl/curl/blob/master/configure.ac#:~:text=AC_CHECK_FUNC(pthread_create%2C%20%5BUSE_THREADS_POSIX,PTHREAD%3D%22%20%2Dpthread%22
In configure.ac (and the generated configure script) the -pthread flag gets appended to CFLAGS even in the case of IBM XLC compiler. The issue was experienced in AIX 7.1 with XLC version 11.1.
The -pthread flag has no meaning in XLC, and it's probably getting interpreted as -p (enable profiling) -t (list of toolchain programs to prepend the prefix specified by the -B flag to, i.e., 'a' for 'assembler', 'l' for 'linker', etc.), and then 'hread' is parsed as argument for -t (which is garbage, so the flag is simply discarded with a warning).
In discussion: https://curl.se/mail/lib-2019-03/0049.html a possible fix is proposed.
The text was updated successfully, but these errors were encountered: