Fails to build with gcc 10 and gcc 11 #8

Closed
opened 3 months ago by moht · 1 comments
moht commented 3 months ago

I finally found some time to work on gfsecret upgrade for Debian packaging and found that the new version doesn't build with gcc-10 (default Debian/sid version) or gcc-11 with the same "multiple definition of 'xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here":

$ CC=gcc-10 ./configure
[...]
$ make
make  all-recursive
make[1]: Entering directory '/home/thomas/code/gfsecret'
Making all in po
make[2]: Entering directory '/home/thomas/code/gfsecret/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/thomas/code/gfsecret/po'
Making all in lib
make[2]: Entering directory '/home/thomas/code/gfsecret/lib'
gcc-10 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT splitstr.o -MD -MP -MF .deps/splitstr.Tpo -c -o splitstr.o splitstr.c
mv -f .deps/splitstr.Tpo .deps/splitstr.Po
gcc-10 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT xmem.o -MD -MP -MF .deps/xmem.Tpo -c -o xmem.o xmem.c
xmem.c: In function 'xstrdup':
xmem.c:82:5: warning: 'strcpy' writing one too many bytes into a region of a size that depends on 'strlen' [-Wstringop-overflow=]
  82 |     strcpy(dup, s);
     |     ^~~~~~~~~~~~~~
xmem.c:79:19: note: at offset 0 to an object allocated by 'malloc' here
  79 |     if ( ! (dup = malloc(len)) )
     |                   ^~~~~~~~~~~
