Cockroach: build: broken build on ARM64

Created on 7 Sep 2017  Â·  6Comments  Â·  Source: cockroachdb/cockroach

https://github.com/cockroachdb/cockroach/pull/16949 created a regression in our ARM build. RocksDB will no longer compile on ARM64 because of a few issues:

  • We now pass the -msse3 flag regardless of if it's supported by the target architecture or not
  • nmmintrin.h is now included in rocksdb/util/crc32c.cc unconditionally
  • There is some funkiness around ExtendImpl and __attribute__((feature("sse4.2")) in rocksdb/util/crc32c.cc

Extra context:

The second issue results in the following build error:

/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc:18:23: fatal error: nmmintrin.h: No such file or directory

The third issue results in the following build error:

/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc:317:61: error: target attribute 'sse4.2' is invalid
 static inline void Fast_CRC32(uint64_t* l, uint8_t const **p) {
                                                             ^
/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc: In function 'void rocksdb::crc32c::Fast_CRC32(uint64_t*, const uint8_t**)':
/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc:319:39: error: '_mm_crc32_u64' was not declared in this scope
   *l = _mm_crc32_u64(*l, LE_LOAD64(*p));
                                       ^
/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc: At global scope:
/home/nvidia/Documents/Go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb/util/crc32c.cc:389:62: error: target attribute 'sse4.2' is invalid
 uint32_t ExtendImpl<Fast_CRC32>(uint32_t, const char*, size_t);
                                                              ^
CMakeFiles/rocksdb.dir/build.make:3062: recipe for target 'CMakeFiles/rocksdb.dir/util/crc32c.cc.o' failed

cc. @benesch

B-unsupported-arch

Most helpful comment

Let me know if you nee arm64 hardware to help test, validate, or benchmark any of this - I have gear available through the Works on Arm program http://github.com/worksonarm/cluster .

All 6 comments

Thanks @nvanbenschoten for diagnosing this, looking forward to getting the build back working.

Ping to show there's some interest in making the arm64 builds build again.

Note that #16949 brought in an update to RocksDB that exists only in our fork (https://github.com/cockroachdb/rocksdb). It would be nice, while working on this, to upstream the resulting work.

Yep—this problem is in fact why I haven't upstreamed it yet. We need
__x86__ #ifdef guards or something similar.

On Sun, Oct 22, 2017 at 3:36 PM, Tamir Duberstein notifications@github.com
wrote:

Note that #16949 https://github.com/cockroachdb/cockroach/pull/16949
brought in an update to RocksDB that exists only in our fork (
https://github.com/cockroachdb/rocksdb). It would be nice, while working
on this, to upstream the resulting work.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cockroachdb/cockroach/issues/18319#issuecomment-338503145,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA15IISVcoMr-2dcGAdA4h_Vds2TztWNks5su5kngaJpZM4PP-GZ
.

Let me know if you nee arm64 hardware to help test, validate, or benchmark any of this - I have gear available through the Works on Arm program http://github.com/worksonarm/cluster .

@vielmetti, we'd love to take you up on that offer! I'd be happy to set up an ARM build agent for our CI to ensure we don't break the ARM build in the future. A Type 1 or Type 2 server would be more than sufficient for our purposes. Let me know if you'd like me to submit a formal request. We can also chat via email—[email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

otan picture otan  Â·  4Comments

awoods187 picture awoods187  Â·  3Comments

danhhz picture danhhz  Â·  3Comments

magaldima picture magaldima  Â·  3Comments

intech picture intech  Â·  3Comments