--- build/config/compiler/BUILD.gn 2025-09-01 12:23:07 +++ build/config/compiler/BUILD.gn 2025-10-20 22:46:15 @@ -2221,7 +2221,7 @@ } # TODO(crbug.com/355446806): Clean up and enable. - if (is_apple) { + if (false) { ldflags += [ "-Wl,-no_warn_duplicate_libraries" ] } --- build/toolchain/apple/toolchain.gni 2026-05-29 13:02:36 +++ build/toolchain/apple/toolchain.gni 2026-07-18 12:41:56 @@ -200,6 +200,10 @@ cc = compiler_prefix + _cc cxx = compiler_prefix + _cxx ld = _cxx + + cc = getenv("CC") + cxx = getenv("CXX") + ld = cxx # Set the explicit search path for clang++ so it uses the right linker # binary. @@ -230,11 +234,14 @@ linker_driver_env = "TOOL_VERSION=${tool_versions.linker_driver}" linker_driver = rebase_path("//build/toolchain/apple/linker_driver.py", root_build_dir) + linker_driver = "$python_path $linker_driver" linker_driver_args = "-Wcrl,driver,$ld" # Specify an explicit path for the strip binary. _strippath = "${prefix}llvm-strip" _installnametoolpath = "${prefix}llvm-install-name-tool" + _strippath = "strip" + _installnametoolpath = "install_name_tool" linker_driver_args += " -Wcrl,strippath,${_strippath} -Wcrl,installnametoolpath,${_installnametoolpath}" _enable_dsyms = enable_dsyms _save_unstripped_output = save_unstripped_output @@ -252,8 +259,7 @@ if (_enable_dsyms) { dsym_switch = " -Wcrl,dsym,{{root_out_dir}} " dsym_switch += "-Wcrl,dsymutilpath," + - rebase_path("//tools/clang/dsymutil/bin/dsymutil", - root_build_dir) + " " + "dsymutil" + " " # All the toolchains are defined in the context of the default toolchain, # this means that the global variable `current_cpu` is not correct, it @@ -581,7 +587,7 @@ tool("alink") { rspfile = "{{output}}.rsp" - rspfile_content = "{{inputs}}" + rspfile_content = "{{inputs_newline}}" if (!toolchain_uses_lld) { script = rebase_path("//build/toolchain/apple/filter_libtool.py", @@ -593,7 +599,7 @@ # Apple's libtool fails if the response file is empty (e.g., for empty # targets). We work around this by writing a dummy archive with the ar # magic number. - command = "rm -f {{output}} && if [ -s \"$rspfile\" ]; then TOOL_VERSION=${tool_versions.filter_libtool} $python_path $script $libtool -static -D {{arflags}} -o {{output}} @$rspfile; else printf '!\n' > {{output}}; fi" + command = "rm -f {{output}} && if [ -s \"$rspfile\" ]; then TOOL_VERSION=${tool_versions.filter_libtool} $python_path $script $libtool -static {{arflags}} -o {{output}} -filelist $rspfile; else printf '!\n' > {{output}}; fi" description = "LIBTOOL-STATIC {{output}}" } else { ar = "${prefix}llvm-ar" @@ -632,6 +638,8 @@ # appropriate binary if there are multiple installs. nm = "${prefix}llvm-nm" otool = "${prefix}llvm-otool" + nm = "nm" + otool = "otool" link_command = "$linker_driver_env $linker_driver" link_command += " -Wcrl,otoolpath,$otool -Wcrl,nmpath,$nm" --- build/toolchain/apple/linker_driver.py 2026-08-15 17:35:18 +++ build/toolchain/apple/linker_driver.py 2026-08-15 17:38:59 @@ -360,13 +360,6 @@ dsymutil_env['PATH'] = ':'.join(tools_paths) subprocess.check_call( self._dsymutil_cmd + [ - # TODO(crbug.com/532150826): Switch to `--linker parallel` when - # we figure out how to prevent memory/thread explosion. - '--linker=classic', - # TODO(crbug.com/513203450): Until we figure out what to do - # with > 4GB DWARF data, pass this flag to suppress the - # warning - '--allow-section-header-offset-overflow', '-o', dsym_out, linker_output,