Merge the end result of two upstream changes:
Original fix from 20141206:
+ modify MKlib_gen.sh to work around change in development version of
gcc introduced here:
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.htmlhttps://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
(reports by Marcus Shawcroft, Maohui Lei).
Later fixed in different manner in 20150725:
+ use alternate workaround for gcc 5.x feature (adapted from patch by
Mikhail Peselnik).