mv -f .deps/xmem.Tpo .deps/xmem.Po
gcc-10 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT xdg.o -MD -MP -MF .deps/xdg.Tpo -c -o xdg.o xdg.c
mv -f .deps/xdg.Tpo .deps/xdg.Po
rm -f libgfsecret.a
ar cru libgfsecret.a splitstr.o xmem.o xdg.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libgfsecret.a
make[2]: Leaving directory '/home/thomas/code/gfsecret/lib'
Making all in src
make[2]: Entering directory '/home/thomas/code/gfsecret/src'
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT gfsec-use.o -MD -MP -MF .deps/gfsec-use.Tpo -c -o gfsec-use.o gfsec-use.c
mv -f .deps/gfsec-use.Tpo .deps/gfsec-use.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT secret.o -MD -MP -MF .deps/secret.Tpo -c -o secret.o secret.c
mv -f .deps/secret.Tpo .deps/secret.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT secretcfg.o -MD -MP -MF .deps/secretcfg.Tpo -c -o secretcfg.o secretcfg.c
mv -f .deps/secretcfg.Tpo .deps/secretcfg.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-module.o -MD -MP -MF .deps/scheme-module.Tpo -c -o scheme-module.o scheme-module.c
mv -f .deps/scheme-module.Tpo .deps/scheme-module.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-libmtp.o -MD -MP -MF .deps/scheme-libmtp.Tpo -c -o scheme-libmtp.o scheme-libmtp.c
mv -f .deps/scheme-libmtp.Tpo .deps/scheme-libmtp.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-gio.o -MD -MP -MF .deps/scheme-gio.Tpo -c -o scheme-gio.o scheme-gio.c
mv -f .deps/scheme-gio.Tpo .deps/scheme-gio.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-file.o -MD -MP -MF .deps/scheme-file.Tpo -c -o scheme-file.o scheme-file.c
mv -f .deps/scheme-file.Tpo .deps/scheme-file.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-libcurl.o -MD -MP -MF .deps/scheme-libcurl.Tpo -c -o scheme-libcurl.o scheme-libcurl.c
mv -f .deps/scheme-libcurl.Tpo .deps/scheme-libcurl.Po
gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT support.o -MD -MP -MF .deps/support.Tpo -c -o support.o support.c
mv -f .deps/support.Tpo .deps/support.Po
rm -f libgfsec.a
ar cru libgfsec.a util.o secret.o secretcfg.o scheme-module.o scheme-libmtp.o scheme-gio.o scheme-file.o scheme-libcurl.o support.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libgfsec.a
gcc-10  -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -L../lib  -o gfsec-use gfsec-use.o libgfsec.a -lgfsecret -L/usr/lib/x86_64-linux-gnu -lgcrypt -lgfshare -lmtp -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcurl
/usr/bin/ld: ../lib/libgfsecret.a(xdg.o):/home/thomas/code/gfsecret/lib/./xdg.h:29: multiple definition of `xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:469: gfsec-use] Error 1
make[2]: Leaving directory '/home/thomas/code/gfsecret/src'
make[1]: *** [Makefile:464: all-recursive] Error 1
make[1]: Leaving directory '/home/thomas/code/gfsecret'
make: *** [Makefile:384: all] Error 2
$ CC=gcc-11 ./configure
[...]
$ make  # runned 'make clean' before
make  all-recursive
make[1]: Entering directory '/home/thomas/code/gfsecret'
Making all in po
make[2]: Entering directory '/home/thomas/code/gfsecret/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/thomas/code/gfsecret/po'
Making all in lib
make[2]: Entering directory '/home/thomas/code/gfsecret/lib'
gcc-11 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT splitstr.o -MD -MP -MF .deps/splitstr.Tpo -c -o splitstr.o splitstr.c
mv -f .deps/splitstr.Tpo .deps/splitstr.Po
gcc-11 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT xmem.o -MD -MP -MF .deps/xmem.Tpo -c -o xmem.o xmem.c
xmem.c: In function 'xstrdup':
xmem.c:82:5: warning: 'strcpy' writing one too many bytes into a region of a size that depends on 'strlen' [-Wstringop-overflow=]
   82 |     strcpy(dup, s);
      |     ^~~~~~~~~~~~~~
xmem.c:79:19: note: destination object of size [0, 9223372036854775805] allocated by 'malloc'
   79 |     if ( ! (dup = malloc(len)) )
      |                   ^~~~~~~~~~~
mv -f .deps/xmem.Tpo .deps/xmem.Po
gcc-11 -DHAVE_CONFIG_H -I. -I..     -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT xdg.o -MD -MP -MF .deps/xdg.Tpo -c -o xdg.o xdg.c
mv -f .deps/xdg.Tpo .deps/xdg.Po
rm -f libgfsecret.a
ar cru libgfsecret.a splitstr.o xmem.o xdg.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libgfsecret.a
make[2]: Leaving directory '/home/thomas/code/gfsecret/lib'
Making all in src
make[2]: Entering directory '/home/thomas/code/gfsecret/src'
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT gfsec-use.o -MD -MP -MF .deps/gfsec-use.Tpo -c -o gfsec-use.o gfsec-use.c
mv -f .deps/gfsec-use.Tpo .deps/gfsec-use.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT secret.o -MD -MP -MF .deps/secret.Tpo -c -o secret.o secret.c
mv -f .deps/secret.Tpo .deps/secret.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT secretcfg.o -MD -MP -MF .deps/secretcfg.Tpo -c -o secretcfg.o secretcfg.c
mv -f .deps/secretcfg.Tpo .deps/secretcfg.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-module.o -MD -MP -MF .deps/scheme-module.Tpo -c -o scheme-module.o scheme-module.c
mv -f .deps/scheme-module.Tpo .deps/scheme-module.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-libmtp.o -MD -MP -MF .deps/scheme-libmtp.Tpo -c -o scheme-libmtp.o scheme-libmtp.c
mv -f .deps/scheme-libmtp.Tpo .deps/scheme-libmtp.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-gio.o -MD -MP -MF .deps/scheme-gio.Tpo -c -o scheme-gio.o scheme-gio.c
mv -f .deps/scheme-gio.Tpo .deps/scheme-gio.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-file.o -MD -MP -MF .deps/scheme-file.Tpo -c -o scheme-file.o scheme-file.c
mv -f .deps/scheme-file.Tpo .deps/scheme-file.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT scheme-libcurl.o -MD -MP -MF .deps/scheme-libcurl.Tpo -c -o scheme-libcurl.o scheme-libcurl.c
mv -f .deps/scheme-libcurl.Tpo .deps/scheme-libcurl.Po
gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib   -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -MT support.o -MD -MP -MF .deps/support.Tpo -c -o support.o support.c
mv -f .deps/support.Tpo .deps/support.Po
rm -f libgfsec.a
ar cru libgfsec.a util.o secret.o secretcfg.o scheme-module.o scheme-libmtp.o scheme-gio.o scheme-file.o scheme-libcurl.o support.o 
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libgfsec.a
gcc-11  -g -O2   -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -L../lib  -o gfsec-use gfsec-use.o libgfsec.a -lgfsecret -L/usr/lib/x86_64-linux-gnu -lgcrypt -lgfshare -lmtp -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcurl
/usr/bin/ld: ../lib/libgfsecret.a(xdg.o):/home/thomas/code/gfsecret/lib/./xdg.h:29: multiple definition of `xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:469: gfsec-use] Error 1
make[2]: Leaving directory '/home/thomas/code/gfsecret/src'
make[1]: *** [Makefile:464: all-recursive] Error 1
make[1]: Leaving directory '/home/thomas/code/gfsecret'
make: *** [Makefile:384: all] Error 2

