nils-ohlmeier/sipsak

Fails to build with -fno-common

Closed this issue · 4 comments

The program fails to build with -fno-common (which is the default setting of gcc-10 and above).

To reproduce: add -fno-common to CFLAGS

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fno-common -std=gnu89 -Wall -fstack-protector -Wl,-O1 -Wl,--as-needed -o sipsak src/transport.o src/auth.o src/header_f.o src/helper.o src/md5.o src/request.o src/shoot.o src/sipsak.o src/exit_code.o -lgnutls -lcares
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0xc8): multiple definition of auth_username'; src/transport.o:(.bss+0xe8): first defined here /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0xf8): multiple definition of password'; src/transport.o:(.bss+0x118): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0x18c): multiple definition of verbose'; src/transport.o:(.bss+0x1ac): first defined here /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0x108): multiple definition of username'; src/transport.o:(.bss+0x128): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0x188): multiple definition of nameend'; src/transport.o:(.bss+0x1a8): first defined here /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0x184): multiple definition of namebeg'; src/transport.o:(.bss+0x1a4): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0xb0): multiple definition of authhash'; src/transport.o:(.bss+0xd0): first defined here /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/auth.o:(.bss+0x1a0): multiple definition of nonce_count'; src/transport.o:(.bss+0x1c0): first defined here
[and much more]

Thanks for the report.
Looks like I'll have to pay for the sins from my youth now ;-)

This will require some major surgery, which was probably overdue for a long time. But it will take some time to fix this properly.

After the initial code refactoring for fixing these warnings I want to do even more to clean up the code. But I just verified locally that current master compiles for me with gcc-10. So I'll close this and work on a new release, before continuing on more refactoring and test coverage.