Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable folly::Symbolizer for debug symbols #8123

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions CMake/HPHPCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
set(FREEBSD FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(FREEBSD TRUE)
endif()
set(LINUX FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LINUX TRUE)
endif()
set(DARWIN FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(DARWIN TRUE)
endif()
set(WINDOWS FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(WINDOWS TRUE)
endif()

# Do this until cmake has a define for ARMv8
INCLUDE(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
Expand Down
5 changes: 4 additions & 1 deletion CMake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ option(ENABLE_PROXYGEN_SERVER "Build the Proxygen HTTP server" ON)
option(ENABLE_SPLIT_DWARF "Reduce linker memory usage by putting debugging information into .dwo files" OFF)

IF (LINUX)
option(MAP_TEXT_HUGE_PAGES "Remap hot static code onto huge pages" ON)
option(MAP_TEXT_HUGE_PAGES "Remap hot static code onto huge pages" ON)
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
option(ENABLE_FOLLY_SYMBOLIZER "Use folly::Symbolizer to obtain debug symbols when mapping text section onto huge pages" ON)
ENDIF()
ENDIF()

IF (NOT DEFAULT_CONFIG_DIR)
Expand Down
16 changes: 16 additions & 0 deletions CMake/SetOSVars.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(FREEBSD FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
set(FREEBSD TRUE)
endif()
set(LINUX FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(LINUX TRUE)
endif()
set(DARWIN FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(DARWIN TRUE)
endif()
set(WINDOWS FALSE)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(WINDOWS TRUE)
endif()
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ SET(TP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
SET(TP_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/third-party")

include(MSVCDefaults)
include(SetOSVars)
include(Options)
include(HPHPCompiler)
include(HPHPFindLibs)
Expand Down
4 changes: 4 additions & 0 deletions hphp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/tools/oss-repo-mode

add_definitions("-DUSE_CMAKE")

if (ENABLE_FOLLY_SYMBOLIZER)
add_definitions(-DUSE_FOLLY_SYMBOLIZER)
endif()

enable_language(ASM)

link_libraries(folly)
Expand Down
1 change: 0 additions & 1 deletion hphp/util/portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@
//////////////////////////////////////////////////////////////////////

#if FACEBOOK
#define USE_FOLLY_SYMBOLIZER 1
// Linking in libbfd is a gigantic PITA, but if folly symbolizer doesn't
// work on your platform, you'll need to figure it out.
#define HAVE_LIBBFD 1
Expand Down