relic-toolkit / relic

Code
Other
452 stars 179 forks source link

Fix Linking of multiple builds with MULTI on #265

Closed tylerliu closed 1 year ago

tylerliu commented 1 year ago

When linking multiple Relic Builds with MULTI Macro for both libraries, building will result in the following error:

/usr/bin/ld: /usr/local/lib/librelic_s_type3.a(relic_core.c.o):(.bss+0x8): multiple definition of `core_thread_initializer'; /usr/local/lib/librelic_s_type1.a(relic_core.c.o):(.bss+0x8): first defined here
/usr/bin/ld: /usr/local/lib/librelic_s_type3.a(relic_core.c.o):(.bss+0x0): multiple definition of `core_init_ptr'; /usr/local/lib/librelic_s_type1.a(relic_core.c.o):(.bss+0x0): first defined here

I have modified the link-test demo to reproduce this error, and created macros for the affected symbols.

dfaranha commented 1 year ago

Thank you! I will do a bit of polishing after the merge, but the fix is highly appreciated. :)