lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] LLVM libc++


From: Vadim Zeitlin
Subject: Re: [lmi] LLVM libc++
Date: Tue, 4 Oct 2022 18:12:17 +0200

On Tue, 4 Oct 2022 15:02:26 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> I'm doing something equivalent to your patch, but I've run into two
GC> linker problems. The first is this:
GC> 
GC> clang++ -o skeleton.so -shared about_dialog.o alert_wx.o census_document.o 
census_view.o database_document.o database_view.o database_view_editor.o 
default_view.o docmanager_ex.o file_command_wx.o gpt_document.o gpt_view.o 
group_quote_pdf_gen_wx.o icon_monger.o illustration_document.o 
illustration_view.o input_sequence_entry.o main_common.o mec_document.o 
mec_view.o msw_workarounds.o multidimgrid_any.o multidimgrid_tools.o 
mvc_controller.o mvc_view.o pdf_command_wx.o pdf_writer_wx.o policy_document.o 
policy_view.o preferences_view.o previewframe_ex.o product_editor.o 
progress_meter_wx.o rounding_document.o rounding_view.o rounding_view_editor.o 
single_choice_popup_menu.o skeleton.o system_command_wx.o text_doc.o 
text_view.o tier_document.o tier_view.o tier_view_editor.o transferor.o 
view_ex.o wx_checks.o wx_table_generator.o wx_utility.o liblmi.so wx_new.so 
-fuse-ld=lld -stdlib=libc++ -Wl,-Map,skeleton.so.map -ggdb  -fPIC -L . -L 
/opt/lmi/local/clang_x86_64-pc-linux-gnu/lib -L 
/opt/lmi/local/clang_x86_64-pc-linux-gnu/bin -lwxcode_gtk3u_pdfdoc-3.2  -L 
/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib  -lwx_gtk3u-3.2   
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lxsltwrapp 
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lexslt -lxslt -lxml2 
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lxslt -lxml2 -lxmlwrapp 
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lxml2 -lexslt 
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lxslt -lxml2 -lm 
-L/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -lxml2 -lm  -ldw -lunwind -ldl  
-Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code  
GC> ld.lld: error: liblmi.so: undefined reference to 
xml::error_messages::print() const [--no-allow-shlib-undefined]
GC> ld.lld: error: liblmi.so: undefined reference to 
xml::document::save_to_string(std::__1::basic_string<char, 
std::__1::char_traits<char>, std::__1::allocator<char> >&, xml::error_handler&) 
const [--no-allow-shlib-undefined]
GC> ld.lld: error: liblmi.so: undefined reference to 
xml::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, 
xml::document const&) [--no-allow-shlib-undefined]
GC> 
GC> which I can "solve" with '-Wl,--allow-shlib-undefined', although I'd
GC> like to know if there's a better way.

 There should definitely be a better way, i.e. there is no good reason to
allow having undefined symbols here and, moreover, doing this will almost
surely result in runtime crashes.

 Could it have somehow happened that libxmlwrapp wasn't build with the same
options, e.g. didn't use -stdlib=libc++? FWIW I think it would make sense
to handle clang with libstd++ and with libc++ as 2 different compilers as
they're incompatible in practice (even if theory they are, of course, for
the code not using any standard classes at all).

GC> The second, which persists even with '-Wl,--allow-shlib-undefined',
GC> and even if I specify '-stdlib=libc++' after '-lwx_gtk3u-3.2', is:
GC> 
GC> clang++ -o wx_test main_wx_test.o wx_test_about_version.o 
wx_test_benchmark_census.o wx_test_calculation_summary.o 
wx_test_config_settings.o wx_test_create_open.o wx_test_default_input.o 
wx_test_default_update.o wx_test_expiry_dates.o wx_test_input_sequences.o 
wx_test_input_validation.o wx_test_log_errors.o wx_test_paste_census.o 
wx_test_pdf_create.o wx_test_validate_output.o skeleton.so liblmi.so 
-fuse-ld=lld -Wl,-Map,wx_test.map -ggdb  -fPIC -L . -L 
/opt/lmi/local/clang_x86_64-pc-linux-gnu/lib -L 
/opt/lmi/local/clang_x86_64-pc-linux-gnu/bin  -L 
/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib  -lwx_gtk3u-3.2   -ldw -lunwind -ldl 
-stdlib=libc++ -Wl,--allow-shlib-undefined  -Wl,-z,relro -Wl,-z,now 
-Wl,-z,noexecstack -Wl,-z,separate-code  
GC> make[1]: Nothing to be done for 'check_physical_closure'.
GC> ld.lld: error: undefined symbol: operator<<(std::__1::basic_ostream<char, 
std::__1::char_traits<char> >&, wxString const&)
GC> >>> referenced by wx_test_about_version.cpp:181 
(/opt/lmi/src/lmi/wx_test_about_version.cpp:181)
GC> >>>               
wx_test_about_version.o:(wx_test_case_about_dialog_version::run()::expect_about_dialog::OnInvoked(wxDialog*)
 const)
GC> >>> referenced by wx_test_about_version.cpp:185 
(/opt/lmi/src/lmi/wx_test_about_version.cpp:185)
GC> >>>               
wx_test_about_version.o:(wx_test_case_about_dialog_version::run()::expect_about_dialog::OnInvoked(wxDialog*)
 const)
GC> >>> referenced by wx_test_benchmark_census.cpp:86 
(/opt/lmi/src/lmi/wx_test_benchmark_census.cpp:86)
GC> >>>               wx_test_benchmark_census.o:((anonymous 
namespace)::census_benchmark::time_operation(char const*, char, int))
GC> >>> referenced 15 more times
GC> 
GC> Am I supposed to define my own ostream inserter for wxString?

 No, of course not, but I don't know why are you getting this. My only
hypothesis is the same one as above, i.e. that install_wx.sh wasn't [re]run
with -stdlib=libc++, could this be the case?

 If not, please let me know what exactly are you doing so that I could try
to reproduce this.

 Thanks in advance,
VZ

Attachment: pgphZvrVvW41K.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]