Skip to content

Commit

Permalink
strip symbols in OSX and Linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
illera88 committed Jun 22, 2020
1 parent 15c74dc commit f9d1107
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-linux.yml
Expand Up @@ -166,7 +166,7 @@ jobs:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
cd my_artifacts
zip -r ../ponce-linux-$RELEASE_VERSION.zip *
zip -r ../ponce-$RELEASE_VERSION-linux.zip *
- name: Upload Linux artifacts
Expand All @@ -175,8 +175,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ponce-linux-${{ steps.vars.outputs.tag }}.zip
asset_name: ponce-linux-${{ steps.vars.outputs.tag }}.zip
asset_path: ./ponce-${{ steps.vars.outputs.tag }}-linux.zip
asset_name: ponce-${{ steps.vars.outputs.tag }}-linux.zip
asset_content_type: application/zip


6 changes: 3 additions & 3 deletions .github/workflows/ci-macos.yml
Expand Up @@ -155,7 +155,7 @@ jobs:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
cd my_artifacts
zip -r ../ponce-osx-$RELEASE_VERSION.zip *
zip -r ../ponce-$RELEASE_VERSION-osx.zip *
- name: Upload OSX artifacts
Expand All @@ -164,8 +164,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ponce-osx-${{ steps.vars.outputs.tag }}.zip
asset_name: ponce-osx-${{ steps.vars.outputs.tag }}.zip
asset_path: ./ponce-${{ steps.vars.outputs.tag }}-osx.zip
asset_name: ponce-${{ steps.vars.outputs.tag }}-osx.zip
asset_content_type: application/zip


6 changes: 3 additions & 3 deletions .github/workflows/ci-windows.yml
Expand Up @@ -157,7 +157,7 @@ jobs:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
cd my_artifacts
zip -r ../ponce-win-$RELEASE_VERSION.zip *
zip -r ../ponce-$RELEASE_VERSION-win.zip *
- name: Upload Windows artifacts
Expand All @@ -166,8 +166,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./ponce-win-${{ steps.vars.outputs.tag }}.zip
asset_name: ponce-win-${{ steps.vars.outputs.tag }}.zip
asset_path: ./ponce-${{ steps.vars.outputs.tag }}-win.zip
asset_name: ponce-${{ steps.vars.outputs.tag }}-win.zip
asset_content_type: application/zip


23 changes: 19 additions & 4 deletions CMakeLists.txt
Expand Up @@ -31,10 +31,6 @@ file(GLOB PONCE_HEADER_FILES
add_library(${PROJECT_NAME} SHARED ${PONCE_SOURCE_FILES} ${PONCE_HEADER_FILES})
add_library(${PROJECT_NAME}64 SHARED ${PONCE_SOURCE_FILES} ${PONCE_HEADER_FILES})

# Prevent creating ponce binaries as libPonce.so but do Ponce.so
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(${PROJECT_NAME}64 PROPERTIES PREFIX "")

# #
# Look for dependencies #
# #
Expand Down Expand Up @@ -188,14 +184,33 @@ if(WIN32)
elseif (APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE __MAC__ USE_DANGEROUS_FUNCTIONS USE_STANDARD_FILE_FUNCTIONS)
target_compile_definitions(${PROJECT_NAME}64 PRIVATE __MAC__ USE_DANGEROUS_FUNCTIONS USE_STANDARD_FILE_FUNCTIONS)
# Prevent creating ponce binaries as libPonce.so but do Ponce.so
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(${PROJECT_NAME}64 PROPERTIES PREFIX "")
set(PLUGIN_EXTENSION dylib)
elseif (UNIX AND NOT APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE __LINUX__ USE_DANGEROUS_FUNCTIONS)
target_compile_definitions(${PROJECT_NAME}64 PRIVATE __LINUX__ USE_DANGEROUS_FUNCTIONS)
# Prevent creating ponce binaries as libPonce.so but do Ponce.so
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(${PROJECT_NAME}64 PROPERTIES PREFIX "")
set(PLUGIN_EXTENSION so)
endif()


# Clean as much symbols as we can in OSX and Linux
if(NOT WIN32)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE -s)
set_target_properties(${PROJECT_NAME}64 PROPERTIES LINK_FLAGS_RELEASE -s)
if(EXISTS "/usr/bin/strip")
# Strip binary for release builds
if (CMAKE_BUILD_TYPE STREQUAL Release)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND "/usr/bin/strip" -s ${PROJECT_NAME})
endif ()
endif()
endif()

if(IDA_INSTALLED_DIR)
message(STATUS "[-] Ponce built plugin and pdb file will be moved to '${IDA_INSTALLED_DIR}/plugins/'. The build system should have permisions to write there or it will error.")
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
Expand Down

0 comments on commit f9d1107

Please sign in to comment.