Add -fno-global-ctor-const-promotion option.
The global variable optimization pass of LLVM will try to evalutate the global variables with static constructors, and promote the global constants. Although this optimization is correct, it may cause some incompatability between gcc in some incorrect code, which uses const_cast to cast the constant to mutable. If you are compiling the legacy code, then you can try to add -fno-global-ctor-const-promotion to your CXXFLAGS. Change-Id: I24bae9f0bc82fbede0be35087ff5336eed300e5d
Loading
Please sign in to comment