I tried strip-ping generated binaries, but it didn’t help.
One thing I can probably do is excluding clang with disallowedReferences and doing post-hoc patching (like here) – but I don’t want to blindly patch things without knowing what I’m doing.
The only thing i can think of is fixDarwinDylibNames.
But some notes about your expression, anything that is only to help with the build process should go into nativeBuildInputs, so autoconf and automake should go there.
you can also take a look at the official dervation located at pkgs/development/libraries/grpc/default.nix in the repo
The only way to go is by investigation, a.k.a. trial and error. In you case the build depends on clang-wrapper, which is the compiler as been by the build system. the compiler itself does not see this wrapper.
The most probable reason for that string to be included in the build is in some kind of debug string kept around by the application. The reason it is not stripped is because it is not a debug info, but a real string.
Try to look around that string in the binary to see if it contains more debug info like that, and then try to find in the sources where that information is gathered and stored. Usually this occurs trough macros and defines.
Thanks! This was the crucial part. It turned out that clang -g was to blame for the debug info – I patched it out of the makefile and now my closure does not include the compiler anymore.