Open nardi opened 4 years ago
I've figured it out, from GCC 10 (May 2020) the default behavior has changed. Multiple (consistent) declarations of a global variable used to be okay, but now they give an error if not prefixed with extern
. A quick fix would be to add the gcc option -fcommon
but it should probably still be fixed in the header generator by adding extern
in front of variable declarations :)
I get the same problem. Thanks for pointing out about GCC 10, as unfortunately clang doesn't buid either, it bails out with an error about some system header file :/
Could anyone point me to where in the source code the invocation of GCC is located to add said -fcommon switch?
Edit: Indeed it is the solution, with a wrapper script the problem is gone!
/usr/bin/gcc-fcommon:
gcc -fcommon $*
export CC=gcc-fcommon
better is to add -fcommon
to the command line in toolchain/linux-gcc in the kit source directory (not build which is created in the folder from where the compiler is called)
I made a simple file
hello.kit
file containing:and tried to compile it using
kitc hello.kit
. At the linking stage I get a bunch of "multiple definition" errors for all kinds of symbols (e.g.kit_mem_Allocator__...
). This seems logical, as the generatedbuild/include/main.h
file contains these definitions, but it is included in every .c-file and does not contain a header guard or similar. I assume this is not intended behavior, so what could be going wrong on my side?Environment
I see mingw32 here, not mingw64, is that a problem? I got it from the scoop package, but am using my existing install of gcc-mingw64 via msys2.