-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capturing the command-line arguments used on each translation unit #34
Comments
So you want to create another section that contains the commands used to generate the compilation unit? I guess that is possible, but isn't in the code. It shouldn't be too hard, after all that is how the There has been occasional mumbling about needing something like this. |
Yep, exactly. And yeah, I figure I could reuse the current section techniques/code to stash it. I'll look into it a bit. |
And I guess an additional switch to Sounds reasonable. I remember @HassenSaidi complained that we lost the necessary information to relink the bitcode. |
@ianamason @woodruffw : I did run into this issue in the past. I had more complex scenarios involving changes to the .o files between their creation and the linking. Imagine for instance changing the name of a symbol between generating the .o file and linking it. So to do this properly, the section containing the commands should be generated by tracking all file changes during the build process. |
So you gave up on this and created that: https://github.com/trailofbits/blight. |
@woodruffw I took a look at blight, but I haven't tried it out. Is there any other black magic other than creating a directory |
@ianamason we use two techniques:
That leaves the worst case, i.e. a fully qualified path like |
Thanks! I thought I saw a discussion that cmake doesn't respect AR, is that right? |
That sounds right, although I'm not 100% sure -- I know they have their own |
Hi there,
Does
gllvm
support capturing the command-line arguments (not underlying driver arguments) used on each translation unit?For example, if I had the following runs:
I'd like the following mapping stored in a section stored somewhere in
bar
:I'm aware that I can approximate this at the clang/LLVM level with
-grecord-gcc-switches
or-frecord-command-line
, but was curious if I could do the same at thegllvm
level.This is something I could try to contribute, if there's interest.
The text was updated successfully, but these errors were encountered: