Page MenuHomeFreeBSD

Add fileprefixmap compiler feature
ClosedPublic

Authored by dan.mcgregor_usask.ca on Feb 12 2021, 10:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 4 2024, 6:29 AM
Unknown Object (File)
Oct 4 2024, 4:19 AM
Unknown Object (File)
Oct 3 2024, 11:54 PM
Unknown Object (File)
Oct 2 2024, 4:22 AM
Unknown Object (File)
Oct 1 2024, 9:19 PM
Unknown Object (File)
Sep 28 2024, 11:25 AM
Unknown Object (File)
Sep 23 2024, 11:50 PM
Unknown Object (File)
Sep 22 2024, 6:29 PM

Details

Summary

-ffile-prefix-map=<old>=<new> is a compiler feature first added in
GCC 8, and implemented for clang 10. It remaps old paths to new paths
in both debug information and FILE and BASE_FILE macros. It can
be used to improve reproducibility or to hide local system directories.

I plan to use it in future reviews to replace the real source directory
and real object directory with constant values across all builds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36946
Build 33835: arc lint + arc unit

Event Timeline

brooks added a reviewer: arichardson.

This seems reasonable. Adding Alex in case he's interested (we might want to use this in cheribuild to match src paths match smbfs mounts).

This revision is now accepted and ready to land.Feb 15 2021, 6:51 PM

This seems reasonable. Adding Alex in case he's interested (we might want to use this in cheribuild to match src paths match smbfs mounts).

Yes this seems useful for us. We should probably use it in Jenkins to avoid including the full path with the temporary cheribsd@N subdirectories.
In normal builds, I re-create the source path when mounting the sources via SMBFS. This allows the paths to work when coredump debugging on the host and also in the guest, so I don't think we need it outside of jenkins.

Thanks for the review. I'm not a committer, so I can't submit it myself.

@arichardson, if you're curious the full series can be found at my gitlab branch. With that change series, I can build a full distribution (but not release) in a byte-for-byte identical manner across directories, build users, and host versions (as long as it's FreeBSD 12+). I'm cleaning that branch up now for pushing upstream, since I think it'll be generally useful.

This revision was automatically updated to reflect the committed changes.

Thanks for the gitlab reference, being able to cherry-pick the commit and preserve author data was helpful.