Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling with --with-lto -- undefined reference to vtable for strictmod::objects::StrictExceptionObject #128

Open
ravirahman opened this issue Oct 16, 2023 · 0 comments

Comments

@ravirahman
Copy link

I am trying to compile with Cinder with --with-lto but am getting the following errors:

dfg++ -pthread   -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -fprofile-generate -Xlinker -export-dynamic -o python Programs/python.o libpython3.10_static.a -lcrypt -lpthread -ldl  -lz -lutil -lm   -lm  -lrt 
/usr/bin/ld: python.lto.o: in function `std::__shared_ptr<strictmod::objects::StrictExceptionObject, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<strictmod::objects::StrictExceptionObject>, std::shared_ptr<strictmod::objects::StrictType>, std::weak_ptr<strictmod::objects::StrictModuleObject> const&, std::shared_ptr<sequence_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<strictmod::objects::BaseStrictObject>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >(std::_Sp_alloc_shared_tag<std::allocator<strictmod::objects::StrictExceptionObject> >, std::shared_ptr<strictmod::objects::StrictType>&&, std::weak_ptr<strictmod::objects::StrictModuleObject> const&, std::shared_ptr<sequence_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<strictmod::objects::BaseStrictObject>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&&) [clone .isra.0]':
/vol/./StrictModules/Objects/exception_object.h:10: undefined reference to `vtable for strictmod::objects::StrictExceptionObject'
/usr/bin/ld: python.lto.o: in function `std::shared_ptr<strictmod::objects::StrictType> strictmod::objects::makeType<strictmod::objects::StrictExceptionType, char const (&) [10], std::shared_ptr<strictmod::objects::StrictModuleObject>&, std::vector<std::shared_ptr<strictmod::objects::BaseStrictObject>, std::allocator<std::shared_ptr<strictmod::objects::BaseStrictObject> > >, std::shared_ptr<strictmod::objects::StrictType> >(char const (&) [10], std::shared_ptr<strictmod::objects::StrictModuleObject>&, std::vector<std::shared_ptr<strictmod::objects::BaseStrictObject>, std::allocator<std::shared_ptr<strictmod::objects::BaseStrictObject> > >&&, std::shared_ptr<strictmod::objects::StrictType>&&) [clone .constprop.0]':
/vol/./StrictModules/Objects/exception_object.h:26: undefined reference to `vtable for strictmod::objects::StrictExceptionType'
/usr/bin/ld: python.lto.o: in function `strictmod::objects::AttributeErrorType()':
/vol/./StrictModules/Objects/exception_object.h:26: undefined reference to `vtable for strictmod::objects::StrictExceptionType'
/usr/bin/ld: python.lto.o: in function `strictmod::objects::AssertionErrorType()':
/vol/./StrictModules/Objects/exception_object.h:26: undefined reference to `vtable for strictmod::objects::StrictExceptionType'
/usr/bin/ld: python.lto.o: in function `strictmod::objects::ValueErrorType()':
/vol/./StrictModules/Objects/exception_object.h:26: undefined reference to `vtable for strictmod::objects::StrictExceptionType'
/usr/bin/ld: python.lto.o: in function `strictmod::objects::NotImplementedErrorType()':
/vol/./StrictModules/Objects/exception_object.h:26: undefined reference to `vtable for strictmod::objects::StrictExceptionType'
/usr/bin/ld: python.lto.o:/vol/./StrictModules/Objects/exception_object.h:26: more undefined references to `vtable for strictmod::objects::StrictExceptionType' follow

I am using the python-build-env dockerimage. It appears that all of the strict modules are getting compiled, so I am confused why it is failing to link.

Steps to reproduce:

git clone https://github.com/facebookincubator/cinder
docker run -v "$PWD/cinder:/vol" -w /vol -it --rm ghcr.io/facebookincubator/cinder/python-build-env:latest bash
./configure --with-lto
make VERBOSE=1

I am able to build it without LTO. Would appreciate if you could let me know what I need to do differently. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant