This patch stops the driver complaining that -pthread is only used when linking (some platforms use it when compiling to set some #defines, so a lot of Makefiles pass it at all stages of compilation).
It also adds -Wno-import, which is silently ignored. Clang defaults to the behaviour that GCC exhibits when -Wno-import is specified (not warning that #import is deprecated).
clang.diff (1.33 KB)
I fixed -Wno-import in a different way; I'll let Daniel comment on the
I think the right fix is to pass -pthread to clang-cc since it may
change the language (depending on the target?). This will have the
side effect of silencing the warning.
The attached diff passes -pthread on to clang-cc, which then ignores it. When someone comes to add support for platforms like HP-UX where it actually does something there is now a place for them to do so. On platforms where it is silently ignored by GCC (I think that includes everything we support so far), it now doesn't issue an unrecognised argument warning.
clang.diff (1.48 KB)
And the same patch without copy-and-paste error...
clang.diff (1.48 KB)
Ok, but, might as well add the language option and preprocessor define
while we are at it?
Well, the problem with this is that I have no idea what they are because I don't seem to have access to any platforms where -pthread does anything other than imply -lpthread while linking. Apparently on some platforms it defines a preamble to the executable, on some it defines macros (but I don't know what they are) and (I think) it also alters the behaviour of OpenMP on some platforms (but we don't yet support OpenMP), so it seemed more sensible to just leave the option there and let people define sensible language options when they add a target or feature that uses this flag, rather than for me to add some based on guesses that would sit unused and then be replaced later.
This is more or less why I like the warning; its a red flag to
indicate something we haven't implemented yet. If you file a bugzilla
on this I'll add it when I get home.
I've attached an updated diff that sets the correct predefines on NetBSD, OpenBSD and GNU/Linux.
clang.diff (3.01 KB)
Thanks, committed as r80883.