I have a binary executable mytest
, created with Clang and bfd/lld, and in order for it to work correctly I have to pass the environment variable ASAN_OPTIONS="use_sigaltstack=1"
to it, but I want to avoid having to manually type that in every time I want to run the executable from the command line.
I could create a wrapper script, of course, but that adds more complexity.
Is there a way, when creating the binary, to attach the environment variable and its value to the binary so that it is automatically set when execution begins?
It is too late to set the environment variable in my code, because Asan reads the environment variable before my code starts running.