Commit c598d4d1 authored by David Carlier's avatar David Carlier Committed by Facebook GitHub Bot

FreeBSD build fix, adding proper dependency on backtrace too. (#1557)

Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1557

Differential Revision: D27701865

Pulled By: yfeldblum

fbshipit-source-id: f9ed96a8e9283a30f1f96d15b4b8166ade5d3321
parent 37d9cd90
...@@ -159,6 +159,9 @@ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS}) ...@@ -159,6 +159,9 @@ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
if (LIBUNWIND_FOUND) if (LIBUNWIND_FOUND)
set(FOLLY_HAVE_LIBUNWIND ON) set(FOLLY_HAVE_LIBUNWIND ON)
endif() endif()
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
list(APPEND FOLLY_LINK_LIBRARIES "execinfo")
endif ()
cmake_push_check_state() cmake_push_check_state()
set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE) set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE)
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#pragma once #pragma once
#include <sys/types.h>
#include <folly/Function.h> #include <folly/Function.h>
namespace folly { namespace folly {
......
...@@ -1317,9 +1317,11 @@ Dwarf::LineNumberVM::StepResult Dwarf::LineNumberVM::step( ...@@ -1317,9 +1317,11 @@ Dwarf::LineNumberVM::StepResult Dwarf::LineNumberVM::step(
// use unbounded amounts of state (ie. use the heap). We'll do a second // use unbounded amounts of state (ie. use the heap). We'll do a second
// pass (using nextDefineFile()) if necessary. // pass (using nextDefineFile()) if necessary.
break; break;
#if !defined(__FreeBSD__)
case DW_LNE_set_discriminator: case DW_LNE_set_discriminator:
discriminator_ = readULEB(program); discriminator_ = readULEB(program);
return CONTINUE; return CONTINUE;
#endif
} }
// Unrecognized extended opcode // Unrecognized extended opcode
......
...@@ -41,7 +41,7 @@ namespace symbolizer { ...@@ -41,7 +41,7 @@ namespace symbolizer {
#if defined(ElfW) #if defined(ElfW)
#define FOLLY_ELF_ELFW(name) ElfW(name) #define FOLLY_ELF_ELFW(name) ElfW(name)
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
#define FOLLY_ELF_ELFW(...) Elf_##name #define FOLLY_ELF_ELFW(name) Elf_##name
#endif #endif
using ElfAddr = FOLLY_ELF_ELFW(Addr); using ElfAddr = FOLLY_ELF_ELFW(Addr);
......
...@@ -38,9 +38,9 @@ int mallctlnametomib(const char*, size_t*, size_t*) ...@@ -38,9 +38,9 @@ int mallctlnametomib(const char*, size_t*, size_t*)
__attribute__((__nothrow__, __weak__)); __attribute__((__nothrow__, __weak__));
int mallctlbymib(const size_t*, size_t, void*, size_t*, void*, size_t) int mallctlbymib(const size_t*, size_t, void*, size_t*, void*, size_t)
__attribute__((__nothrow__, __weak__)); __attribute__((__nothrow__, __weak__));
#endif
bool MallocExtension_Internal_GetNumericProperty(const char*, size_t, size_t*) bool MallocExtension_Internal_GetNumericProperty(const char*, size_t, size_t*)
__attribute__((__weak__)); __attribute__((__weak__));
#endif
#else #else
#if (!defined(USE_JEMALLOC) && !defined(FOLLY_USE_JEMALLOC)) || FOLLY_SANITIZE #if (!defined(USE_JEMALLOC) && !defined(FOLLY_USE_JEMALLOC)) || FOLLY_SANITIZE
// we do not want to declare these if we have jemalloc support // we do not want to declare these if we have jemalloc support
......
...@@ -55,7 +55,7 @@ char*** _NSGetEnviron(void); ...@@ -55,7 +55,7 @@ char*** _NSGetEnviron(void);
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
// Needed to resolve linkage // Needed to resolve linkage
char** environ; extern char** environ;
#endif #endif
#if !__linux__ && !FOLLY_MOBILE #if !__linux__ && !FOLLY_MOBILE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment