milostatarevic / xiphos

UCI chess engine
GNU General Public License v3.0
73 stars 17 forks source link

Fix compilation with gcc 10 #17

Closed kdave closed 4 years ago

kdave commented 4 years ago

Build with gcc 10.2.1 fails with warnings like:

/usr/bin/ld: /tmp/cchxFSX2.o (symbol from plugin): in function set_killer_move': (.text+0x0): multiple definition ofsearch_settings'; /tmp/ccajauf3.o (symbol from plugin):(.text+0x0): first defined here

(All reported symbols: eval_material_moves, init_lmr, init_move_list, main, search_settings, set_pins_and_checks, shared_z_keys, test_checks_and_material_moves)

This is because there are some structures defined in .h (search.h and hash.h) and they end up defined multiple times in the objects, linker does not like it. This does not happen with gcc 9, but I haven't investigated why.

Fix that by splitting declaration and definition of search_settings, search_status and shared_z_keys.

milostatarevic commented 4 years ago

thanks @kdave!