-trimpath

206 views
Skip to first unread message

stephen.t....@gmail.com

unread,
Feb 16, 2023, 3:01:06 AM2/16/23
to golang-dev
Hello,

I've just had the chance to use -trimpath in my project. Some paths in my project have not been trimmed.

Most of the paths *have* been trimmed and it's just a dozen or so paths leading to .cpp and .h files that remain. The fact that these are non-Go files suggests that it might be intentional. Or is it a flaw/bug?


Regards

Steve

stephen.t....@gmail.com

unread,
Feb 16, 2023, 9:41:29 AM2/16/23
to golang-dev
Further to this: I just had a thought that these strings might have been left by the C compiler in the DWARF data, but that doesn't appear to be the case.

Moreover, the system path does not appear in the output of a full objdump and they are not string literals in either my source or in any of the included modules.

But a strings & grep test shows that they do appear in the binary.

Regards
Steve

Bryan C. Mills

unread,
Feb 16, 2023, 10:15:05 AM2/16/23
to stephen.t....@gmail.com, golang-dev
If `-trimpath` is not completely trimming the paths, please file an issue with the prefix "cmd/go:".

Be sure to include details about the Go and C toolchain versions you're using and the flags you're passing to build the binaries.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/bbbbffed-9d9c-4480-ac0b-3d96098ac095n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages