The crc32 function


I have a problem with conflicting functions between ROOT and other library. Roots libCore builds using crc32.c, which includes crc32() function. My software links to ROOT and through other library A to external libcrc32. libcrc32 also contains crc32(). Even though the prototypes have different parameters, according to gdb, a function from library A (when invoken through my software that also links to ROOT) calls crc32() not from libcrc32 (as it should) but from ROOT. Then it crashes.

It seems I can’t prevent ROOT myself from using core/zip/src/crc32.c or the whole zip part. Would you consider preventing the compiler/linker from exporting the crc32() function, so it can’t be used with other modules? Maybe declaring it as static would do the trick?

My ROOT version is 5.34.36 on 64 bit Debian 8.5

One thing before doing some changes for hiding the symbols is to use an external zlib instead of the bundled one. For that you need to disable ‘builtin_zlib’ (with -Dbuiltin_zlib=OFF) and locate the zlib of your system. Do you think this is possible?

Yes, I’ll try to do that. I just hope that zlib uses libcrc, not a built-in crc modules with similar conflict :wink:

OK, with external zlib there are no conflicts. Thank you!