GCC LTO failure with undefined symbol

陈云星 chen.yunxing@me.com
Mon May 10 09:04:03 GMT 2021


Hi, folks:

We are use gcc-9.3 and -flto, and after long time of linking (I can see the lto-trans process running in top), it failed with following errors:


/.vos/.ob-compile/tmp/yunxing.cyx/observer.05Wd4V.ltrans57.ltrans.o:(.debug_info+0xf0bf8): undefined reference to `zstd_opt.c.656c57f4'                                         
/.vos/.ob-compile/tmp/yunxing.cyx/observer.05Wd4V.ltrans57.ltrans.o:(.debug_info+0xf0c01): undefined reference to `zstd_opt.c.656c57f4'              
/.vos/.ob-compile/tmp/yunxing.cyx/observer.05Wd4V.ltrans57.ltrans.o:(.debug_info+0xf0c0a): undefined reference to `zstd_opt.c.656c57f4'                   
/.vos/.ob-compile/tmp/yunxing.cyx/observer.05Wd4V.ltrans57.ltrans.o:(.debug_info+0xf0c0f): more undefined references to `zstd_opt.c.656c57f4' follow 

What’s wrong with this error ? 

My configuration of CXX_FLAGS and other CMAKE configs are:

 set(CMAKE_CXX_FLAGS "${LD_OPT} -fuse-ld=bfd -flto -fdiagnostics-color ${REORDER_COMP_OPT}")
set(CMAKE_C_FLAGS "${LD_OPT} -fuse-ld=bfd -flto -fdiagnostics-color ${REORDER_COMP_OPT}")
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=bfd -flto -z noexecstack ${REORDER_LINK_OPT}")
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=bfd -flto -z noexecstack ${REORDER_LINK_OPT}")
SET(CMAKE_RANLIB "/usr/local/gcc-9.3.0/bin/gcc-ranlib" CACHE FILEPATH "Runlib")
SET(CMAKE_AR "/usr/local/gcc-9.3.0/bin/gcc-ar" CACHE FILEPATH "Arhiver”)

Thanks !


More information about the Gcc-help mailing list