gnulib configure wrongly defines HAVE_WEAK_SYMBOLS, backport a patch to fix the resulting crashes. Fixes #2748