From: Anders F Björklund Date: Tue, 12 Jun 2018 20:23:57 +0000 (+0200) Subject: Add FreeBSD compatibility to test suites X-Git-Tag: v3.5~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bff692a150907dae702c8bb9c50627f3dc49203a;p=thirdparty%2Fccache.git Add FreeBSD compatibility to test suites --- diff --git a/test/run b/test/run index 0bbb21c44..4e1efd4bb 100755 --- a/test/run +++ b/test/run @@ -158,6 +158,11 @@ expect_equal_object_files() { test_failed "Please install elfutils to get eu-elfcmp" fi eu-elfcmp -q "$1" "$2" + elif $HOST_OS_FREEBSD && $COMPILER_TYPE_CLANG; then + elfdump -a -w "$1".dump "$1" + elfdump -a -w "$2".dump "$2" + # these were the elfdump fields that seemed to differ (empirically) + diff -I e_shoff -I sh_size -I st_name "$1".dump "$2".dump > /dev/null else cmp -s "$1" "$2" fi @@ -288,6 +293,7 @@ COMPILER_USES_MINGW=false HOST_OS_APPLE=false HOST_OS_LINUX=false +HOST_OS_FREEBSD=false HOST_OS_WINDOWS=false compiler_version="`$COMPILER --version 2>&1 | head -1`" @@ -323,6 +329,9 @@ case $(uname -s) in *Linux*) HOST_OS_LINUX=true ;; + *FreeBSD*) + HOST_OS_FREEBSD=true + ;; esac if $HOST_OS_WINDOWS; then diff --git a/test/suites/debug_prefix_map.bash b/test/suites/debug_prefix_map.bash index 25cc36ff2..d00e65476 100644 --- a/test/suites/debug_prefix_map.bash +++ b/test/suites/debug_prefix_map.bash @@ -23,6 +23,8 @@ EOF objdump_cmd() { if $HOST_OS_APPLE; then xcrun dwarfdump -r0 $1 + elif $HOST_OS_FREEBSD; then + objdump -W $1 else objdump -g $1 fi