SX-Aurora / Vftrace

GNU General Public License v3.0
10 stars 2 forks source link

Linker fails with mutiple definition of symbols #4

Closed sbrass closed 4 years ago

sbrass commented 4 years ago

Hey developers,

the link process at the end of make fails with /usr/bin/ld: src/.libs/libvftrace_la-vftr_hwcounters.o:(.bss+0xa0): multiple definition of 'scenario_expr_cycletime'; src/.libs/libvftrace_la-vftr_scenarios.o:(.bss+0x1e8): first defined here (and more of those errors, see attached log).

config.log make.log

Reproduce:

autoreconf -i
mkdir _build && pushd _build
../configure CC=gcc CXX=g++ FC=gfortran --prefix=$(pwd)/install | tee config.log
make | tee make.log

Versions: autoconf (GNU Autoconf) 2.69 automake (GNU automake) 1.16.2 libtool (GNU libtool) 2.4.6 GNU ld (GNU Binutils) 2.34.0 gcc (GCC) 10.1.0

Cheers, Simon

sbrass commented 4 years ago

A short update: I've just built Vftrace with Meson...

MeisterEule commented 4 years ago

Hi Simon,

unfortunately I could not reproduce your issue. Also, from your attached file, I cannot see any problem. However, I used gcc 8, maybe it's an issue arising with gcc 10, which would be weird. I will check it with gcc 10, but right now I cannot install it...

The Meson build sounds interesting! I would be delighted if you could create a branch with it. Every alternative to autotools is welcome.

sbrass commented 4 years ago

Hi guys,

the error can be reproduced with the flag -fno-common, which is the now default since GCC10, see: https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common. I've added -fcommon as compiler flag and the compilation/linking works as intended.

Cheers, Simon.

PS: I'll add a pull request ;).