From 9f5b7e278fea7e84dbc6a0f2a71d810a09580ad2 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 7 Jan 2023 17:26:04 +0800 Subject: [PATCH] Enable -gdb-index when building mold --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbe154f9..60bfdfd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ include(GNUInstallDirs) # Build mold itself using mold if -DMOLD_USE_MOLD=ON option(MOLD_USE_MOLD "Use mold to build mold" OFF) if(MOLD_USE_MOLD) - add_link_options(-fuse-ld=mold) + add_link_options(-fuse-ld=mold -Wl,-gdb-index) endif() add_executable(mold) @@ -65,7 +65,8 @@ if(NOT "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-sign-compare - -Wno-unused-function) + -Wno-unused-function + -ggnu-pubnames) endif() # Build mold with -flto if -DMOLD_LTO=ON