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

Chris Bieneman cbieneman at apple.com
Wed Aug 20 12:45:55 PDT 2014


I think Rafael’s suggestion of using the address of a global as the key to the option store gives us the ability to accomplish all our goals without introducing a string keyed option store.

I’ve updated my patches from the original proposal to reflect those changes.

Does this look reasonable?

Thanks,
-Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl_opt.diff
Type: application/octet-stream
Size: 9063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140820/b1f47c9b/attachment.obj>
-------------- next part --------------

> On Aug 20, 2014, at 12:41 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
>>> 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
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list