apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.47k stars 452 forks source link

Fail to build project on MacOS running on M1 #587

Closed indianmifan closed 2 years ago

indianmifan commented 2 years ago

Search before asking

Version

building Kvrocks, commit id: 411bf43710679a7fa8a5c4b5e4946225757be562 -- Available event backends: -- CMAKE_BINARY_DIR: /Users/mifan/incubator-kvrocks/build -- CMAKE_CURRENT_BINARY_DIR: /Users/mifan/incubator-kvrocks/build/_deps/libevent-build -- CMAKE_SOURCE_DIR: /Users/mifan/incubator-kvrocks -- CMAKE_CURRENT_SOURCE_DIR: /Users/mifan/incubator-kvrocks/build/_deps/libevent-src -- PROJECT_BINARY_DIR: /Users/mifan/incubator-kvrocks/build/_deps/libevent-build -- PROJECT_SOURCE_DIR: /Users/mifan/incubator-kvrocks/build/_deps/libevent-src -- CMAKE_MODULE_PATH: /Users/mifan/incubator-kvrocks/build/_deps/libevent-src/cmake/ -- CMAKE_COMMAND: /opt/homebrew/Cellar/cmake/3.23.0/bin/cmake -- CMAKE_ROOT: /opt/homebrew/Cellar/cmake/3.23.0/share/cmake -- CMAKE_SYSTEM: Darwin-21.4.0 -- CMAKE_SYSTEM_NAME: Darwin -- CMAKE_SYSTEM_VERSION: 21.4.0 -- CMAKE_SYSTEM_PROCESSOR: arm64 -- CMAKE_SKIP_RPATH: NO -- CMAKE_VERBOSE_MAKEFILE: FALSE -- CMAKE_C_FLAGS: -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing -Wstrict-prototypes -fno-strict-aliasing -Wmissing-prototypes -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Waddress -Woverride-init -Wwrite-strings -Wno-unused-function -Wno-error=deprecated-declarations -Qunused-arguments -- CMAKE_BUILD_TYPE: Release -- CMAKE_C_COMPILER: /Library/Developer/CommandLineTools/usr/bin/cc (id AppleClang, clang 1, GNUC 1) -- CMAKE_AR: /Library/Developer/CommandLineTools/usr/bin/ar -- CMAKE_RANLIB: /Library/Developer/CommandLineTools/usr/bin/ranlib

Minimal reproduce step

$ git clone https://github.com/apache/incubator-kvrocks.git
$ cd kvrocks
$ mkdir build
$ ./build.sh build

What did you expect to see?

successfully build

What did you see instead?

......
Consolidate compiler generated dependencies of target kvrocks
[ 88%] Linking CXX executable kvrocks
ld: warning: ignoring file _deps/lua-src/src/liblua.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
  "_luaL_argerror", referenced from:
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
  "_luaL_checkinteger", referenced from:
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
      Lua::redisMathRandomSeed(lua_State*) in scripting.cc.o
......
......

Anything Else?

No response

Are you willing to submit a PR?

PragmaTwice commented 2 years ago

Could you provide the full error log? i.e. the full output of cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..; make in a fresh build directory (e.g. empty dir). Thanks! It is sad that I do not have any device with apple silicon. 😢

git-hulk commented 2 years ago

Me too. @ShooterIT @Alfejik Can help to have a try if you have the M1 machine. Seems the lua library only supported macosx platform but can't specify the arm64 arch. I'm not sure whether we can fix it with passing compile flags or not.

indianmifan commented 2 years ago

Could you provide the full error log? i.e. the full output of cmake -DCMAKE_VERBOSE_MAKEFILE=ON ..; make in a fresh build directory (e.g. empty dir). Thanks! It is sad that I do not have any device with apple silicon. 😢

// stdout is omitted

clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lapi.c:16:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lcode.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ldebug.c:16:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ldo.c:15:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ldump.c:12:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lfunc.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lgc.c:12:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from llex.c:15:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lmem.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lobject.c:16:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lopcodes.c:11:
In file included from ./lopcodes.h:10:
In file included from ./llimits.h:15:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lparser.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lstate.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lstring.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ltable.c:27:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ltm.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lundump.c:12:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lvm.c:15:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lzio.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lauxlib.c:23:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lbaselib.c:17:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ldblib.c:15:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from liolib.c:16:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lmathlib.c:14:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from loslib.c:17:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from ltablib.c:13:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lstrlib.c:17:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from loadlib.c:19:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from linit.c:11:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lua_cjson.c:43:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lua_struct.c:36:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
/Users/mifan/incubator-kvrocks/build/_deps/glog-src/src/raw_logging.cc:139:3: warning: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
  safe_write(STDERR_FILENO, buffer, strlen(buffer));
  ^
