Open ramosian-glider opened 9 years ago
I think this is a fantastic idea!
The location at which DLLs are looked up on Windows is documented here: <http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx>.
The only way that I'm aware of that you could alter that search order by embedding
something in the binaries is through embedding a manifest as a resource, but that gets
a bit tricky if the application already has a manifest. There is a tool called mt.exe
<http://msdn.microsoft.com/en-us/library/aa375649%28v=vs.85%29.aspx> which is apparently
capable of extracting a manifest from one binary, merge another manifest inside it,
and put it back into the binary (see the -updateresource and -manifest arguments).
Honestly I don't think this trouble is worth it, because it will only work for the
cases where you invoke the linker through the compiler (which some code bases such
as Mozilla don't) and Reid's suggestion basically means that you can get a working
asan build no matter what your binaries setup looks like by adding -fsanitize=address
and copying one DLL alongside the app, and that is a *huge* improvement over the existing
setup. If that is the best we can achieve, I would be happy!
Reported by ehsan.akhgari
on 2014-08-08 14:35:40
Do you mean that the user has to do the copying manually?
Reported by timurrrr@google.com
on 2014-08-08 14:48:21
Well hopefully by modifying their build system, but yes. Typically it's very easy to
copy additional resources next to the binary in various build systems.
Reported by ehsan.akhgari
on 2014-08-08 14:50:04
I assume if a user wants to compile something simple (like "hello, world") as a simple
clang-cl command (clang-cl -fsanitize=address hello.c && hello.exe), clang-cl will
copy the RTL?
Reported by timurrrr@google.com
on 2014-08-08 15:16:19
Sure, we can definitely try copying the DLL from the driver driver if we choose to invoke
link.exe. That sounds fine to me.
Reported by ehsan.akhgari
on 2014-08-08 15:29:38
Reid, any opinions?
Reported by timurrrr@google.com
on 2014-08-08 16:58:57
Reported by ramosian.glider
on 2015-07-30 09:05:33
Adding Project:AddressSanitizer as part of GitHub migration.
Reported by ramosian.glider
on 2015-07-30 09:06:57
I would still really like to do this, it would drastically simplify deployment if users just have one .lib file to link against instead of one for exes and one for dlls.
This would make the ASan RTL into a DLL. Every DLL comes with a .lib import library, and that import library can actually contain real code. We should be able to jam the interceptors into the import library so that users only have one linker flag to think about.
Originally reported on Google Code with ID 332
Reported by
timurrrr@google.com
on 2014-08-08 13:58:38