Skip to content

Commit e67c45c

Browse files
Fix for #1271, set_file_prefix_map attribute (#1288)
1 parent b25485b commit e67c45c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

foreign_cc/private/cc_toolchain_util.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ def get_flags_info(ctx, link_output_file = None):
306306
),
307307
),
308308
)
309+
310+
if "set_file_prefix_map" in dir(ctx.attr) and ctx.attr.set_file_prefix_map:
311+
copts.append("-ffile-prefix-map=$EXT_BUILD_ROOT=.")
312+
cxxopts.append("-ffile-prefix-map=$EXT_BUILD_ROOT=.")
313+
309314
return CxxFlagsInfo(
310315
cc = _convert_flags(cc_toolchain_.compiler, _add_if_needed(flags.cc, copts)),
311316
cxx = _convert_flags(cc_toolchain_.compiler, _add_if_needed(flags.cxx, cxxopts)),

foreign_cc/private/framework.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ CC_EXTERNAL_RULE_ATTRIBUTES = {
201201
doc = "Optional part of the shell script to be added after the make commands",
202202
mandatory = False,
203203
),
204+
"set_file_prefix_map": attr.bool(
205+
doc = (
206+
"Use -ffile-prefix-map with the intention to remove the sandbox path from " +
207+
"debug symbols"
208+
),
209+
mandatory = False,
210+
default = False,
211+
),
204212
"targets": attr.string_list(
205213
doc = (
206214
"A list of targets with in the foreign build system to produce. An empty string (`\"\"`) will result in " +

0 commit comments

Comments
 (0)