[LLVMdev] [RFC] Removing static initializers for command line options

Rafael Espíndola rafael.espindola at gmail.com
Wed Aug 20 12:41:32 PDT 2014


>> Pass the passinfo to the pass constructor maybe?
>>
>> I still don't understand what the problem with the global is. It has
>> the same value for all users. As Chandler pointed out, having
>
> Globals are bad for many reasons: namespace pollution, concurrency issues, lack of access control, etc. etc.. Some of them have been discussed in this thread. Perhaps it’s not a big concern for most of the LLVM users. But we have an unique environment where LLVM is shared by multiple clients, and where the concern around exploits are especially strong. So while eliminating globals is not strictly tied to the elimination of static initializers, it is still a strong goal towards providing a LLVM dylib.

Fair enough. I would still make at separate stage since how to remove
them is the part that is still a bit contentious. Note that from a
security point of view a well known string probably makes things worse
than the global option storage since the address of the storage is at
least randomized.

It seems that both mine and Peter's proposal would avoid the global
storage and not introduce well known string for setting the options.

Cheers,
Rafael




More information about the llvm-dev mailing list