containerd / overlaybd

Overlaybd: a block based remote image format. The storage backend of containerd/accelerated-container-image.
Apache License 2.0
259 stars 58 forks source link

Help with build errors #110

Closed juliusl closed 7 months ago

juliusl commented 2 years ago

I'm developing on ARM64, and I run into these errors, I was wondering if I could get some help with.

c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-msse4.2’
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’

Full log

❯ make -j                                                                   build -> main
Scanning dependencies of target photon_obj
[  1%] Building CXX object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_env_lib.dir/ease_bindings/env/ocf_env.cpp.o
[  1%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o
[  2%] Building CXX object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_env_lib.dir/ease_bindings/env/utils_mpool.cpp.o
[  3%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/alog.cpp.o
[  3%] Building CXX object src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/crc32/crc32c.cpp.o
[  4%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/estring.cpp.o
[  4%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/event-loop.cpp.o
[  4%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o
[  5%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o
[  5%] Building CXX object src/overlaybd/registryfs/CMakeFiles/registryfs_lib.dir/registryfs.cpp.o
[  6%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/iovector.cpp.o
[  6%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/setup.c.o
[  7%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/syscall.c.o
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-msse4.2’
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’
[  7%] Building CXX object _deps/photon-build/third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o
c++: error: unrecognized command-line option ‘-msse4.2’
c++: error: unrecognized command-line option ‘-msse4.2’
[  8%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/queue.c.o
[  8%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/register.c.o
c++: error: unrecognized command-line option ‘-msse4.2’
cc: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-msse4.2’
[  9%] Building CXX object src/overlaybd/cache/frontend/CMakeFiles/cache_frontend_lib.dir/cached_file.cpp.o
cc: error: unrecognized command-line option ‘-msse4.2’
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’
make[2]: *** [src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/build.make:76: src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/crc32/crc32c.cpp.o] Error 1
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:76: _deps/photon-build/CMakeFiles/photon_obj.dir/common/alog.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:104: _deps/photon-build/CMakeFiles/photon_obj.dir/common/estring.cpp.o] Error 1
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:118: _deps/photon-build/CMakeFiles/photon_obj.dir/common/event-loop.cpp.o] Error 1
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:132: _deps/photon-build/CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o] Error 1
c++: error: unrecognized command-line option ‘-msse4.2’
[  9%] Generating ../output/ext4_64
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:90: _deps/photon-build/CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:666: src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
c++: error: unrecognized command-line option ‘-mcrc32’
[  9%] Building CXX object src/overlaybd/lsmt/CMakeFiles/lsmt_lib.dir/index.cpp.o
[  9%] Building CXX object src/overlaybd/cache/frontend/CMakeFiles/cache_frontend_lib.dir/cached_fs.cpp.o
c++: error: unrecognized command-line option ‘-msse4.2’
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:160: _deps/photon-build/CMakeFiles/photon_obj.dir/common/iovector.cpp.o] Error 1
cc: error: unrecognized command-line option ‘-mcrc32’
cc: error: unrecognized command-line option ‘-msse4.2’
[ 10%] Building CXX object src/overlaybd/lsmt/CMakeFiles/lsmt_lib.dir/file.cpp.o
[ 10%] Building CXX object src/overlaybd/cache/full_file_cache/CMakeFiles/full_file_cache_lib.dir/cache_pool.cpp.o
c++: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-msse4.2’
make[2]: *** [_deps/photon-build/third_party/CMakeFiles/easy_weak.dir/build.make:76: _deps/photon-build/third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:454: _deps/photon-build/third_party/CMakeFiles/easy_weak.dir/all] Error 2
cc: error: unrecognized command-line option ‘-mcrc32’
c++: error: unrecognized command-line option ‘-mcrc32’
[ 11%] Building CXX object src/overlaybd/cache/full_file_cache/CMakeFiles/full_file_cache_lib.dir/cache_store.cpp.o
cc: error: unrecognized command-line option ‘-msse4.2’
c++: error: unrecognized command-line option ‘-msse4.2’
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:146: _deps/photon-build/CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:372: _deps/photon-build/CMakeFiles/photon_obj.dir/all] Error 2
make[2]: *** [_deps/photon-build/CMakeFiles/uring.dir/build.make:76: _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/setup.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [_deps/photon-build/CMakeFiles/uring.dir/build.make:118: _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/syscall.c.o] Error 1
make[2]: *** [_deps/photon-build/CMakeFiles/uring.dir/build.make:90: _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/queue.c.o] Error 1
ext4_64
cc: error: unrecognized command-line option ‘-mcrc32’
cc: error: unrecognized command-line option ‘-msse4.2’
make[2]: *** [_deps/photon-build/CMakeFiles/uring.dir/build.make:104: _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/register.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:346: _deps/photon-build/CMakeFiles/uring.dir/all] Error 2
[ 11%] Built target baselayer
[ 11%] Linking CXX static library ../../../../output/libocf_env_lib.a
[ 11%] Built target ocf_env_lib
[ 11%] Linking CXX static library ../../../../output/libfull_file_cache_lib.a
[ 11%] Built target full_file_cache_lib
[ 12%] Linking CXX static library ../../../../output/libcache_frontend_lib.a
[ 12%] Built target cache_frontend_lib
[ 13%] Linking CXX static library ../../../output/libregistryfs_lib.a
[ 13%] Built target registryfs_lib
[ 14%] Linking CXX static library ../../../output/liblsmt_lib.a
[ 14%] Built target lsmt_lib
make: *** [Makefile:156: all] Error 2
2 ❯ sudo make install                                                       build -> main
[sudo] password for juliusl: 
[  0%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/setup.c.o
cc: error: unrecognized command-line option ‘-mcrc32’
cc: error: unrecognized command-line option ‘-msse4.2’
make[2]: *** [_deps/photon-build/CMakeFiles/uring.dir/build.make:76: _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/setup.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:346: _deps/photon-build/CMakeFiles/uring.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
liulanzheng commented 2 years ago

the photon tag we used is too old, we should use v0.1.0 instead of 7997b43e3d7cf27b95d016cd047abb9ca8063339. And the crc flags used for zfile verification should adapt to arm.

beef9999 commented 2 years ago

Should be fixed by https://github.com/containerd/overlaybd/pull/111

juliusl commented 2 years ago

@beef9999 Thanks for the quick response, I tried the latest and there still seems to be an issue:

 15%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/uuid4.cpp.o
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp: In function ‘uint32_t crc32c_hw(const uint8_t*, size_t, uint32_t)’:
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:54:23: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   54 |       sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                       ^~~~~~~~~~~~~~~~~~~~~~
      |                       __builtin_aarch64_crc32x
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/async_filesystem.cpp.o
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:62:11: error: ‘__builtin_ia32_crc32di’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   62 |     sum = __builtin_ia32_crc32di(sum, *src);
      |           ^~~~~~~~~~~~~~~~~~~~~~
      |           __builtin_aarch64_crc32x
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:68:21: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   68 |     sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                     ^~~~~~~~~~~~~~~~~~~~~~
      |                     __builtin_aarch64_crc32x
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/exportfs.cpp.o
[ 16%] Built target easy_weak
[ 17%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/filecopy.cpp.o
[ 17%] Linking C static library ../../output/liburing.a
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/localfs.cpp.o
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o
[ 19%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/path.cpp.o
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:90: _deps/photon-build/CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o] Error 1
m

Full log:

❯ make -j                                                                 build -> main $
Scanning dependencies of target photon_obj
[  0%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/setup.c.o
[  0%] Building CXX object _deps/photon-build/third_party/CMakeFiles/easy_weak.dir/easy_weak/easy_weak.cpp.o
[  0%] Building CXX object src/overlaybd/registryfs/CMakeFiles/registryfs_lib.dir/registryfs.cpp.o
[  1%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/alog.cpp.o
[  1%] Building CXX object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_env_lib.dir/ease_bindings/env/utils_mpool.cpp.o
[  2%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/queue.c.o
[  3%] Building CXX object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_env_lib.dir/ease_bindings/env/ocf_env.cpp.o
[  4%] Building CXX object src/overlaybd/lsmt/CMakeFiles/lsmt_lib.dir/file.cpp.o
[  4%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/register.c.o
[  5%] Building C object _deps/photon-build/CMakeFiles/uring.dir/__/liburing-src/src/syscall.c.o
[  5%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o
[  6%] Building CXX object src/overlaybd/cache/frontend/CMakeFiles/cache_frontend_lib.dir/cached_file.cpp.o
[  6%] Building CXX object src/overlaybd/lsmt/CMakeFiles/lsmt_lib.dir/index.cpp.o
[  7%] Building CXX object src/overlaybd/cache/full_file_cache/CMakeFiles/full_file_cache_lib.dir/cache_store.cpp.o
[  7%] Building CXX object src/overlaybd/cache/full_file_cache/CMakeFiles/full_file_cache_lib.dir/cache_pool.cpp.o
[  7%] Generating ../output/ext4_64
[  7%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/event-loop.cpp.o
[  8%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/estring.cpp.o
[  9%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/executor/executor.cpp.o
[  9%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/expirecontainer.cpp.o
[  9%] Building CXX object src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/crc32/crc32c.cpp.o
[  9%] Building CXX object src/overlaybd/cache/frontend/CMakeFiles/cache_frontend_lib.dir/cached_fs.cpp.o
[ 10%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/identity-pool.cpp.o
ext4_64
[ 11%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/memory-stream/memory-stream.cpp.o
[ 12%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/perf_counter.cpp.o
[ 13%] Linking CXX static library ../../../output/libeasy_weak.a
[ 13%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/ring.cpp.o
[ 13%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/iovector.cpp.o
[ 13%] Built target baselayer
[ 14%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/stream-messenger/messenger.cpp.o
[ 14%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/utility.cpp.o
[ 15%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/common/uuid4.cpp.o
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp: In function ‘uint32_t crc32c_hw(const uint8_t*, size_t, uint32_t)’:
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:54:23: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   54 |       sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                       ^~~~~~~~~~~~~~~~~~~~~~
      |                       __builtin_aarch64_crc32x
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/async_filesystem.cpp.o
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/aligned-file.cpp.o
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:62:11: error: ‘__builtin_ia32_crc32di’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   62 |     sum = __builtin_ia32_crc32di(sum, *src);
      |           ^~~~~~~~~~~~~~~~~~~~~~
      |           __builtin_aarch64_crc32x
/home/juliusl/overlaybd/build/_deps/photon-src/common/checksum/crc32c.cpp:68:21: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   68 |     sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                     ^~~~~~~~~~~~~~~~~~~~~~
      |                     __builtin_aarch64_crc32x
[ 16%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/exportfs.cpp.o
[ 16%] Built target easy_weak
[ 17%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/filecopy.cpp.o
[ 17%] Linking C static library ../../output/liburing.a
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/httpfs/httpfs_v2.cpp.o
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/localfs.cpp.o
[ 18%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/httpfs/httpfs.cpp.o
[ 19%] Building CXX object _deps/photon-build/CMakeFiles/photon_obj.dir/fs/path.cpp.o
make[2]: *** [_deps/photon-build/CMakeFiles/photon_obj.dir/build.make:90: _deps/photon-build/CMakeFiles/photon_obj.dir/common/checksum/crc32c.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 19%] Built target uring
[ 20%] Linking CXX static library ../../../../output/libocf_env_lib.a
/home/juliusl/overlaybd/src/overlaybd/zfile/crc32/crc32c.cpp: In function ‘uint32_t crc32::crc32c_hw(const uint8_t*, size_t, uint32_t)’:
/home/juliusl/overlaybd/src/overlaybd/zfile/crc32/crc32c.cpp:65:29: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   65 |             sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                             ^~~~~~~~~~~~~~~~~~~~~~
      |                             __builtin_aarch64_crc32x
/home/juliusl/overlaybd/src/overlaybd/zfile/crc32/crc32c.cpp:73:15: error: ‘__builtin_ia32_crc32di’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   73 |         sum = __builtin_ia32_crc32di(sum, *src);
      |               ^~~~~~~~~~~~~~~~~~~~~~
      |               __builtin_aarch64_crc32x
/home/juliusl/overlaybd/src/overlaybd/zfile/crc32/crc32c.cpp:79:25: error: ‘__builtin_ia32_crc32qi’ was not declared in this scope; did you mean ‘__builtin_aarch64_crc32x’?
   79 |         sum = (uint32_t)__builtin_ia32_crc32qi(sum, data[offset]);
      |                         ^~~~~~~~~~~~~~~~~~~~~~
      |                         __builtin_aarch64_crc32x
[ 20%] Built target ocf_env_lib
make[2]: *** [src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/build.make:76: src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/crc32/crc32c.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:666: src/overlaybd/zfile/CMakeFiles/crc32_lib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp: In member function ‘void LogOutputFd<FD>::write(int, const char*, const char*) [with int FD = 1]’:
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:72:16: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   72 |         ::write(FD, begin, end - begin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp: In member function ‘void LogOutputFd<FD>::write(int, const char*, const char*) [with int FD = 2]’:
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:72:16: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp: In member function ‘virtual void LogOutputFile::write(int, const char*, const char*)’:
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:255:17: warning: ignoring return value of ‘ssize_t writev(int, const iovec*, int)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  255 |         ::writev(log_file_fd, &iov, 1);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:269:28: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  269 |                     ::write(log_file_fd, msg, sizeof(msg) - 1);
      |                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:270:28: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  270 |                     ::write(log_file_fd, log_file_name, strlen(log_file_name));
      |                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/juliusl/overlaybd/build/_deps/photon-src/common/alog.cpp:271:28: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  271 |                     ::write(log_file_fd, &enter, 1);
      |                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
[ 20%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/cleaning/acp.c.o
[ 21%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/cleaning/alru.c.o
[ 21%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/cleaning/cleaning.c.o
/home/juliusl/overlaybd/build/_deps/photon-src/fs/filecopy.cpp: In function ‘ssize_t photon::fs::filecopy(photon::fs::IFile*, photon::fs::IFile*, size_t, int)’:
/home/juliusl/overlaybd/build/_deps/photon-src/fs/filecopy.cpp:35:21: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   35 |     ::posix_memalign(&buff, ALIGNMENT, bs);
      |     ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
[ 22%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/cleaning/nop.c.o
[ 22%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/concurrency/ocf_cache_line_concurrency.c.o
[ 23%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/concurrency/ocf_concurrency.c.o
[ 24%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/concurrency/ocf_metadata_concurrency.c.o
[ 24%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/concurrency/ocf_mio_concurrency.c.o
[ 24%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_bf.c.o
[ 25%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/cache_engine.c.o
[ 26%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_common.c.o
[ 26%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_d2c.c.o
[ 26%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_fast.c.o
[ 27%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_discard.c.o
[ 28%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_inv.c.o
[ 28%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_ops.c.o
[ 29%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_pt.c.o
[ 29%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_rd.c.o
[ 30%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_wa.c.o
[ 30%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_wb.c.o
[ 31%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_wi.c.o
[ 31%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_wo.c.o
[ 32%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_wt.c.o
[ 32%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_request.c.o
[ 33%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_collision.c.o
[ 35%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata.c.o
[ 36%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_raw_dynamic.c.o
[ 33%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_partition.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_cache.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_core.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_io.c.o
[ 33%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/engine/engine_zero.c.o
[ 34%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_misc.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_flush.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_raw_atomic.c.o
[ 38%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_core.c.o
[ 39%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_raw.c.o
[ 37%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_cache.c.o
[ 42%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_eviction_policy.c.o
[ 43%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_io_class.c.o
[ 43%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_io.c.o
[ 43%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_misc.c.o
[ 43%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_raw_volatile.c.o
[ 44%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_metadata.c.o
[ 40%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_lru.c.o
[ 45%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_io_class.c.o
[ 46%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_seq_cutoff.c.o
[ 46%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_logger.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_stats_builder.c.o
[ 46%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_space.c.o
[ 47%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_segment.c.o
[ 47%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/promotion/nhit/nhit_hash.c.o
[ 48%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_ctx.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_queue.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_cleaning_policy.c.o
[ 41%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_common.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_core.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/mngt/ocf_mngt_core_pool.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_volume.c.o
[ 49%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/metadata/metadata_superblock.c.o
[ 50%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_trace.c.o
[ 52%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/promotion/nhit/nhit.c.o
[ 52%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/ocf_stats.c.o
/home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/metadata_io.c: In function ‘ocf_metadata_io_ctx_init’:
/home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/metadata_io.c:535:34: warning: ‘env_mpool_create’ reading 32 bytes from a region of size 28 [-Wstringop-overread]
  535 |         ocf_ctx->resources.mio = env_mpool_create(
      |                                  ^~~~~~~~~~~~~~~~~
  536 |                         sizeof(struct metadata_io_request_asynch),
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  537 |                         sizeof(struct metadata_io_request),
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  538 |                         ENV_MEM_NOIO, ocf_mio_size_max - 1, true,
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  539 |                         limits,
      |                         ~~~~~~~   
  540 |                         "ocf_mio",
      |                         ~~~~~~~~~~
  541 |                         true);
      |                         ~~~~~     
/home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/metadata_io.c:535:34: note: referencing argument 6 of type ‘const uint32_t *’ {aka ‘const unsigned int *’}
In file included from /home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ease_bindings/env/ocf_env.h:32,
                 from /home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/../ocf_cache_priv.h:10,
                 from /home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/metadata.h:10,
                 from /home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ocf/src/metadata/metadata_io.c:5:
/home/juliusl/overlaybd/src/overlaybd/cache/ocf_cache/ease_bindings/env/utils_mpool.h:39:19: note: in a call to function ‘env_mpool_create’
   39 | struct env_mpool *env_mpool_create(uint32_t hdr_size, uint32_t elem_size,
      |                   ^~~~~~~~~~~~~~~~
[ 52%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_alock.c.o
[ 52%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_cache_line.c.o
[ 53%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_cleaner.c.o
[ 54%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_async_lock.c.o
[ 55%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/promotion/promotion.c.o
[ 55%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_io.c.o
[ 56%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_pipeline.c.o
[ 57%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_list.c.o
[ 58%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_realloc.c.o
[ 58%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_rbtree.c.o
[ 58%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_refcnt.c.o
[ 59%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_request.c.o
[ 59%] Building C object src/overlaybd/cache/ocf_cache/CMakeFiles/ocf_lib.dir/ocf/src/utils/utils_user_part.c.o
[ 60%] Linking CXX static library ../../../../output/libocf_lib.a
[ 60%] Built target ocf_lib
[ 60%] Linking CXX static library ../../../../output/libfull_file_cache_lib.a
[ 60%] Built target full_file_cache_lib
[ 61%] Linking CXX static library ../../../../output/libcache_frontend_lib.a
[ 61%] Built target cache_frontend_lib
[ 62%] Linking CXX static library ../../../output/libregistryfs_lib.a
[ 62%] Built target registryfs_lib
make[1]: *** [CMakeFiles/Makefile2:372: _deps/photon-build/CMakeFiles/photon_obj.dir/all] Error 2
[ 63%] Linking CXX static library ../../../output/liblsmt_lib.a
[ 63%] Built target lsmt_lib
make: *** [Makefile:156: all] Error 2
2 ❯                                                                                                                                                                     build -> main $
juliusl commented 2 years ago

I think it's the -march=native flag,

1 ❯  g++ -dM -E - -march=native </dev/null | egrep -i '(arm|neon|acle|crc)'                                                                                           crc32 -> main ! $
#define __ARM_SIZEOF_WCHAR_T 4
#define __ARM_FEATURE_IDIV 1
#define __ARM_FP 14
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_ALIGN_MAX_PWR 28
#define __ARM_FP16_FORMAT_IEEE 1
#define __ARM_FP16_ARGS 1
#define __ARM_FEATURE_CLZ 1
#define __ARM_64BIT_STATE 1
#define __ARM_FEATURE_FMA 1
#define __ARM_ARCH_PROFILE 65
#define __ARM_PCS_AAPCS64 1
#define __ARM_ARCH 8
#define __ARM_FEATURE_UNALIGNED 1
#define __ARM_ARCH_8A 1
#define __ARM_NEON 1
#define __ARM_ALIGN_MAX_STACK_PWR 16
#define __ARM_FEATURE_NUMERIC_MAXMIN 1
#define __ARM_ARCH_ISA_A64 1

When I do this instead:

❯ gcc -dM -E - -march=armv8-a+crc < /dev/null | egrep -i '(arm|neon|acle|crc)'                                                                                        crc32 -> main ! $
#define __ARM_SIZEOF_WCHAR_T 4
#define __ARM_FEATURE_IDIV 1
#define __ARM_FP 14
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_ALIGN_MAX_PWR 28
#define __ARM_FP16_FORMAT_IEEE 1
#define __ARM_FP16_ARGS 1
#define __ARM_FEATURE_CLZ 1
#define __ARM_64BIT_STATE 1
#define __ARM_FEATURE_FMA 1
#define __ARM_ARCH_PROFILE 65
#define __ARM_PCS_AAPCS64 1
#define __ARM_ARCH 8
#define __ARM_FEATURE_UNALIGNED 1
#define __ARM_ARCH_8A 1
#define __ARM_FEATURE_CRC32 1
#define __ARM_NEON 1
#define __ARM_ALIGN_MAX_STACK_PWR 16
#define __ARM_FEATURE_NUMERIC_MAXMIN 1
#define __ARM_ARCH_ISA_A64 1

But, I see ARM_FEATURE_CRC32 defined, but not aarch64__.

Update:

It looks like g++, has the right env,

❯ g++ -dM -E - -march=armv8-a+crc </dev/null | egrep -i '(arm|neon|aarch)'                                                                                            build -> main ! $
#define __ARM_SIZEOF_WCHAR_T 4
#define __ARM_FEATURE_IDIV 1
#define __ARM_FP 14
#define __AARCH64_CMODEL_SMALL__ 1
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_ALIGN_MAX_PWR 28
#define __ARM_FP16_FORMAT_IEEE 1
#define __ARM_FP16_ARGS 1
#define __ARM_FEATURE_CLZ 1
#define __aarch64__ 1
#define __AARCH64EL__ 1
#define __ARM_64BIT_STATE 1
#define __ARM_FEATURE_FMA 1
#define __ARM_ARCH_PROFILE 65
#define __ARM_PCS_AAPCS64 1
#define __ARM_ARCH 8
#define __ARM_FEATURE_UNALIGNED 1
#define __ARM_ARCH_8A 1
#define __ARM_FEATURE_CRC32 1
#define __ARM_NEON 1
#define __ARM_ALIGN_MAX_STACK_PWR 16
#define __ARM_FEATURE_NUMERIC_MAXMIN 1
#define __ARM_ARCH_ISA_A64 1
juliusl commented 2 years ago

I managed to get this building, but I needed to change this line,

https://github.com/alibaba/PhotonLibOS/blob/c7c71b75293b500932e0900013e37d4fad5919a5/CMakeLists.txt#L26

here is the patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d8e5cd..8a5faab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE on)
 if (${ARCH} STREQUAL x86_64)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcrc32 -msse4.2")
 else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+crc")
 endif()

 set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})

(Also, I needed to set my compiler to g++)