← Back to team overview

kicad-developers team mailing list archive

Linker Error (self made...)

 

I was trying to do a fresh build of master with the address sanitizer
enabled in Clang, and I am receiving a strange linker error, and was
curious if anyone else had any thoughts on it.

When it tries to link the eeschema executable, it throws an error
complaining about a missing Kiface symbol:

Scanning dependencies of target eeschema
[ 63%] Building CXX object
eeschema/CMakeFiles/eeschema.dir/__/common/single_top.cpp.o
[ 63%] Building CXX object
eeschema/CMakeFiles/eeschema.dir/__/common/pgm_base.cpp.o
[ 63%] Linking CXX executable eeschema
ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:538
(/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:538)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::config()) in
archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:546
(/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:546)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::sys_search()) in
archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:552
(/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:552)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::help_name()) in
archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:568
(/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:568)
>>>
eda_base_frame.cpp.o:(EDA_BASE_FRAME::UpdateFileHistory(wxString const&,
wxFileHistory*)) in archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:580
(/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:580)
>>>
eda_base_frame.cpp.o:(EDA_BASE_FRAME::GetFileFromHistory(int, wxString
const&, wxFileHistory*)) in archive ../common/libcommon.a

That symbol is defined in the _eeschema.kiface module though.

The verbose linker message is attached. Does anyone have any thoughts as to
why it seems the executable is unable to find the symbol when I enable the
address sanitizer?

Thanks,
-Ian
[imcinerney@kicad-wx ~/Documents/dev/kicad/code/master/build/widgets31/eeschema]$ "/usr/bin/ld.lld" -export-dynamic --hash-style=gnu --no-add-needed --build-id --eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o eeschema /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o /usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtbegin.o -L/usr/local/lib -L/usr/local/lib -L/usr/bin/../lib/gcc/x86_64-redhat-linux/9 -L/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib --whole-archive /usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive --dynamic-list=/usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan-x86_64.a.syms --whole-archive /usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a --no-whole-archive --dynamic-list=/usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a.syms CMakeFiles/eeschema.dir/__/common/single_top.cpp.o CMakeFiles/eeschema.dir/__/common/pgm_base.cpp.o -rpath /usr/local/lib: ../common/libgal.a ../common/libcommon.a -lwx_gtk3u_gl-3.1 -lwx_gtk3u_aui-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1 -lwx_baseu_xml-3.1 -lwx_gtk3u_stc-3.1 ../common/libgal.a -lGLEW -lcairo -lpixman-1 -lGL -lGLU ../polygon/libpolygon.a ../bitmaps_png/libbitmaps.a -lcurl -lssl -lcrypto -lwx_gtk3u_gl-3.1 -lwx_gtk3u_aui-3.1 -lwx_gtk3u_html-3.1 -lwx_gtk3u_core-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1 -lwx_baseu_xml-3.1 -lwx_gtk3u_stc-3.1 -lstdc++ -lm --no-as-needed -lpthread -lrt -lm -ldl -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtend.o /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o --verbose
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtbegin.o
ld.lld: /usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan-x86_64.a
ld.lld: /usr/lib64/clang/8.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a
ld.lld: CMakeFiles/eeschema.dir/__/common/single_top.cpp.o
ld.lld: CMakeFiles/eeschema.dir/__/common/pgm_base.cpp.o
ld.lld: ../common/libgal.a
ld.lld: ../common/libcommon.a
ld.lld: /usr/local/lib/libwx_gtk3u_gl-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_aui-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_html-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_core-3.1.so
ld.lld: /usr/local/lib/libwx_baseu_net-3.1.so
ld.lld: /usr/local/lib/libwx_baseu-3.1.so
ld.lld: /usr/local/lib/libwx_baseu_xml-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_stc-3.1.so
ld.lld: ../common/libgal.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libGLEW.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libcairo.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libpixman-1.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libGL.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libGLU.so
ld.lld: ../polygon/libpolygon.a
ld.lld: ../bitmaps_png/libbitmaps.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libcurl.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libssl.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libcrypto.so
ld.lld: /usr/local/lib/libwx_gtk3u_gl-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_aui-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_html-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_core-3.1.so
ld.lld: /usr/local/lib/libwx_baseu_net-3.1.so
ld.lld: /usr/local/lib/libwx_baseu-3.1.so
ld.lld: /usr/local/lib/libwx_baseu_xml-3.1.so
ld.lld: /usr/local/lib/libwx_gtk3u_stc-3.1.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libstdc++.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libm.so
ld.lld: /lib64/libm.so.6
ld.lld: /usr/lib64/libmvec_nonshared.a
ld.lld: /lib64/libmvec.so.1
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libpthread.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/librt.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libm.so
ld.lld: /lib64/libm.so.6
ld.lld: /usr/lib64/libmvec_nonshared.a
ld.lld: /lib64/libmvec.so.1
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libdl.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc_s.so
ld.lld: /lib64/libgcc_s.so.1
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libpthread.so
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libc.so
ld.lld: /lib64/libc.so.6
ld.lld: /usr/lib64/libc_nonshared.a
ld.lld: /lib64/ld-linux-x86-64.so.2
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc_s.so
ld.lld: /lib64/libgcc_s.so.1
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/libgcc.a
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtend.o
ld.lld: /usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o
ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:538 (/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:538)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::config()) in archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:546 (/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:546)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::sys_search()) in archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:552 (/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:552)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::help_name()) in archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:568 (/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:568)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::UpdateFileHistory(wxString const&, wxFileHistory*)) in archive ../common/libcommon.a

ld.lld: error: undefined symbol: Kiface()
>>> referenced by eda_base_frame.cpp:580 (/home/imcinerney/Documents/dev/kicad/code/master/common/eda_base_frame.cpp:580)
>>>               eda_base_frame.cpp.o:(EDA_BASE_FRAME::GetFileFromHistory(int, wxString const&, wxFileHistory*)) in archive ../common/libcommon.a

Follow ups