facebook / facebook/rocksdb

Cant build librocksdb.a for iOS platform in M1

Open
#8,416 6 comments 0 reactions 0 assignees View on GitHub
ios question up-for-grabs
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

As the title says.
Here is the code I use
`TARGET_OS=IOS DEBUG_LEVEL=0 make static_lib`

And here is the message :
```
$DEBUG_LEVEL is 0
monitoring/perf_context.cc:23:2: error: "No thread-local support. Disable perf context with -DNPERF_CONTEXT."
#error "No thread-local support. Disable perf context with -DNPERF_CONTEXT."
^
1 error generated.
monitoring/iostats_context.cc:19:2: error: "No thread-local support. Disable iostats context with -DNIOSTATS_CONTEXT."
#error \
^
1 error generated.
mkdir -p ios-x86/cache/
g++ -march=armv8-a+crc+crypto -fno-rtti -W -Wextra -Wall -Wsign-compare -Wshadow -Wunused-parameter -Werror -I. -I./include -std=c++11 -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_MACOSX -DIOS_CROSS_COMPILE -DROCKSDB_LITE -Wshorten-64-to-32 -DHAVE_UINT128_EXTENSION -isystem third-party/gtest-1.8.1/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -DNDEBUG -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -arch i686 -arch x86_64 -c cache/cache.cc -o ios-x86/cache/cache.o
error: unknown target CPU 'armv8-a+crc+crypto'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64
make: *** [cache/cache.o] Error 1
```

And my computer message:
OS: 11.3.1
CPU: M1

The Branch I use: Master (ecccc6317)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `TARGET_OS=IOS DEBUG_LEVEL=0 make static_lib` on the reported M1 setup. Inspect the build inputs for `monitoring/perf_context.cc`, `monitoring/iostats_context.cc`, and `cache/cache.cc`, especially the iOS architecture and thread-local flags shown in the error. Done means the command builds `librocksdb.a` for iOS without these compilation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios
Domain
build-system, databases, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.