Hi,

The attached patch is in regards to issue #15620 in mantis bug tracker
("Ninja generator triggers race condition in Borland bcc32 linker causing
intermittent build failure").  Thanks to Brad King's suggestion, I think
using job pools is a lot easier than trying my proposed workaround (which I
realized would probably involve more disruptive code changes).  (I'm new to
both CMake/Ninja, so wasn't aware of this option).

I've tested with building VTK 5.4.2.  Before the patch, 5 out of 5 builds
failed (sooner or later, in a big project like VTK, the race condition would
trash the build).  After the patch, 5 out of 5 builds work without error.

Because of this issue with the linker itself, I can't think of any reason
why anybody would want to change the default settings I put in
Modules/Platform/Windows-Embarcadero.cmake with this patch.  You simply
*must* restrict the linker to one instance, without exception, or you'll
have problems due to the bcc32 linker design flaws I've outlined in the bug
tracker and patch comments.  I was only able to think of three solutions to
this problem:

1.  Modify each upstream CMake project (e.g. VTK) itself to set the Ninja
job pool in the Borland case (not a good option).
2.  Provide a toolchain file that sets up the job pool.  Awkward, since you
have to do this EVERY TIME you use the Ninja generator /w bcc32 or it WILL
NOT WORK.
3.  Patch Windows-Embarcadero.cmake, as I propose here.

(Since JOB_POOLS is a global property and not a variable, I couldn't find a
way to simply pass this as a parameter to cmake.exe - not that that would be
an ideal solution anyway.)

Best regards,

James Johnston

Attachment: 0001-Work-around-Borland-linker-issue-when-used-with-Ninj.patch
Description: Binary data

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to