Wireshark-dev: Re: [Wireshark-dev] Mac Build Error
From: Guy Harris <[email protected]>
Date: Wed, 20 Jan 2016 12:22:17 -0800
On Jan 20, 2016, at 11:09 AM, David Morsberger <[email protected]> wrote:

> This is what I am also tracking down. It has to do with the way cmake is instantiating the compiler. The --serialized-diagnostics option is what appears to be hiding the error.

--serialize-diagnostics takes an argument, which is the name of a file to which the diagnostics are written, in a binary format.

Clang documentation sucks.  Srsly.  The man page doesn't enumerate the -W options; the website:

	http://clang.llvm.org/docs/UsersManual.html#options-to-control-error-and-warning-messages

does, but I'm not sure how to get the manual for an *arbitrary* version of Clang (the GCC folks are kind enough to provide online manuals, complete with listings of compiler flags, for multiple versions), and the word "serialize" appears nowhere on that page.

It might be that, when the tests are done, ld is being run directly, rather than by the gcc/clang driver, and that -as-needed isn't getting passed to it.  It obviously is getting passed when the actual *build* is done.

Perhaps when CMake was being designed, its designers should have looked at the documentation for another configuration system - I think it's called "autoconf" or something such as that - and noticed that it offered not only macros to try compiling a file ("compiling" as in "turning a source file into an object file, without trying to link anything"), but macros to try *linking* things, which can come in handy if, say, to pick a purely *hypothetical* example, you're trying to see whether a given linker flag works.

Or perhaps they mistakenly had the attitude that "we take care of all the platform details, so you don't have to".