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

Addressing OE linking issues when built with GCC #167

Merged
merged 3 commits into from
Apr 10, 2020
Merged

Addressing OE linking issues when built with GCC #167

merged 3 commits into from
Apr 10, 2020

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Apr 10, 2020

This aims to address
openenclave/openenclave#2802

@jhand2, @anakrish, @achamayou could someone try this branch to see if it fixes the issues?

@achamayou
Copy link
Member

achamayou commented Apr 10, 2020

@mjp41 Different error now with gcc-8/g++-8

[1653/2661] Linking CXX executable tests/tools/oecertdump/enc/oecertdump_enc
FAILED: tests/tools/oecertdump/enc/oecertdump_enc 
: && /usr/bin/g++-8  -g   tests/tools/oecertdump/enc/CMakeFiles/oecertdump_enc.dir/enc.cpp.o tests/tools/oecertdump/enc/CMakeFiles/oecertdump_enc.dir/oecertdump_t.c.o  -o tests/tools/oecertdump/enc/oecertdump_enc  output/lib/openenclave/enclave/liboeenclave.a output/lib/openenclave/enclave/liboeenclave.a output/lib/openenclave/enclave/liboelibc.a output/lib/openenclave/enclave/liboecryptombed.a 3rdparty/mbedtls/libmbedtls.a 3rdparty/mbedtls/libmbedx509.a 3rdparty/mbedtls/libmbedcrypto.a output/lib/openenclave/enclave/liboelibc.a syscall/liboesyscall.a output/lib/openenclave/enclave/liboecore.a -nostdlib -nodefaultlibs -nostartfiles -Wl,--no-undefined,-Bstatic,-Bsymbolic,--export-dynamic,-pie,--build-id -Wl,-z,noexecstack -Wl,-z,now -Wl,-gc-sections && :
output/lib/openenclave/enclave/liboecore.a(snmalloc_wrapper.cpp.o): In function `std::function<void* (void*)>::operator()(void*) const':
/usr/include/c++/8/bits/std_function.h:686: undefined reference to `std::__throw_bad_function_call()'
output/lib/openenclave/enclave/liboecore.a(snmalloc_wrapper.cpp.o):(.data.rel.ro._ZTIZN8snmalloc9AllocatorIXadL_ZNS_20needs_initialisationEPvEEXadL_ZNS_21init_thread_allocatorERSt8functionIFS1_S1_EEEENS_24MemoryProviderStateMixinINS_13PALPlainMixinINS_14PALOpenEnclaveEEEEENS_15DefaultChunkMapINS_21GlobalPagemapTemplateINS_7PagemapILm20EhLh0EEEEEEELb1EE23small_alloc_first_allocILNS_7ZeroMemE1ELNS_12AllowReserveE1EEES1_mEUlS1_E_[_ZTIZN8snmalloc9AllocatorIXadL_ZNS_20needs_initialisationEPvEEXadL_ZNS_21init_thread_allocatorERSt8functionIFS1_S1_EEEENS_24MemoryProviderStateMixinINS_13PALPlainMixinINS_14PALOpenEnclaveEEEEENS_15DefaultChunkMapINS_21GlobalPagemapTemplateINS_7PagemapILm20EhLh0EEEEEEELb1EE23small_alloc_first_allocILNS_7ZeroMemE1ELNS_12AllowReserveE1EEES1_mEUlS1_E_]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'

@achamayou
Copy link
Member

Sounds like some undefined pure virtuals, possibly: https://gcc.gnu.org/faq.html#vtables

@mjp41
Copy link
Member Author

mjp41 commented Apr 10, 2020

So @plietar's patch in #166 removes the use of std::function. Can you cherry-pick his commit onto this PR, and see if it works?

@achamayou
Copy link
Member

@mjp41, yes, that fixes it with gcc-8, and there's no regression with clang.

@achamayou
Copy link
Member

gcc-9 is happy too.

@mjp41 mjp41 merged commit cf9c2eb into master Apr 10, 2020
@mjp41 mjp41 deleted the oe_fixes2 branch April 10, 2020 15:31
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

Successfully merging this pull request may close these issues.

2 participants