Created attachment 217321 [details]
Fix build with -fno-common (clang 11 and gcc 10)
In base r364284, I imported clang 11 into head. Like gcc 10, it now defaults to -fno-common, meaning that duplicated global symbols will most likely lead to link errors. Here is a patch to fix this port's duplicated global symbols.
Sorry, the summary and description were not correct. In case of json-glib, it was a new clang 11 -Werror warning:
../json-glib/json-scanner.c:928:13: error: cast to smaller integer type 'GTokenType' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast]
*token_p = (GTokenType) value_p->v_symbol;
This is because v_symbol is a pointer and GTokenType is an enum (so int-like). Glib provides the GPOINTER_TO_INT macro for this purpose.
I've submitted upstream as https://gitlab.gnome.org/GNOME/json-glib/-/merge_requests/29
Committed, awaiting merge.
A commit references this bug:
Date: Sat Aug 22 09:37:47 UTC 2020
New revision: 545754
devel/json-glib: Fix build with llvm 11
Fix the build of devel/json-glib with llvm 11.
llvm 11 introduced a new warning relating to how to cast between void * and
enums, which json-glib are stumbling over.
Submitted by: dim