SX-Aurora / Vftrace

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

Linker options can break symbols tests #43

Closed MeisterEule closed 2 years ago

MeisterEule commented 2 years ago

The symbols tests rely on the assumption that protofunc.c is linked in such a way that all symbols in there are included in the test binary. The linking is forced by calling protofunc_0_0. However, this function only calls protofunc_[1-6]_0 functions. This means that most of the symbols are not used. With standard settings, they are included in the symbol table anyhow. However, there exists a linker option to exclude unused symbols: --gc-sections. The problem is that this has been observed to appear in the linker options that autotools automatically generates for some setups. It is not yet clear to me how it decides which options to use and which not.

I think that it's not worthwhile to tinker with autotools so that this option never appears. Instead, I see these alternatives:

MeisterEule commented 2 years ago

This issue does not appear when you specify CXX=g++.

SpinTensor commented 2 years ago

Should be solved by commit f757ee41a90c86e99b3baa775a975816f692d12f. There was a bug in the protofunctions that not all of them were part of the calling structure. Now all of them are called, thus always linked, independent of the linker flags. You may test it and close this issue.

SpinTensor commented 2 years ago

Can this be closed?

MeisterEule commented 2 years ago

Yes