/Users/mifan/incubator-kvrocks/build/_deps/glog-src/src/raw_logging.cc:63:34: note: expanded from macro 'safe_write'
# define safe_write(fd, s, len)  syscall(SYS_write, fd, s, len)
                                 ^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/unistd.h:746:6: note: 'syscall' has been explicitly marked deprecated here
int      syscall(int, ...);
         ^
1 warning generated.
In file included from lua_cmsgpack.c:7:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
clang: warning: -lreadline: 'linker' input unused [-Wunused-command-line-argument]
In file included from lua_bit.c:32:
In file included from ./lua.h:16:
./luaconf.h:55:9: warning: 'LUA_USE_MKSTEMP' macro redefined [-Wmacro-redefined]
#define LUA_USE_MKSTEMP
        ^
<command line>:4:9: note: previous definition is here
#define LUA_USE_MKSTEMP 1
        ^
1 warning generated.
ar: `u' modifier ignored since `D' is the default (see `U')
/Users/mifan/incubator-kvrocks/build/_deps/libevent-src/evutil_rand.c:197:2: warning: 'arc4random_addrandom' is deprecated: first deprecated in macOS 10.12 - use arc4random_stir [-Wdeprecated-declarations]
        arc4random_addrandom((unsigned char*)buf,
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/stdlib.h:258:7: note: 'arc4random_addrandom' has been explicitly marked deprecated here
void     arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
         ^
1 warning generated.
/Users/mifan/incubator-kvrocks/build/_deps/glog-src/src/utilities.cc:262:17: warning: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Wdeprecated-declarations]
    pid_t tid = syscall(__NR_gettid);
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/unistd.h:746:6: note: 'syscall' has been explicitly marked deprecated here
int      syscall(int, ...);
         ^
