Created attachment 592122 [details] build.log It seems like a bug in the source as "pub_shared.o" contains "cfg" definition, and "rr_client.o" contains it as well.
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/8.3.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: error: pub_shared.o: multiple definition of 'cfg' /usr/lib/gcc/armv7a-unknown-linux-gnueabihf/8.3.0/../../../../armv7a-unknown-linux-gnueabihf/bin/ld: rr_client.o: previous definition here collect2: error: ld returned 1 exit status make[1]: *** [Makefile:39: mosquitto_rr] Error 1
Found out that it's caused by switch "-fno-common" in my make.conf. -fno-common In C code, this option controls the placement of global variables defined without an initializer, known as tentative definitions in the C standard. Tentative definitions are distinct from declarations of a variable with the extern keyword, which do not allocate storage. Unix C compilers have traditionally allocated storage for uninitialized global variables in a common block. This allows the linker to resolve all tentative definitions of the same variable in different compilation units to the same object, or to a non-tentative definition. This is the behavior specified by -fcommon, and is the default for GCC on most targets. On the other hand, this behavior is not required by ISO C, and on some targets may carry a speed or code size penalty on variable references. The -fno-common option specifies that the compiler should instead place uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is defined in more than one compilation unit. Compiling with -fno-common is useful on targets for which it provides better performance, or if you wish to verify that the program will work on other systems that always treat uninitialized variable definitions this way.
I doubt we're going to fix something like this in Gentoo. My advice would be to file an issue at https://github.com/eclipse/mosquitto I expect the solution is to add an 'extern' keyword somewhere.
Agreed, already posted issue on Github. You're right there must be 'extern' in rr_client.c on line 50 before the definition of 'cfg'. Let's hope it'll be fixed in the next release. You may close this issue.
Thanks. Looks like this was fixed by commit 8a4ae28fa926589e9891674ca4424dc703ad2d88 Author: Roger A. Light <roger@atchoo.org> Date: Wed Oct 9 14:01:44 2019 +0100 Fix duplicate cfg definition in rr_client. Closes #1453. Thanks to jveber. and will presumably be in v1.6.8.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c16ad6e181ac72bc15ad81ff394e8d52858ba04 commit 7c16ad6e181ac72bc15ad81ff394e8d52858ba04 Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2019-12-20 20:40:59 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2019-12-20 21:58:53 +0000 app-misc/mosquitto: Version bump to 1.6.8 Closes: https://bugs.gentoo.org/696946 Closes: https://bugs.gentoo.org/700816 Signed-off-by: Matt Turner <mattst88@gentoo.org> app-misc/mosquitto/Manifest | 1 + app-misc/mosquitto/mosquitto-1.6.8.ebuild | 114 ++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+)