# Save the real linker.
sudo cp /Developer/usr/bin/ld /Developer/usr/bin/real-ld# Create a script file to limit the number of linkers run in parallel.echo -e '#!/bin/sh\nlockfile=${TMPDIR}/link.lock\n\ncount=1;\nwhile !(shlock -f "${lockfile}${count}" -p $$) do\n let count=count+1;\n if [ ${count} -eq 5 ]; then\n let count=1;\n sleep 1;\n fi\ndone\n\nexec /Developer/usr/bin/real-ld "$@"\n\nrm "${lockfile}${count}"' > ${TMPDIR}/junk.txt
# Replace the linker with the script.
sudo cp ${TMPDIR}/junk.txt /Developer/usr/bin/ldrm ${TMPDIR}/junk.txtsudo chmod a+x /Developer/usr/bin/ld
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
Shouldn't we fix it right in the codebase / build scripts?
Wow! I’ve never really seen more than two targets being linked
simultaneously. Or maybe that’s four? It’s certainly less than ncpus
on my beefy Mac Pro. I guess disk seeking still might be a problem.
I’m a little surprised you’re actually seeing 9 in parallel, though.
Are they actually all running ld, or is Xcode holding any of them
until it has enough local “slots” free?
Mark
Nico
# Save the real linker.
sudo cp /usr/bin/ld /usr/bin/real-ld
# Create a script file to limit the number of linkers run in parallel.
echo -e '#!/bin/sh\nlockfile=${TMPDIR}/link.lock\n\ncount=1;\nwhile !(shlock -f "${lockfile}${count}" -p $$) do\n let count=count+1;\n if [ ${count} -eq 5 ]; then\n let count=1;\n sleep 1;\n fi\ndone\n\nexec /usr/bin/real-ld "$@"\n\nrm "${lockfile}${count}"' > ${TMPDIR}/junk.txt
# Replace the linker with the script.
sudo cp ${TMPDIR}/junk.txt /usr/bin/ldrm ${TMPDIR}/junk.txtsudo chmod a+x /usr/bin/ld