Merge "Fix a crash while enabling shared (--enable-shared)"