static DR failing to link in release build with gcc 7.3.1
After fixing #2947 (closed):
FAILED: clients/bin32/tool.drcacheoff.burst_maps
: && /usr/bin/c++ -m32 -Wl,--hash-style=both -Wl,--as-needed clients/drcachesim/CMakeFiles/tool.drcacheoff.burst_maps.dir/tests/burst_maps.cpp.o -o clients/bin32/tool.drcacheoff.burst_maps -rdynamic lib32/release/libdynamorio_static.a -Wl,--whole-archive clients/lib32/release/libdrmemtrace_static.a -Wl,--no-whole-archive lib32/libdrhelper.a -ldl ext/lib32/release/libdrutil_static.a ext/lib32/release/libdrcovlib_static.a ext/lib32/release/libdrx_static.a ext/lib32/release/libdrreg_static.a ext/lib32/release/libdrmgr_static.a ext/lib32/release/libdrcontainers.a lib32/release/libdynamorio.so -Wl,-rpath,/work/dr/git/build_x86_rel_tests/lib32/release && /usr/bin/objcopy --only-keep-debug clients/bin32/tool.drcacheoff.burst_maps clients/bin32/tool.drcacheoff.burst_maps.debug && /usr/bin/objcopy --add-gnu-debuglink=clients/bin32/tool.drcacheoff.burst_maps.debug clients/bin32/tool.drcacheoff.burst_maps && /usr/bin/strip -g -x clients/bin32/tool.drcacheoff.burst_maps && :
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_subvdi3.o): In function `__subvdi3':
(.text+0x0): multiple definition of `__subvdi3'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_subvdi3.o):(.text+0x0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_mulvdi3.o): In function `__mulvdi3':
(.text+0x0): multiple definition of `__mulvdi3'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_mulvdi3.o):(.text+0x0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_floatdisf.o): In function `__floatdisf':
(.text+0x0): multiple definition of `__floatdisf'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(_floatdisf.o):(.text+0x0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o): In function `__bid64_div':
(.text+0x0): multiple definition of `__bid64_div'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o):(.text+0x0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o): In function `__bid64dq_div':
(.text+0x2030): multiple definition of `__bid64dq_div'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o):(.text+0x2030): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o): In function `__bid64qd_div':
(.text+0x6080): multiple definition of `__bid64qd_div'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o):(.text+0x6080): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o): In function `__bid64qq_div':
(.text+0xaaf0): multiple definition of `__bid64qq_div'
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_div.o):(.text+0xaaf0): first defined here
/usr/lib/gcc/x86_64-redhat-linux/7/32/libgcc.a(bid64_to_int32.o): In function `__bid64_to_int32_rnint':
(.text+0x0): multiple definition of `__bid64_to_int32_rnint'
<...>
It's not clear why this happens only to release build and not debug build.