]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add FreeBSD compatibility to test suites
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Tue, 12 Jun 2018 20:23:57 +0000 (22:23 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 14 Aug 2018 19:39:15 +0000 (21:39 +0200)
test/run
test/suites/debug_prefix_map.bash

index 0bbb21c441e5a3cf50e6c0944110d143c8b321c4..4e1efd4bbcaf188ae89f8f36953681ef54e4fb93 100755 (executable)
--- 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
index 25cc36ff2248a4e5143c0d1de3912cf764babd8d..d00e654767c14b233a4cb53632af21d4fac9a7bd 100644 (file)
@@ -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