openssl: host build fails when ccache is enabled
[openwrt/staging/stintel.git] / toolchain / gcc / patches / 4.9-linaro / 020-fix_pr61144.patch
1 --- a/gcc/varpool.c
2 +++ b/gcc/varpool.c
3 @@ -329,8 +329,16 @@ ctor_for_folding (tree decl)
4
5 /* Variables declared 'const' without an initializer
6 have zero as the initializer if they may not be
7 - overridden at link or run time. */
8 - if (!DECL_INITIAL (real_decl)
9 + overridden at link or run time.
10 +
11 + It is actually requirement for C++ compiler to optimize const variables
12 + consistently. As a GNU extension, do not enfore this rule for user defined
13 + weak variables, so we support interposition on:
14 + static const int dummy = 0;
15 + extern const int foo __attribute__((__weak__, __alias__("dummy")));
16 + */
17 + if ((!DECL_INITIAL (real_decl)
18 + || (DECL_WEAK (decl) && !DECL_COMDAT (decl)))
19 && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl)))
20 return error_mark_node;
21