facebook/proxygen

mac os cannot build: Undefined symbols for architecture x86_64 _mallctl

karol-bisztyga opened this issue · 2 comments

Hey!
I'm unable to build proxygen on my mac. I do

git clone https://github.com/facebook/proxygen.git
cd proxygen/proxygen
./build

I get following errors

[100%] Linking CXX executable logging_example
Undefined symbols for architecture x86_64:
  "_mallctl", referenced from:
      folly::usingJEMalloc() in libfolly.a(ExceptionString.cpp.o)
      folly::usingJEMalloc() in libfolly.a(Singleton.cpp.o)
      folly::usingJEMalloc() in libfolly.a(Demangle.cpp.o)
      folly::usingJEMalloc() in libfolly.a(ThreadLocalDetail.cpp.o)
      folly::detail::MemoryIdler::flushLocalMallocCaches() in libfolly.a(MemoryIdler.cpp.o)
      folly::usingJEMalloc() in libfolly.a(MemoryIdler.cpp.o)
      folly::usingJEMalloc() in libfolly.a(File.cpp.o)
      ...
  "_mallctlbymib", referenced from:
      folly::detail::MemoryIdler::flushLocalMallocCaches() in libfolly.a(MemoryIdler.cpp.o)
  "_mallctlnametomib", referenced from:
      folly::detail::MemoryIdler::flushLocalMallocCaches() in libfolly.a(MemoryIdler.cpp.o)
  "_mallocx", referenced from:
      folly::threadlocal_detail::StaticMetaBase::reallocate(folly::threadlocal_detail::ThreadEntry*, unsigned int, unsigned long&) in libfolly.a(ThreadLocalDetail.cpp.o)
  "_nallocx", referenced from:
      folly::fbstring_core<char>::initMedium(char const*, unsigned long) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::initLarge(char const*, unsigned long) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::reserveSmall(unsigned long, bool) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::reserveMedium(unsigned long) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::reserveLarge(unsigned long) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::unshare(unsigned long) in libfolly.a(ExceptionString.cpp.o)
      folly::fbstring_core<char>::reserveSmall(unsigned long, bool) in libfolly.a(Singleton.cpp.o)
      ...
  "_xallocx", referenced from:
      folly::threadlocal_detail::StaticMetaBase::reallocate(folly::threadlocal_detail::ThreadEntry*, unsigned int, unsigned long&) in libfolly.a(ThreadLocalDetail.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [folly/logging/example/logging_example] Error 1
make[1]: *** [folly/logging/example/CMakeFiles/logging_example.dir/all] Error 2
make: *** [all] Error 2

I get the same errors when I'm trying to build folly.
Any ideas?
Thanks

have you installed jemalloc?it seems like some symbols from jemalloc are missing

Please give it another try and reopen if it's still a problem