[CMake] 138% progress when building both all and not-in-all target?

Dan Kegel dank at kegel.com
Fri Jun 20 10:31:35 EDT 2014


It occurs to me that invoking make on this cmake-generated makefile
with two targets and -j4 has indeed triggered a more serious problem,
and the build fails nondeterministically with an internal error in ld
(presumably because the linker's being invoked twice in parallel on
the same file?).
See https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/423756

On Fri, Jun 20, 2014 at 6:45 AM, Dan Kegel <dank at kegel.com> wrote:
> On Fri, Jun 20, 2014 at 3:02 AM, David Cole <dlrdave at aol.com> wrote:
>>>> 138%
>>>> make -j4 all examples_noinst
>>
>>> I've seen this too but never noticed a pattern about when it happens.
>>
>> Does it always happen when naming more than one target with make -j?
>>
>> I thought you were not supposed to name more than one target with make -j...
>> (but I don't understand fully exactly why that's a bad thing...)
>
> make itself certainly doesn't have a bug along these lines; you can make -j
> a hundred targets at once and it won't double-build -- if the Makefile
> has proper dependencies.
>
> I could try to demonstrate the problem with a tiny CMakeLists.txt,
> but I'm not sure when I'll have time.
> - Dan


More information about the CMake mailing list