Menu

#1269 Build with -fno-common fails

v1.0 (example)
closed-fixed
None
5
2020-03-16
2020-01-08
No

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

Discussion

  • Robert van Engelen

    Thanks for reporting this. Looks like an issue with Flex/Bison to build soapcpp2.

     
  • Robert van Engelen

    The initial investigation appears to suggest that soapcpp2_lex.l line 53 should be changed to:

    extern YYSTYPE yylval;
    

    By adding extern. The Bison-generated soapcpp2_yacc.tab.c file defines yylval in the static scope.

    Compiling soapcpp2 with -fno-common using clang 9 works. Also tried MSVC++ with success.

     
  • Robert van Engelen

    • status: open --> pending
    • assigned_to: Robert van Engelen
     
  • Robert van Engelen

    • status: pending --> closed-fixed
     

Log in to post a comment.