I tried to be clever and check if it was related to #2 but couldn't figure out anything.

Edit: forgot to say that it builds fine with gcc-9

I finally found some time to work on gfsecret upgrade for Debian packaging and found that the new version doesn't build with gcc-10 (default Debian/sid version) or gcc-11 with the same "`multiple definition of 'xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here`": ```bash $ CC=gcc-10 ./configure [...] $ make make all-recursive make[1]: Entering directory '/home/thomas/code/gfsecret' Making all in po make[2]: Entering directory '/home/thomas/code/gfsecret/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/thomas/code/gfsecret/po' Making all in lib make[2]: Entering directory '/home/thomas/code/gfsecret/lib' gcc-10 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT splitstr.o -MD -MP -MF .deps/splitstr.Tpo -c -o splitstr.o splitstr.c mv -f .deps/splitstr.Tpo .deps/splitstr.Po gcc-10 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT xmem.o -MD -MP -MF .deps/xmem.Tpo -c -o xmem.o xmem.c xmem.c: In function 'xstrdup': xmem.c:82:5: warning: 'strcpy' writing one too many bytes into a region of a size that depends on 'strlen' [-Wstringop-overflow=] 82 | strcpy(dup, s); | ^~~~~~~~~~~~~~ xmem.c:79:19: note: at offset 0 to an object allocated by 'malloc' here 79 | if ( ! (dup = malloc(len)) ) | ^~~~~~~~~~~ mv -f .deps/xmem.Tpo .deps/xmem.Po gcc-10 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT xdg.o -MD -MP -MF .deps/xdg.Tpo -c -o xdg.o xdg.c mv -f .deps/xdg.Tpo .deps/xdg.Po rm -f libgfsecret.a ar cru libgfsecret.a splitstr.o xmem.o xdg.o ar: `u' modifier ignored since `D' is the default (see `U') ranlib libgfsecret.a make[2]: Leaving directory '/home/thomas/code/gfsecret/lib' Making all in src make[2]: Entering directory '/home/thomas/code/gfsecret/src' gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT gfsec-use.o -MD -MP -MF .deps/gfsec-use.Tpo -c -o gfsec-use.o gfsec-use.c mv -f .deps/gfsec-use.Tpo .deps/gfsec-use.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c mv -f .deps/util.Tpo .deps/util.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT secret.o -MD -MP -MF .deps/secret.Tpo -c -o secret.o secret.c mv -f .deps/secret.Tpo .deps/secret.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT secretcfg.o -MD -MP -MF .deps/secretcfg.Tpo -c -o secretcfg.o secretcfg.c mv -f .deps/secretcfg.Tpo .deps/secretcfg.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-module.o -MD -MP -MF .deps/scheme-module.Tpo -c -o scheme-module.o scheme-module.c mv -f .deps/scheme-module.Tpo .deps/scheme-module.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-libmtp.o -MD -MP -MF .deps/scheme-libmtp.Tpo -c -o scheme-libmtp.o scheme-libmtp.c mv -f .deps/scheme-libmtp.Tpo .deps/scheme-libmtp.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-gio.o -MD -MP -MF .deps/scheme-gio.Tpo -c -o scheme-gio.o scheme-gio.c mv -f .deps/scheme-gio.Tpo .deps/scheme-gio.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-file.o -MD -MP -MF .deps/scheme-file.Tpo -c -o scheme-file.o scheme-file.c mv -f .deps/scheme-file.Tpo .deps/scheme-file.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-libcurl.o -MD -MP -MF .deps/scheme-libcurl.Tpo -c -o scheme-libcurl.o scheme-libcurl.c mv -f .deps/scheme-libcurl.Tpo .deps/scheme-libcurl.Po gcc-10 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT support.o -MD -MP -MF .deps/support.Tpo -c -o support.o support.c mv -f .deps/support.Tpo .deps/support.Po rm -f libgfsec.a ar cru libgfsec.a util.o secret.o secretcfg.o scheme-module.o scheme-libmtp.o scheme-gio.o scheme-file.o scheme-libcurl.o support.o ar: `u' modifier ignored since `D' is the default (see `U') ranlib libgfsec.a gcc-10 -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -L../lib -o gfsec-use gfsec-use.o libgfsec.a -lgfsecret -L/usr/lib/x86_64-linux-gnu -lgcrypt -lgfshare -lmtp -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcurl /usr/bin/ld: ../lib/libgfsecret.a(xdg.o):/home/thomas/code/gfsecret/lib/./xdg.h:29: multiple definition of `xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here collect2: error: ld returned 1 exit status make[2]: *** [Makefile:469: gfsec-use] Error 1 make[2]: Leaving directory '/home/thomas/code/gfsecret/src' make[1]: *** [Makefile:464: all-recursive] Error 1 make[1]: Leaving directory '/home/thomas/code/gfsecret' make: *** [Makefile:384: all] Error 2 ``` ```bash $ CC=gcc-11 ./configure [...] $ make # runned 'make clean' before make all-recursive make[1]: Entering directory '/home/thomas/code/gfsecret' Making all in po make[2]: Entering directory '/home/thomas/code/gfsecret/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/thomas/code/gfsecret/po' Making all in lib make[2]: Entering directory '/home/thomas/code/gfsecret/lib' gcc-11 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT splitstr.o -MD -MP -MF .deps/splitstr.Tpo -c -o splitstr.o splitstr.c mv -f .deps/splitstr.Tpo .deps/splitstr.Po gcc-11 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT xmem.o -MD -MP -MF .deps/xmem.Tpo -c -o xmem.o xmem.c xmem.c: In function 'xstrdup': xmem.c:82:5: warning: 'strcpy' writing one too many bytes into a region of a size that depends on 'strlen' [-Wstringop-overflow=] 82 | strcpy(dup, s); | ^~~~~~~~~~~~~~ xmem.c:79:19: note: destination object of size [0, 9223372036854775805] allocated by 'malloc' 79 | if ( ! (dup = malloc(len)) ) | ^~~~~~~~~~~ mv -f .deps/xmem.Tpo .deps/xmem.Po gcc-11 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT xdg.o -MD -MP -MF .deps/xdg.Tpo -c -o xdg.o xdg.c mv -f .deps/xdg.Tpo .deps/xdg.Po rm -f libgfsecret.a ar cru libgfsecret.a splitstr.o xmem.o xdg.o ar: `u' modifier ignored since `D' is the default (see `U') ranlib libgfsecret.a make[2]: Leaving directory '/home/thomas/code/gfsecret/lib' Making all in src make[2]: Entering directory '/home/thomas/code/gfsecret/src' gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT gfsec-use.o -MD -MP -MF .deps/gfsec-use.Tpo -c -o gfsec-use.o gfsec-use.c mv -f .deps/gfsec-use.Tpo .deps/gfsec-use.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c mv -f .deps/util.Tpo .deps/util.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT secret.o -MD -MP -MF .deps/secret.Tpo -c -o secret.o secret.c mv -f .deps/secret.Tpo .deps/secret.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT secretcfg.o -MD -MP -MF .deps/secretcfg.Tpo -c -o secretcfg.o secretcfg.c mv -f .deps/secretcfg.Tpo .deps/secretcfg.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-module.o -MD -MP -MF .deps/scheme-module.Tpo -c -o scheme-module.o scheme-module.c mv -f .deps/scheme-module.Tpo .deps/scheme-module.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-libmtp.o -MD -MP -MF .deps/scheme-libmtp.Tpo -c -o scheme-libmtp.o scheme-libmtp.c mv -f .deps/scheme-libmtp.Tpo .deps/scheme-libmtp.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-gio.o -MD -MP -MF .deps/scheme-gio.Tpo -c -o scheme-gio.o scheme-gio.c mv -f .deps/scheme-gio.Tpo .deps/scheme-gio.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-file.o -MD -MP -MF .deps/scheme-file.Tpo -c -o scheme-file.o scheme-file.c mv -f .deps/scheme-file.Tpo .deps/scheme-file.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT scheme-libcurl.o -MD -MP -MF .deps/scheme-libcurl.Tpo -c -o scheme-libcurl.o scheme-libcurl.c mv -f .deps/scheme-libcurl.Tpo .deps/scheme-libcurl.Po gcc-11 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -MT support.o -MD -MP -MF .deps/support.Tpo -c -o support.o support.c mv -f .deps/support.Tpo .deps/support.Po rm -f libgfsec.a ar cru libgfsec.a util.o secret.o secretcfg.o scheme-module.o scheme-libmtp.o scheme-gio.o scheme-file.o scheme-libcurl.o support.o ar: `u' modifier ignored since `D' is the default (see `U') ranlib libgfsec.a gcc-11 -g -O2 -I/usr/include/libusb-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -L../lib -o gfsec-use gfsec-use.o libgfsec.a -lgfsecret -L/usr/lib/x86_64-linux-gnu -lgcrypt -lgfshare -lmtp -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcurl /usr/bin/ld: ../lib/libgfsecret.a(xdg.o):/home/thomas/code/gfsecret/lib/./xdg.h:29: multiple definition of `xdg'; gfsec-use.o:/home/thomas/code/gfsecret/src/../lib/xdg.h:29: first defined here collect2: error: ld returned 1 exit status make[2]: *** [Makefile:469: gfsec-use] Error 1 make[2]: Leaving directory '/home/thomas/code/gfsecret/src' make[1]: *** [Makefile:464: all-recursive] Error 1 make[1]: Leaving directory '/home/thomas/code/gfsecret' make: *** [Makefile:384: all] Error 2 ``` I tried to be clever and check if it was related to #2 but couldn't figure out anything. Edit: forgot to say that it builds fine with gcc-9
Owner

Ah yes, the -fno-common flag that is now enabled by default with gcc ≥ 10. I’ll fix that right now, thanks!

Ah yes, the `-fno-common` flag that is now enabled by default with gcc ≥ 10. I’ll fix that right now, thanks!
damien closed this issue 3 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.