1 warning generated.
ld: warning: ignoring file _deps/lua-src/src/liblua.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
  "_luaL_argerror", referenced from:
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
  "_luaL_checkinteger", referenced from:
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
      Lua::redisMathRandomSeed(lua_State*) in scripting.cc.o
  "_luaL_error", referenced from:
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
  "_luaL_loadbuffer", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::enableGlobalsProtection(lua_State*) in scripting.cc.o
      Lua::createFunction(Server*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
  "_luaL_newstate", referenced from:
      Lua::CreateState() in scripting.cc.o
  "_lua_call", referenced from:
      Lua::loadLibraries(lua_State*)::$_0::operator()(lua_State*, char const*, int (*)(lua_State*)) const in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_close", referenced from:
      Lua::DestroyState(lua_State*) in scripting.cc.o
  "_lua_createtable", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::setGlobalArray(lua_State*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in scripting.cc.o
      Lua::pushError(lua_State*, char const*) in scripting.cc.o
      Lua::redisReturnSingleFieldTable(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Status(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Error(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Aggregate(lua_State*, char const*, int) in scripting.cc.o
      ...
  "_lua_error", referenced from:
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
      Lua::redisSha1hexCommand(lua_State*) in scripting.cc.o
      Lua::raiseError(lua_State*) in scripting.cc.o
  "_lua_gc", referenced from:
      Server::GetMemoryInfo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in server.cc.o
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
  "_lua_getfield", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_gettable", referenced from:
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::raiseError(lua_State*) in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_gettop", referenced from:
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
      Lua::redisSha1hexCommand(lua_State*) in scripting.cc.o
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
      Lua::redisGenericCommand(lua_State*, int) in scripting.cc.o
      Lua::redisReturnSingleFieldTable(lua_State*, char const*) in scripting.cc.o
  "_lua_isnumber", referenced from:
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
  "_lua_pcall", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::enableGlobalsProtection(lua_State*) in scripting.cc.o
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::createFunction(Server*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_pushboolean", referenced from:
      Lua::redisProtocolToLuaType_Bulk(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Aggregate(lua_State*, char const*, int) in scripting.cc.o
      Lua::redisProtocolToLuaType_Bool(lua_State*, char const*, int) in scripting.cc.o
  "_lua_pushcclosure", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::loadLibraries(lua_State*)::$_0::operator()(lua_State*, char const*, int (*)(lua_State*)) const in scripting.cc.o
  "_lua_pushlstring", referenced from:
      Lua::setGlobalArray(lua_State*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in scripting.cc.o
      Lua::redisProtocolToLuaType_Bulk(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Status(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Error(lua_State*, char const*) in scripting.cc.o
  "_lua_pushnil", referenced from:
      Lua::removeUnsupportedFunctions(lua_State*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Null(lua_State*, char const*) in scripting.cc.o
  "_lua_pushnumber", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::redisMathRandom(lua_State*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Int(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Aggregate(lua_State*, char const*, int) in scripting.cc.o
      Lua::redisProtocolToLuaType_Double(lua_State*, char const*) in scripting.cc.o
  "_lua_pushstring", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
      Lua::redisSha1hexCommand(lua_State*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::pushError(lua_State*, char const*) in scripting.cc.o
      Lua::raiseError(lua_State*) in scripting.cc.o
      Lua::loadLibraries(lua_State*)::$_0::operator()(lua_State*, char const*, int (*)(lua_State*)) const in scripting.cc.o
      ...
  "_lua_pushvalue", referenced from:
      Lua::redisReturnSingleFieldTable(lua_State*, char const*) in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_rawseti", referenced from:
      Lua::setGlobalArray(lua_State*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in scripting.cc.o
  "_lua_setfield", referenced from:
      Lua::removeUnsupportedFunctions(lua_State*) in scripting.cc.o
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::setGlobalArray(lua_State*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in scripting.cc.o
  "_lua_settable", referenced from:
      Lua::loadFuncs(lua_State*) in scripting.cc.o
      Lua::pushError(lua_State*, char const*) in scripting.cc.o
      Lua::redisReturnSingleFieldTable(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Status(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Error(lua_State*, char const*) in scripting.cc.o
      Lua::redisProtocolToLuaType_Aggregate(lua_State*, char const*, int) in scripting.cc.o
      Lua::redisProtocolToLuaType_Double(lua_State*, char const*) in scripting.cc.o
      ...
  "_lua_settop", referenced from:
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::createFunction(Server*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::sortArray(lua_State*) in scripting.cc.o
  "_lua_toboolean", referenced from:
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
  "_lua_tolstring", referenced from:
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
      Lua::redisSha1hexCommand(lua_State*) in scripting.cc.o
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::createFunction(Server*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::redisGenericCommand(lua_State*, int) in scripting.cc.o
  "_lua_tonumber", referenced from:
      Lua::redisLogCommand(lua_State*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::redisGenericCommand(lua_State*, int) in scripting.cc.o
  "_lua_type", referenced from:
      Lua::evalGenericCommand(Redis::Connection*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in scripting.cc.o
      Lua::replyToRedisReply(lua_State*) in scripting.cc.o
      Lua::redisGenericCommand(lua_State*, int) in scripting.cc.o
      Lua::redisReturnSingleFieldTable(lua_State*, char const*) in scripting.cc.o
  "_luaopen_base", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_bit", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_cjson", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_cmsgpack", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_debug", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_math", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_string", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_struct", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
  "_luaopen_table", referenced from:
      Lua::loadLibraries(lua_State*) in scripting.cc.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [kvrocks] Error 1
make[2]: *** [CMakeFiles/kvrocks.dir/all] Error 2
make[1]: *** [CMakeFiles/kvrocks.dir/rule] Error 2
make: *** [kvrocks] Error 2
PragmaTwice commented 2 years ago

Maybe you can try this solution https://github.com/bitcoin/bitcoin/issues/20825#issuecomment-753444519. Don't know if it will work but there are a lot of similarities.

PragmaTwice commented 2 years ago

Refer to https://stackoverflow.com/questions/69335349/error-when-compiling-protobuf-for-c-in-ios-undefined-symbols-and-ld-warni ,you can try brew uninstall binutils.

indianmifan commented 2 years ago

Refer to https://stackoverflow.com/questions/69335349/error-when-compiling-protobuf-for-c-in-ios-undefined-symbols-and-ld-warni ,you can try brew uninstall binutils.

Thanks, this solves my problem !

ShooterIT commented 2 years ago

thanks @PragmaTwice and @indianmifan Closed