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

OpenEnclave: Compile errors on ARM #199

Closed
anakrish opened this issue May 25, 2020 · 1 comment · Fixed by #202
Closed

OpenEnclave: Compile errors on ARM #199

anakrish opened this issue May 25, 2020 · 1 comment · Fixed by #202
Assignees

Comments

@anakrish
Copy link
Contributor

anakrish commented May 25, 2020

When building snmalloc for use within enclaves, we get the following compile error on ARM:

export CCACHE_CPP2=true && /usr/bin/ccache /usr/bin/aarch64-linux-gnu-g++ -I3rdparty/optee/libutee/liboeutee -g -Wall -Werror -Wpointer-arith -Wconversion -Wextra -Wno-missing-field-initializers -fno-strict-aliasing -Wno-type-limits -I/home/anakrish/openenclave_qemu/sdk/include -I/home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include -I/home/anakrish/openenclave_qemu/build/output/include/openenclave/libc -Wno-conversion -ftls-model=local-exec -nostdinc++ -fPIE -ffreestanding -DARM64=1 -D__LP64__=1 -mstrict-align -nostdinc -nostdlib -nodefaultlibs -nostartfiles -fno-builtin-memcpy -fno-builtin-memset -funwind-tables -fpie -fPIC -gdwarf -fno-exceptions -fvisibility=hidden -std=c++14 -std=c++17 -MD -MT 3rdparty/snmalloc/CMakeFiles/oesnmalloc.dir/allocator.cpp.o -MF 3rdparty/snmalloc/CMakeFiles/oesnmalloc.dir/allocator.cpp.o.d -o 3rdparty/snmalloc/CMakeFiles/oesnmalloc.dir/allocator.cpp.o -c /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/allocator.cpp
In file included from /home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include/ostream:140:0,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include/istream:164,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include/iostream:40,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/../ds/../aal/aal_arm.h:15,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/../ds/../aal/aal.h:104,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/../ds/bits.h:8,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/../ds/helpers.h:3,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/globalalloc.h:3,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/../mem/slowalloc.h:1,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/./snmalloc/src/override/malloc.cc:1,
from /home/anakrish/openenclave_qemu/sdk/3rdparty/snmalloc/allocator.cpp:30:
/home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include/locale: In function ‘_Tp std::__1::__num_get_signed_integral(const char*, const char*, std::__1::ios_base::iostate&, int)’:
/home/anakrish/openenclave_qemu/sdk/3rdparty/libcxx/libcxx/include/locale:740:26: error: there are no arguments to ‘strtoll_l’ that depend on a template parameter, so a declaration of ‘strtoll_l’ must be available [-fpermissive]
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
^~~~~~~~~

The error seems to be due to the use of <iostream> in aal_arm.h:

#include <iostream>

Removing iostream and replacing it with stdint.h fixes the compilation errors.
Can we avoid a dependency on iostreams?

@mjp41
Copy link
Member

mjp41 commented May 26, 2020

Thanks @anakrish we should not be including iostream, your proposed fix seems correct.

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 a pull request may close this issue.

2 participants