[pacman-dev] [PATCH 1/2] libmakepkg: always remap debug prefix

Eli Schwartz eschwartz at archlinux.org
Fri Apr 23 18:22:58 UTC 2021


On 4/22/21 5:32 PM, Morgan Adamiec wrote:
> Even when stripped the binary still contains the filepaths. If you're
> prefer to predix it with "" that works.


Per discussion on IRC, the issue at hand is that in non-debug parts of
the binary, rust is using macros pointing to the source code, for e.g.
panics.

In the same style as __FILE__ macros in C. Which we do not try to handle
here.

Basically, gcc has:

-fdebug-prefix-map == rewrite file paths pointing to source code for the
debugger to step through

-fmacro-prefix-map == rewrite __FILE__ macros.

The rust option does both and there is no rust option to only do one or
the other.

...

IMO rewriting macros is out of scope for the debugflags option, and *if*
we want to do anything with them we should make them relative paths
(remap to "") while at the same time making debug references remapped to
the debug sources directory.

-fdebug-prefix-map=$srcdir=$debugdir -fmacro-prefix-map=$srcdir=

(But, I'm not convinced we should do anything with them.)

Rust does not offer this granularity, apparently. So, enabling debug
builds has the side effect of also making runtime, end-user macro output
change.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20210423/5469d786/attachment.sig>


More information about the pacman-dev mailing list