From 2ea8e5cc77b254a96a92ca204c2599ead02bc419 Mon Sep 17 00:00:00 2001 From: "zodiac@gmail.com" Date: Tue, 30 Mar 2010 17:16:49 +0000 Subject: [PATCH] OpenWRT builds with a toolchain that doesn't set correct entries in the ELF headers, giving us no way to auto-detect the architecture. We have to hard-code the flags that we pass to objcopy. Unfortunately, we have to do this for all MIPS targets. This could conceivably break building the code on other MIPS targets. If that happens, we'll deal with it at that time. git-svn-id: https://shellinabox.googlecode.com/svn/trunk@203 0da03de8-d603-11dd-86c2-0f8696b7b6f9 --- Makefile.am | 19 ++++++++++--------- Makefile.in | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Makefile.am b/Makefile.am index ef5a89c..1aac935 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,15 +111,16 @@ shellinaboxd_LDADD = liblogging.la \ shellinaboxd_LDFLAGS = -static objcopyflags = case "$(host_cpu)" in \ - i[0-9]86) echo '-O elf32-i386 -B i386';; \ - x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ - *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \ - $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \ - -o /tmp/probe$$$$.o /dev/null && \ - objdump -f /tmp/probe$$$$.o | \ - sed -e 's/.*file format */-O /;t; \ - s/architecture: *\([^,]*\).*/-B \1/;t;\ - d';; \ + i[0-9]86)echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ + mips*) echo '-O elf32-tradlittlemips -B mips:isa32'\ + *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \ + $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \ + -o /tmp/probe$$$$.o /dev/null && \ + objdump -f /tmp/probe$$$$.o | \ + sed -e 's/.*file format */-O /;t; \ + s/architecture: *\([^,]*\).*/-B \1/;t; \ + d';; \ esac renamesymbols = \ diff --git a/Makefile.in b/Makefile.in index 5620d3e..6630572 100644 --- a/Makefile.in +++ b/Makefile.in @@ -373,15 +373,16 @@ shellinaboxd_LDADD = liblogging.la \ shellinaboxd_LDFLAGS = -static objcopyflags = case "$(host_cpu)" in \ - i[0-9]86) echo '-O elf32-i386 -B i386';; \ - x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ - *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \ - $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \ - -o /tmp/probe$$$$.o /dev/null && \ - objdump -f /tmp/probe$$$$.o | \ - sed -e 's/.*file format */-O /;t; \ - s/architecture: *\([^,]*\).*/-B \1/;t;\ - d';; \ + i[0-9]86)echo '-O elf32-i386 -B i386';; \ + x86_64) echo '-O elf64-x86-64 -B i386:x86-64';; \ + mips*) echo '-O elf32-tradlittlemips -B mips:isa32'\ + *) trap 'rm -f /tmp/probe$$$$.o' EXIT; \ + $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc \ + -o /tmp/probe$$$$.o /dev/null && \ + objdump -f /tmp/probe$$$$.o | \ + sed -e 's/.*file format */-O /;t; \ + s/architecture: *\([^,]*\).*/-B \1/;t; \ + d';; \ esac renamesymbols = \