mirror of
https://github.com/reactos/reactos.git
synced 2025-05-09 03:37:08 +00:00
[CMAKE] Get rid of freeldr_pe_dbg target
objcopy bug is now solved and I can't remember how this used to work anyway. Use strip instead. If you need to debug freeldr - set SEPARATE_DBG cmake var to TRUE - use qemu GDB stub - In GDB : add-symbol-file <build_dir>/symbols/freeldr_pe.exe
This commit is contained in:
parent
66dea86d68
commit
5c332f6d36
1 changed files with 10 additions and 30 deletions
|
@ -1,11 +1,4 @@
|
||||||
|
|
||||||
if(SEPARATE_DBG)
|
|
||||||
# FIXME: http://sourceware.org/bugzilla/show_bug.cgi?id=11822
|
|
||||||
set(CMAKE_LDR_PE_HELPER_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
||||||
set(CMAKE_LDR_PE_HELPER_STANDARD_LIBRARIES_INIT "")
|
|
||||||
set(CMAKE_LDR_PE_HELPER_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Explicitly use string pooling
|
# Explicitly use string pooling
|
||||||
add_compile_options("/GF")
|
add_compile_options("/GF")
|
||||||
|
@ -265,69 +258,56 @@ if(ARCH STREQUAL "i386")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(freeldr_pe ${FREELDR_BASE_SOURCE})
|
add_executable(freeldr_pe ${FREELDR_BASE_SOURCE})
|
||||||
add_executable(freeldr_pe_dbg EXCLUDE_FROM_ALL ${FREELDR_BASE_SOURCE})
|
|
||||||
|
|
||||||
set_target_properties(freeldr_pe freeldr_pe_dbg
|
set_target_properties(freeldr_pe
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
ENABLE_EXPORTS TRUE
|
ENABLE_EXPORTS TRUE
|
||||||
DEFINE_SYMBOL "")
|
DEFINE_SYMBOL "")
|
||||||
|
|
||||||
if(NOT MSVC AND SEPARATE_DBG)
|
|
||||||
set_target_properties(freeldr_pe PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
|
|
||||||
set_target_properties(freeldr_pe_dbg PROPERTIES LINKER_LANGUAGE LDR_PE_HELPER)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(ARCH STREQUAL "arm")
|
if(ARCH STREQUAL "arm")
|
||||||
add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER")
|
add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER")
|
||||||
add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER")
|
|
||||||
else()
|
else()
|
||||||
target_link_options(freeldr_pe PRIVATE /ignore:4078 /ignore:4254 /DYNAMICBASE:NO /FIXED /FILEALIGN:512 /ALIGN:512)
|
target_link_options(freeldr_pe PRIVATE /ignore:4078 /ignore:4254 /DYNAMICBASE:NO /FIXED /FILEALIGN:512 /ALIGN:512)
|
||||||
add_linker_script(freeldr_pe freeldr_i386.msvc.lds)
|
add_linker_script(freeldr_pe freeldr_i386.msvc.lds)
|
||||||
target_link_options(freeldr_pe_dbg PRIVATE /ignore:4078 /ignore:4254 /DYNAMICBASE:NO /FIXED /FILEALIGN:512 /ALIGN:512)
|
|
||||||
add_linker_script(freeldr_pe_dbg freeldr_i386.msvc.lds)
|
|
||||||
endif()
|
endif()
|
||||||
# We don't need hotpatching
|
# We don't need hotpatching
|
||||||
remove_target_compile_option(freeldr_pe "/hotpatch")
|
remove_target_compile_option(freeldr_pe "/hotpatch")
|
||||||
remove_target_compile_option(freeldr_pe_dbg "/hotpatch")
|
|
||||||
remove_target_compile_option(freeldr_common "/hotpatch")
|
remove_target_compile_option(freeldr_common "/hotpatch")
|
||||||
else()
|
else()
|
||||||
add_target_link_flags(freeldr_pe "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x200,--section-alignment,0x200")
|
target_link_options(freeldr_pe PRIVATE -Wl,--exclude-all-symbols,--file-alignment,0x200,--section-alignment,0x200)
|
||||||
add_linker_script(freeldr_pe freeldr_gcc.lds)
|
add_linker_script(freeldr_pe freeldr_gcc.lds)
|
||||||
add_target_link_flags(freeldr_pe_dbg "-Wl,--exclude-all-symbols,--file-alignment,0x200,--section-alignment,0x200")
|
if (NOT SEPARATE_DBG)
|
||||||
add_linker_script(freeldr_pe_dbg freeldr_gcc.lds)
|
target_link_options(freeldr_pe PRIVATE -Wl,--strip-all)
|
||||||
|
else()
|
||||||
|
# Strip everything (more than objcopy --strip-debug does)
|
||||||
|
add_custom_command(TARGET freeldr_pe
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${CMAKE_STRIP} --strip-all $<TARGET_FILE:freeldr_pe>)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_image_base(freeldr_pe 0x10000)
|
set_image_base(freeldr_pe 0x10000)
|
||||||
set_subsystem(freeldr_pe native)
|
set_subsystem(freeldr_pe native)
|
||||||
set_entrypoint(freeldr_pe RealEntryPoint)
|
set_entrypoint(freeldr_pe RealEntryPoint)
|
||||||
|
|
||||||
set_image_base(freeldr_pe_dbg 0x10000)
|
|
||||||
set_subsystem(freeldr_pe_dbg native)
|
|
||||||
set_entrypoint(freeldr_pe_dbg RealEntryPoint)
|
|
||||||
|
|
||||||
if(ARCH STREQUAL "i386")
|
if(ARCH STREQUAL "i386")
|
||||||
target_link_libraries(freeldr_pe mini_hal)
|
target_link_libraries(freeldr_pe mini_hal)
|
||||||
target_link_libraries(freeldr_pe_dbg mini_hal)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(freeldr_pe freeldr_common cportlib cmlib rtl libcntpr)
|
target_link_libraries(freeldr_pe freeldr_common cportlib cmlib rtl libcntpr)
|
||||||
target_link_libraries(freeldr_pe_dbg freeldr_common cportlib cmlib rtl libcntpr)
|
|
||||||
|
|
||||||
# dynamic analysis switches
|
# dynamic analysis switches
|
||||||
if(STACK_PROTECTOR)
|
if(STACK_PROTECTOR)
|
||||||
target_sources(freeldr_pe PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
target_sources(freeldr_pe PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
||||||
target_sources(freeldr_pe_dbg PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(RUNTIME_CHECKS)
|
if(RUNTIME_CHECKS)
|
||||||
target_link_libraries(freeldr_pe runtmchk)
|
target_link_libraries(freeldr_pe runtmchk)
|
||||||
target_link_libraries(freeldr_pe_dbg runtmchk)
|
|
||||||
add_target_link_flags(freeldr_pe "/MERGE:.rtc=.text")
|
add_target_link_flags(freeldr_pe "/MERGE:.rtc=.text")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(freeldr_pe asm)
|
add_dependencies(freeldr_pe asm)
|
||||||
add_dependencies(freeldr_pe_dbg asm)
|
|
||||||
|
|
||||||
if(SARCH STREQUAL "pc98")
|
if(SARCH STREQUAL "pc98")
|
||||||
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/PC98)
|
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/PC98)
|
||||||
|
|
Loading…
Reference in a new issue