Build with -fno-common fails
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
Rationale: https://bugzilla.opensuse.org/show_bug.cgi?id=1160244
Building gsoap with -fno-common
leads to an error in current gsoap 2.8.96/97:
./configure CFLAGS="-O0 -ggdb3 -fno-common"; make [...] make[4]: Entering directory '/home/jengelh/gsoap-2.8.97/gsoap/src' gcc -DWITH_BISON -DWITH_FLEX -DSOAPCPP2_IMPORT_PATH="\"/usr/local/share/gsoap/import\"" -DLINUX -O0 -ggdb3 -fno-common -o soapcpp2 soapcpp2-soapcpp2_yacc.o soapcpp2-soapcpp2_lex.o soapcpp2-symbol2.o soapcpp2-error2.o soapcpp2-init2.o soapcpp2-soapcpp2.o -lfl /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: soapcpp2-soapcpp2_lex.o:(.bss+0x2040): multiple definition of `yylval'; soapcpp2-soapcpp2_yacc.o:(.bss+0xb20): first defined here collect2: error: ld returned 1 exit status
Thanks for reporting this. Looks like an issue with Flex/Bison to build soapcpp2.
The initial investigation appears to suggest that
soapcpp2_lex.l
line 53 should be changed to:By adding
extern
. The Bison-generatedsoapcpp2_yacc.tab.c
file definesyylval
in the static scope.Compiling soapcpp2 with
-fno-common
using clang 9 works. Also tried MSVC++ with success.