gllvm icon indicating copy to clipboard operation
gllvm copied to clipboard

feature: fake linker to capture link target

Open qtcdxxyuc opened this issue 3 years ago • 7 comments

Is it possible to a fake linker(ln), then we capture this information. In this way, we can select the target we need to extract from a list. Instead of manually specifying the target

qtcdxxyuc avatar Mar 03 '21 06:03 qtcdxxyuc

Which linker are you talking about? The one that clang calls behind our backs? Or the llvm_link we use to link bitcode?

ianamason avatar Mar 03 '21 20:03 ianamason

I think this linker mean /usr/bin/ld . iIf we monitor his input, can know the real library or executable program produced by the project. Not specified by the user select which lib or exe. Then extract these together.

qtcdxxyuc avatar Mar 10 '21 01:03 qtcdxxyuc

This information probably can be gleaned from the log. Set the logging level and logging file and then look for 'linking'

Build systems rarely call ld directly. For example libtool.

ianamason avatar Mar 10 '21 02:03 ianamason

Can I close this @qtcdxxyuc?

ianamason avatar May 19 '21 21:05 ianamason

Not sure if it'll help, but one of the projects that I use gllvm on also uses blight for this kind of introspection of the linker and other generic build tools: https://github.com/trailofbits/blight

It won't work in all circumstances, but it'll get you pretty far and composes painfully with gllvm on builds.

woodruffw avatar Jun 30 '21 17:06 woodruffw

Hi, I come accross the situation that the build system use the libtool directly. How can I deal with situation?

Luweicai avatar Nov 23 '22 07:11 Luweicai

You would have to be more specific as the what the problem is.

ianamason avatar Nov 23 '22 21:11 ianamason