From 4a138d84078ab89a8f8bc636d5c4260951d4ee11 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 8 Jan 2017 01:26:52 -0600 Subject: Shut clang's warning that confuses configure. Warning causes gdb's configure to not detect declarations of LONG_MIN/MAX. Found-by: Kirill Smirnov Signed-off-by: Alexey Neyman --- scripts/build/debug/300-gdb.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/build/debug') diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index ba135911..3d3af7b1 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 -- cgit v1.2.3 From 7989e5d7434cc5bf822bf659875a3e0e105cfca7 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 8 Jan 2017 01:28:54 -0600 Subject: ${LD_TARGET} -> ${CT_TARGET}. Obvious typo, worked by some miracle. Signed-off-by: Alexey Neyman --- scripts/build/debug/500-strace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/build/debug') diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh index 0d33ca09..69408de1 100644 --- a/scripts/build/debug/500-strace.sh +++ b/scripts/build/debug/500-strace.sh @@ -21,7 +21,7 @@ do_debug_strace_build() { CT_DoExecLog CFG \ CC="${CT_TARGET}-gcc" \ CPP="${CT_TARGET}-cpp" \ - LD="${LD_TARGET}-ld" \ + LD="${CT_TARGET}-ld" \ "${CT_SRC_DIR}/strace-${CT_STRACE_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ -- cgit v1.2.3 From c69e593a9272ad186b6669bc5b12886890cea7fe Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 9 Jan 2017 01:01:52 -0600 Subject: Pick up and friends from TARGET. Otherwise, cross-compiling fails on non-Linux build machines. Signed-off-by: Alexey Neyman --- scripts/build/debug/500-strace.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'scripts/build/debug') diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh index 69408de1..29618791 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 . + # While cross-compiling on a non-Linux host, we don't have this header. Replacing + # with , 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="${CT_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" -- cgit v1.2.3