[cmake-developers] Modules/GetPrequisites.cmake issues

Bill Somerville bill at classdesign.com
Wed Jul 29 12:47:14 EDT 2015


On 29/07/2015 16:07, Bill Hoffman wrote:
Hi Bill,
> On 7/29/2015 10:17 AM, Bill Somerville wrote:
>>> Is there a reason not to look for objdump before dumpbin?
>> I was under the impression that dumpbin was selected first for non-MinGW
>> Windows builds, I have no idea if objdump works with binaries produced
>> by compilers other than GNU/CLang. This is why I commented about
>> detecting MinGW, there are mentions of a MINGW CMake system variable but
>> it doesn't seem to exist.
> Yes, that is the problem.  This is  a standalone script that is run at 
> install time, so it does not have any information about the build 
> toolchain. In retrospect it should have been passed more information 
> about the build tool chain that was used.
>
> This is what we want:
>
> #    dumpbin (Windows)
> #    objdump (MinGW on Windows)
> #    ldd (Linux/Unix)
> #    otool (Mac OSX)
There is already a documented override by setting the gp_tool variable, 
that's what we do in our project since we only support MinGW on Windows 
(at the moment).
>
> Trouble is dumpbin and objdump might both be in the PATH on Windows. 
> You don't really know which one to use.     I wonder if you found both 
> if you could call something on each of them with one of the binaries, 
> if you could figure out what tool would work better with it.
You can't decide based on one executable since dumpbin works on some and 
not others, I believe  the problem is with DLLs that export exactly zero 
symbols which is true of the GCC support libraries.

It may be that if objdump is available it can always be used but I don't 
know that for sure, also it is still slower than dumpbin even with the 
patch I am proposing.
>
> -Bill
Regards
Bill Somerville.


More information about the cmake-developers mailing list