diff options
Diffstat (limited to 'scripts/build/debug')
-rw-r--r-- | scripts/build/debug/300-gdb.sh | 6 | ||||
-rw-r--r-- | scripts/build/debug/500-strace.sh | 30 |
2 files changed, 27 insertions, 9 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index ba13591..3d3af7b 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -105,6 +105,12 @@ do_debug_gdb_build() { CC_for_gdb+=" -static" LD_for_gdb+=" -static" fi + case "${CT_HOST}" in + *darwin*) + # FIXME: Really, we should be testing for host compiler being clang. + CC_for_gdb+=" -Qunused-arguments" + ;; + esac # Fix up whitespace. Some older GDB releases (e.g. 6.8a) get confused if there # are multiple consecutive spaces: sub-configure scripts replace them with a diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh index 0d33ca0..2961879 100644 --- a/scripts/build/debug/500-strace.sh +++ b/scripts/build/debug/500-strace.sh @@ -14,17 +14,29 @@ do_debug_strace_extract() { do_debug_strace_build() { CT_DoStep INFO "Installing strace" - mkdir -p "${CT_BUILD_DIR}/build-strace" - CT_Pushd "${CT_BUILD_DIR}/build-strace" + + # Strace needs _IOC definitions, and it tries to pick them up from <linux/ioctl.h>. + # While cross-compiling on a non-Linux host, we don't have this header. Replacing + # <linux/ioctl.h> with <sys/ioctl.h>, as suggested by many internet "solutions", + # is wrong: for example, MacOS defines _IOC macros differently, and we need the + # definitions for the target! + # Hence, create a "window" into target includes. + CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}/build-strace-headers" + for d in linux asm asm-generic; do + CT_DoExecLog ALL ln -sf "${CT_HEADERS_DIR}/${d}" "${CT_BUILD_DIR}/build-strace-headers/${d}" + done + + CT_mkdir_pushd "${CT_BUILD_DIR}/build-strace" CT_DoLog EXTRA "Configuring strace" - CT_DoExecLog CFG \ - CC="${CT_TARGET}-gcc" \ - CPP="${CT_TARGET}-cpp" \ - LD="${LD_TARGET}-ld" \ - "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure" \ - --build=${CT_BUILD} \ - --host=${CT_TARGET} \ + CT_DoExecLog CFG \ + CFLAGS_FOR_BUILD="-I ${CT_BUILD_DIR}/build-strace-headers" \ + CC="${CT_TARGET}-gcc" \ + CPP="${CT_TARGET}-cpp" \ + LD="${CT_TARGET}-ld" \ + "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_TARGET} \ --prefix=/usr CT_DoLog EXTRA "Building strace" |