From c44791c89d2b51bfce864ab2cf5228d41ece1fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=BA=E9=95=BF?= Date: Wed, 5 Feb 2020 05:57:41 +0800 Subject: [PATCH] Fix LLDB can't work with --build-id (#336) --- build/toolchain/custom/BUILD.gn | 4 ++-- build/toolchain/fuchsia/BUILD.gn | 4 ++-- build/toolchain/gcc_toolchain.gni | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn index 787bf8fd62d..65b16235188 100644 --- a/build/toolchain/custom/BUILD.gn +++ b/build/toolchain/custom/BUILD.gn @@ -81,7 +81,7 @@ toolchain("custom") { # existing .TOC file, overwrite it, otherwise, don't change it. tocfile = sofile + ".TOC" temporary_tocname = sofile + ".tmp" - link_command = "$ld $target_triple_flags $sysroot_flags -shared {{ldflags}} -o $unstripped_sofile $custom_lib_flags -Wl,--build-id -Wl,-soname=$soname @$rspfile" + link_command = "$ld $target_triple_flags $sysroot_flags -shared {{ldflags}} -o $unstripped_sofile $custom_lib_flags -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile" toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f posix $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname" replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" strip_command = "$strip -o $sofile $unstripped_sofile" @@ -118,7 +118,7 @@ toolchain("custom") { outfile = "{{root_out_dir}}/$exename" rspfile = "$outfile.rsp" unstripped_outfile = "{{root_out_dir}}/exe.unstripped/$exename" - command = "$ld $target_triple_flags $sysroot_flags {{ldflags}} -o $unstripped_outfile $custom_lib_flags -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile" + command = "$ld $target_triple_flags $sysroot_flags {{ldflags}} -o $unstripped_outfile $custom_lib_flags -Wl,--build-id=sha1 -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile" description = "LINK $outfile" rspfile_content = "{{inputs}}" outputs = [ diff --git a/build/toolchain/fuchsia/BUILD.gn b/build/toolchain/fuchsia/BUILD.gn index ecd949e4a22..cd1b72610a3 100644 --- a/build/toolchain/fuchsia/BUILD.gn +++ b/build/toolchain/fuchsia/BUILD.gn @@ -100,7 +100,7 @@ toolchain("fuchsia") { # existing .TOC file, overwrite it, otherwise, don't change it. tocfile = sofile + ".TOC" temporary_tocname = sofile + ".tmp" - link_command = "$goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id -Wl,-soname=$soname @$rspfile" + link_command = "$goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile" toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f p $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname" replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" strip_command = "$strip -o $sofile $unstripped_sofile" @@ -137,7 +137,7 @@ toolchain("fuchsia") { outfile = "{{root_out_dir}}/$exename" rspfile = "$outfile.rsp" unstripped_outfile = "{{root_out_dir}}/exe.unstripped/$exename" - command = "$goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile" + command = "$goma_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id=sha1 -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile" description = "LINK $outfile" rspfile_content = "{{inputs}}" outputs = [ diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 6ba99ec6bc8..27f32e3306c 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -171,7 +171,7 @@ template("gcc_toolchain") { # existing .TOC file, overwrite it, otherwise, don't change it. tocfile = sofile + ".TOC" temporary_tocname = sofile + ".tmp" - link_command = "$ld -shared {{ldflags}} $coverage_flags -o $sofile -Wl,--build-id -Wl,-soname=$soname @$rspfile" + link_command = "$ld -shared {{ldflags}} $coverage_flags -o $sofile -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile" toc_command = "{ $readelf -d $sofile | grep SONAME ; $nm -gD -f p $sofile | cut -f1-2 -d' '; } > $temporary_tocname" replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" @@ -221,7 +221,7 @@ template("gcc_toolchain") { unstripped_outfile = "{{root_out_dir}}/exe.unstripped/$exename" } - command = "$ld {{ldflags}} $coverage_flags -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix" + command = "$ld {{ldflags}} $coverage_flags -o $unstripped_outfile -Wl,--build-id=sha1 -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix" if (defined(invoker.strip)) { strip = invoker.strip strip_command =