Skip to content

Commit

Permalink
next try
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm committed Apr 18, 2023
1 parent 0c6af50 commit 29876a5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 17 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ add_link_options(
-static-libstdc++
)

link_libraries(ssp)

find_package (WinDbg)

include_directories (
Expand Down Expand Up @@ -61,13 +59,12 @@ include (StaticCRT)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" OR
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "8.3")
add_compile_options (-fstack-protector-all)
add_link_options(-lssp)
link_libraries(ssp)
endif ()

if (CMAKE_SIZEOF_VOID_P EQUAL 8)
add_compile_definitions (HAVE_WIN64=1)
else ()
add_link_options (-Wl,--enable-stdcall-fixup)
add_compile_definitions (HAVE_WIN64=0)
endif ()

Expand Down
4 changes: 0 additions & 4 deletions ci/toolchain/aarch64-w64-mingw32-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# Statically link CRT
set (CMAKE_C_FLAGS "--start-no-unused-arguments -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
set (CMAKE_CXX_FLAGS "--start-no-unused-arguments -static-libstdc++ -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
4 changes: 0 additions & 4 deletions ci/toolchain/i686-w64-mingw32-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# Statically link CRT
set (CMAKE_C_FLAGS "--start-no-unused-arguments -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
set (CMAKE_CXX_FLAGS "--start-no-unused-arguments -static-libstdc++ -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
4 changes: 0 additions & 4 deletions ci/toolchain/x86_64-w64-mingw32-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# Statically link CRT
set (CMAKE_C_FLAGS "--start-no-unused-arguments -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
set (CMAKE_CXX_FLAGS "--start-no-unused-arguments -static-libstdc++ -Wl,-Bstatic -lunwind -Wl,-Bdynamic --end-no-unused-arguments")
2 changes: 1 addition & 1 deletion tests/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ add_test_executable (ud2 ud2.c)
if (MINGW)
target_compile_options (stack_buffer_overflow PRIVATE -fstack-protector-all)
target_link_options (stack_buffer_overflow PRIVATE -fstack-protector-all)
target_link_libraries (stack_buffer_overflow PRIVATE -Wl,-Bstatic -lssp -Wl,-Bdynamic)
target_link_libraries (stack_buffer_overflow PRIVATE ssp)
endif ()
if (MSVC)
target_compile_options (stack_buffer_overflow PRIVATE /GS)
Expand Down

0 comments on commit 29876a5

Please sign in to comment.