by vkoskiv · 3y ago · 0 comments
You don't need to if you're using the LLVM linker (lld) - by default it will use all of your HW threads (nr of cores).
lld --help | grep thread
--threads=<value> Number of threads. '1' disables multi-threading. By default all available hardware threads are usedFrom https://clang.llvm.org/docs/ThinLTO.html#id10
By default, the ThinLTO link step will launch as many threads in parallel as there are cores. If the number of cores can’t be computed for the architecture, then it will launch std::thread::hardware_concurrency number of threads in parallel. For machines with hyper-threading, this is the total number of virtual cores.
But maybe I misunderstood you.