Page MenuHomePhabricator

santagada (Leonardo Santagada)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 25 2019, 5:57 AM (115 w, 3 d)

Recent Activity

Feb 17 2021

santagada added a comment to D80833: [CodeView] Add full repro to LF_BUILDINFO record.

Does the full path to the tool end up only in the object file, or does this make it all the way to the final executable or library?

The LF_BUILDINFO records for each .OBJ are emitted as they are in the final .PDB.

Does embedding full paths affect distributed builds or build reproducibility?

It does affect reproducibility for distributed builds, the contents of LF_BUILDINFO for a remotely-compiled .OBJ will be different in the final .PDB.
In our case, compilation jobs can be executed locally or remotely, depending on how they are queued.
For example,

  • If a local compilation, C:\.nuget\llvm.10.0.0.2\bin\clang-cl.exe would be stamped in the LF_BUILDINFO record.
  • If a remote compilation, C:\Users\SomeUser\AppData\Local\Temp\.fbuild.tmp\worker\toolchain.130589cdf35aed3b\clang-cl.exe would be stamped (the compiler executable is sent to the remote worker).

But you've got a good point. We would need an way to force the remote compiler to stamp the local path (which is unique for all users). We've got a manual override if the compiler path referred by LF_BUILDINFO can't be found locally, but this is a bit annoying, see: https://liveplusplus.tech/docs/documentation.html#FASTBuild.
It is better if the right information was there in the first place in the .OBJ. Could we do a remapping instead through VFS maybe? I'd like to avoid adding yet-a-new-flag to handle that.

Feb 17 2021, 8:20 AM · Restricted Project, Restricted Project

May 13 2020

santagada added inline comments to D79672: [COFF] Move type merging to TpiSource::mergeDebugT virtual method.
May 13 2020, 3:16 PM · Restricted Project

Nov 9 2019

santagada added inline comments to D55585: RFC: [LLD][COFF] Parallel GHASH generation at link-time -- NOT FOR SUBMIT.
Nov 9 2019, 3:53 PM · Restricted Project

Mar 24 2019

santagada added a comment to D54802: [LLD][COFF] Generate import modules in PDB.

Anything missing for this to be accepted? It seems like this patch is ready.

Mar 24 2019, 10:10 AM · Restricted Project

Mar 20 2019

santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

I can, but looking at the code for PDBLinker::mergeInPrecompHeaderObj and the code that calls it, seems like lld is adding the precompiled header multiple times on the output pdb, there is no checks to make sure it only emits the data once.

Mar 20 2019, 7:45 AM · Restricted Project
santagada awarded D54802: [LLD][COFF] Generate import modules in PDB a Like token.
Mar 20 2019, 6:10 AM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

Just discovered this doesn't work when using a pch... it gets into an infinite loop trying to hash types, the reason I think that there are types in the .debug$T asking for indexes on the .debug$T of the pch. Somehow I need to fix this... just don't know how yet

Mar 20 2019, 6:03 AM · Restricted Project

Mar 6 2019

santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

I will try to do most code changes tomorrow, altough unifying the lld and objcopy generation of the .debug$H section will be complicated as they have completely different apis to obj files.

Mar 6 2019, 2:11 PM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

General question: why not just use llvm-objcopy --add-section to do this?

How? I need to compute the ghashes, how would I just add a section to it?

--add-section adds a given file as a section name, e.g. assuming you have a separate script to compute hashes:
./compute_ghashes input.o > ghash.txt
llvm-objcopy input.o --add-section .debug$H=ghash.txt

Mar 6 2019, 2:09 PM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

Well, link.exe seems to get "confused" it doesn't print any error messages and produce a very big file that is not really an executable. Without any messages or symbols for it its a bit difficult to see what is happening. As I mostly did the same as the gnu-link option does, I guess those obj files should have the same problem.

FWIW, the gnu debuglink feature is only used on executables, not on object files, and only in practice in mingw setups and read by GDB, so there might very well be things in that which confuses link.exe.

Mar 6 2019, 2:07 PM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

General question: why not just use llvm-objcopy --add-section to do this?

Mar 6 2019, 9:41 AM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

The only problem I have with this change is that apparently link.exe doesn't like the obj files after the section is added...

Could you add more detail? Could you possibly try to pinpoint the issue with a very small use-case please?
LLVM-generated OBJs shall be 100% compatible with MSVC-generated ones. If they are not, we should fix that.

Mar 6 2019, 9:40 AM · Restricted Project
santagada added a comment to D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.

Leonardo, could you please explain how are you planning on using this feature in production? Are you compiling all OBJs, then running llvm-objcopy --add-ghashes on all of them afterwards?
Could you provide some timings? (time to compile your OBJs, time to add the ghashes, linking with and without ghashes)

Mar 6 2019, 9:38 AM · Restricted Project
santagada updated the summary of D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.
Mar 6 2019, 8:41 AM · Restricted Project
santagada added reviewers for D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects: aganea, zturner.
Mar 6 2019, 8:38 AM · Restricted Project
santagada created D59025: Add --add-ghashes to llvm-objcopy to append a .debug$H to coff objects.
Mar 6 2019, 8:38 AM · Restricted Project
Herald added a project to D54802: [LLD][COFF] Generate import modules in PDB: Restricted Project.
Mar 6 2019, 7:09 AM · Restricted Project