3 Commits

Author SHA1 Message Date
baddea7f57 Update and freeze pre-commit hooks
Some checks failed
weaselab/conflict-set/pipeline/head There was a failure building this commit
2024-04-03 12:20:26 -07:00
2d3e7b9004 Add shellcheck to pre-commit
Closes #22
2024-04-03 12:19:55 -07:00
c4862fee9b Add symbol tests for apple
closes #21
2024-04-03 12:15:08 -07:00
5 changed files with 7 additions and 34 deletions

View File

@@ -24,7 +24,8 @@ repos:
entry: '^#define SHOW_MEMORY 1$'
language: pygrep
types: [c++]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: a23f6b85d0fdd5bb9d564e2579e678033debbdff # frozen: v0.10.0.1
- repo: https://github.com/koalaman/shellcheck-precommit
rev: 2491238703a5d3415bb2b7ff11388bf775372f29 # frozen: v0.10.0
hooks:
- id: shellcheck
# args: ["--severity=warning"] # Optionally only show errors and warnings

View File

@@ -136,8 +136,7 @@ else()
TARGET ${PROJECT_NAME}-static
POST_BUILD
COMMAND
${CMAKE_OBJCOPY}
--keep-global-symbols=${CMAKE_SOURCE_DIR}/symbol-exports.txt
${CMAKE_OBJCOPY} --keep-global-symbols=${CMAKE_SOURCE_DIR}/symbols.txt
$<TARGET_FILE:${PROJECT_NAME}-static> || echo
"Proceeding with all symbols global in static library")
endif()
@@ -302,11 +301,7 @@ if(BUILD_TESTING)
set(symbol_imports ${CMAKE_SOURCE_DIR}/apple-symbol-imports.txt)
else()
set(symbol_exports ${CMAKE_SOURCE_DIR}/symbol-exports.txt)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(symbol_imports ${CMAKE_SOURCE_DIR}/aarch64-symbol-imports.txt)
else()
set(symbol_imports ${CMAKE_SOURCE_DIR}/symbol-imports.txt)
endif()
set(symbol_imports ${CMAKE_SOURCE_DIR}/symbol-imports.txt)
endif()
add_test(
NAME conflict_set_shared_symbols
@@ -346,12 +341,6 @@ set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
# deb
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
# see *-imports.txt - dependency versions need to be synced with symbol versions
if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.17)")
else()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14)")
endif()
include(CPack)

View File

@@ -1,8 +0,0 @@
__stack_chk_fail@GLIBC_2.17
__stack_chk_guard@GLIBC_2.17
abort@GLIBC_2.17
free@GLIBC_2.17
malloc@GLIBC_2.17
memcpy@GLIBC_2.17
memmove@GLIBC_2.17
memset@GLIBC_2.17

View File

@@ -1,9 +0,0 @@
_GLOBAL_OFFSET_TABLE_
__stack_chk_fail@GLIBC_2.4
__tls_get_addr@GLIBC_2.3
abort@GLIBC_2.2.5
free@GLIBC_2.2.5
malloc@GLIBC_2.2.5
memcpy@GLIBC_2.14
memmove@GLIBC_2.2.5
memset@GLIBC_2.2.5

View File

@@ -7,7 +7,7 @@ set -euo pipefail
diff -u <(sort < "$2") <(nm "$1" | grep " T " | cut -f3 -d " " | sort)
ec=0
for symbol in $(nm "$1" | grep " U " | sed 's/ U //') ; do
if ! grep --fixed-strings "$symbol" "$3" > /dev/null ; then
if ! grep "$symbol" "$3" > /dev/null ; then
echo "Imported symbol $symbol not present in $3"
ec=1
fi