multiple definition of ms_* global variable with gcc-10

Bug #1909135 reported by shiftag
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmemcached
New
Undecided
Unassigned

Bug Description

Hello,

I can't build libmemcached-1.0.18 because of multiple definition error at make step (I guess it comes from the linker):

[...]
/bin/sh ./libtool --tag=CXX --mode=link c++ -std=c++0x -O2 -fPIC -g -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Wvarargs -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmaybe-uninitialized -Wmissing-field-initializers -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wc++11-compat -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -Wformat-security -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked -o clients/memaslap clients/memaslap.o clients/ms_conn.o clients/ms_setting.o clients/ms_sigsegv.o clients/ms_stats.o clients/ms_task.o clients/ms_thread.o clients/generator.o clients/execute.o -levent clients/libutilities.la libmemcached/libmemcached.la
libtool: link: c++ -std=c++0x -O2 -fPIC -g -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Wvarargs -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmaybe-uninitialized -Wmissing-field-initializers -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wc++11-compat -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -Wformat-security -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked -o clients/.libs/memaslap clients/memaslap.o clients/ms_conn.o clients/ms_setting.o clients/ms_sigsegv.o clients/ms_stats.o clients/ms_task.o clients/ms_thread.o clients/generator.o clients/execute.o -levent clients/.libs/libutilities.a libmemcached/.libs/libmemcached.so -lpthread -ldl -lsasl2 -pthread
/usr/bin/ld: clients/ms_conn.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: multiple definition of `ms_stats'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: first defined here
/usr/bin/ld: clients/ms_conn.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: multiple definition of `ms_global'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: first defined here
/usr/bin/ld: clients/ms_conn.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: multiple definition of `ms_statistic'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: first defined here
/usr/bin/ld: clients/ms_setting.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: multiple definition of `ms_statistic'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: first defined here
/usr/bin/ld: clients/ms_setting.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: multiple definition of `ms_stats'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: first defined here
/usr/bin/ld: clients/ms_setting.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: multiple definition of `ms_global'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: first defined here
/usr/bin/ld: clients/ms_sigsegv.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: multiple definition of `ms_global'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: first defined here
/usr/bin/ld: clients/ms_sigsegv.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: multiple definition of `ms_statistic'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: first defined here
/usr/bin/ld: clients/ms_sigsegv.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: multiple definition of `ms_stats'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: first defined here
/usr/bin/ld: clients/ms_task.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: multiple definition of `ms_global'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: first defined here
/usr/bin/ld: clients/ms_task.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: multiple definition of `ms_stats'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: first defined here
/usr/bin/ld: clients/ms_task.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: multiple definition of `ms_statistic'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: first defined here
/usr/bin/ld: clients/ms_thread.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: multiple definition of `ms_stats'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:123: first defined here
/usr/bin/ld: clients/ms_thread.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: multiple definition of `ms_global'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:120: first defined here
/usr/bin/ld: clients/ms_thread.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: multiple definition of `ms_statistic'; clients/memaslap.o:/tmp/libmemcached-1.0.18/clients/ms_memslap.h:126: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:4708: clients/memaslap] Error 1
make[1]: Leaving directory '/tmp/libmemcached-1.0.18'
make: *** [Makefile:3700: all] Error 2

Looking at the source code I didn't find any multiple definition of those global variables so maybe it comes from gcc-10.2.0 ?

Revision history for this message
shiftag (shiftag) wrote :

I just made a test with gcc-9.3.0 and it works fine. So maybe it seems the issue come from gcc-10.2.0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.