autoconf-archive-maintainers | |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #8186] ax_pthread adds -pthread when it should not on OSX when co
From: |
Alistair King |
Subject: |
[patch #8186] ax_pthread adds -pthread when it should not on OSX when compiling with clang |
Date: |
Tue, 19 Nov 2013 16:28:03 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9) AppleWebKit/537.71 (KHTML, like Gecko) Version/7.0 Safari/537.71 |
Follow-up Comment #10, patch #8186 (project autoconf-archive):
I am seeing the same issue that Brian mentioned.
Using this patch on OSX 10.9, with CC set to either gcc or clang (it appears
they are both llvm front-ends):
address@hidden:~$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
address@hidden:~$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
When I use the patched ax_pthread macro it adds -pthread to CFLAGS.
This works just fine during the compilation phase, but when linking yields
this (misleading) warning:
clang: warning: argument unused during compilation: '-pthread'
The fix suggested by Brian does indeed make this go away.
My *guess* as to why this fixes the problem is because while clang will accept
-pthread during compilation, it is not needed; whereas during linking it
throws a warning if it is used.
>From man pthread(3):
INSTALLATION
The default system libraries include pthread functions. No additional
libraries or CFLAGS are necessary to use these interfaces.
Hope this helps.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?8186>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/