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

ARMv8 Ubuntu 18.04(64bit) Make error: requested alignment 64 is larger than 16 #1098

Closed
Martin-Luther opened this issue Mar 31, 2019 · 3 comments

Comments

@Martin-Luther
Copy link

Martin-Luther commented Mar 31, 2019

Hardware: RockPro64 with Rockchip RK3399 Hexa-Core (dual ARM Cortex A72 and quad ARM Cortex A53) 64-Bit Processor
ARCH: aarch64
OS: Ubuntu 18.04 (64 bit)
GCC: 7.3.0-27ubuntu1~18.04

When I enter : make -j $(nproc)

[ 34%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/coro/SharedMutex.cpp.o
[ 34%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/crypto/Blake2xb.cpp.o
[ 35%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/crypto/LtHash.cpp.o
[ 35%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/crypto/detail/MathOperation_AVX2.cpp.o
[ 35%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/crypto/detail/MathOperation_SSE2.cpp.o
[ 36%] Building CXX object CMakeFiles/folly_base.dir/folly/experimental/crypto/detail/MathOperation_Simple.cpp.o
In file included from /usr/local/src/folly/folly/experimental/crypto/LtHash.h:276:0,
                 from /usr/local/src/folly/folly/experimental/crypto/LtHash.cpp:17:
/usr/local/src/folly/folly/experimental/crypto/LtHash-inl.h: In member function ‘folly::crypto::LtHash<B, N>& folly::crypto::LtHash<B, N>::addObject(folly::ByteRange, Args&& ...)’:
/usr/local/src/folly/folly/experimental/crypto/LtHash-inl.h:343:53: error: requested alignment 64 is larger than 16 [-Werror=attributes]
   std::array<unsigned char, getChecksumSizeBytes()> h;
                                                     ^
/usr/local/src/folly/folly/experimental/crypto/LtHash-inl.h: In member function ‘folly::crypto::LtHash<B, N>& folly::crypto::LtHash<B, N>::removeObject(folly::ByteRange, Args&& ...)’:
/usr/local/src/folly/folly/experimental/crypto/LtHash-inl.h:361:53: error: requested alignment 64 is larger than 16 [-Werror=attributes]
   std::array<unsigned char, getChecksumSizeBytes()> h;
                                                     ^
cc1plus: all warnings being treated as errors
CMakeFiles/folly_base.dir/build.make:1167: recipe for target 'CMakeFiles/folly_base.dir/folly/experimental/crypto/LtHash.cpp.o' failed
make[2]: *** [CMakeFiles/folly_base.dir/folly/experimental/crypto/LtHash.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp: In static member function ‘static void folly::crypto::detail::MathOperation<E>::add(uint64_t, size_t, folly::ByteRange, folly::ByteRange, folly::MutableByteRange) [with folly::crypto::detail::MathEngine E = (folly::crypto::detail::MathEngine)1; uint64_t = long unsigned int; size_t = long unsigned int; folly::ByteRange = folly::Range<const unsigned char*>; folly::MutableByteRange = folly::Range<unsigned char*>]’:
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp:53:67: error: requested alignment 64 is larger than 16 [-Werror=attributes]
   alignas(kCacheLineSize) std::array<uint64_t, kValsPerCacheLine> results;
                                                                   ^~~~~~~
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp: In static member function ‘static void folly::crypto::detail::MathOperation<E>::sub(uint64_t, size_t, folly::ByteRange, folly::ByteRange, folly::MutableByteRange) [with folly::crypto::detail::MathEngine E = (folly::crypto::detail::MathEngine)1; uint64_t = long unsigned int; size_t = long unsigned int; folly::ByteRange = folly::Range<const unsigned char*>; folly::MutableByteRange = folly::Range<unsigned char*>]’:
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp:118:67: error: requested alignment 64 is larger than 16 [-Werror=attributes]
   alignas(kCacheLineSize) std::array<uint64_t, kValsPerCacheLine> results;
                                                                   ^~~~~~~
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp: In static member function ‘static void folly::crypto::detail::MathOperation<E>::clearPaddingBits(uint64_t, folly::MutableByteRange) [with folly::crypto::detail::MathEngine E = (folly::crypto::detail::MathEngine)1; uint64_t = long unsigned int; folly::MutableByteRange = folly::Range<unsigned char*>]’:
/usr/local/src/folly/folly/experimental/crypto/detail/MathOperation_Simple.cpp:182:67: error: requested alignment 64 is larger than 16 [-Werror=attributes]
   alignas(kCacheLineSize) std::array<uint64_t, kValsPerCacheLine> results;
                                                                   ^~~~~~~
cc1plus: all warnings being treated as errors
CMakeFiles/folly_base.dir/build.make:1206: recipe for target 'CMakeFiles/folly_base.dir/folly/experimental/crypto/detail/MathOperation_Simple.cpp.o' failed
make[2]: *** [CMakeFiles/folly_base.dir/folly/experimental/crypto/detail/MathOperation_Simple.cpp.o] Error 1
CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/folly_base.dir/all' failed
make[1]: *** [CMakeFiles/folly_base.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
@Martin-Luther Martin-Luther changed the title ARM64 Ubuntu 18.04(64bit) Make error: requested alignment 64 is larger than 16 ARMv8 Ubuntu 18.04(64bit) Make error: requested alignment 64 is larger than 16 Apr 1, 2019
@Orvid
Copy link
Contributor

Orvid commented Apr 3, 2019

Unfortunately, we don't have any systems we can really test this on to be able to fix it :(

If you want to compile this as-is, enabling C++17 mode (which supports over-aligned types) with a new enough compiler should work around this issue.

@JoeLoser
Copy link
Contributor

JoeLoser commented Apr 3, 2019

Alternatively, if you rebase with master where we now don't treat every warning as an error, this should result in a warning but not be fatal.

@Martin-Luther
Copy link
Author

Thanks Joe !
It seems to be better. I also tried to add -DCXX_STANDARD_REQUIRED=c++17 to enabled C++17 as Orvid suggested, but I don't think that it made any difference.

make -j $(nproc) EXTRA_CMAKE_OPTIONS='-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCXX_STANDARD_REQUIRED=c++17'

At least, I am not stuck anymore, so thank you.

After some googling, I have read that this issue could be fixed if I install GCC 8.x or GCC 9. But I have not tested yet.

Thank you guys.

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

3 participants