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
This commit is contained in:
parent
9b0a937e35
commit
2ea8e5cc77
2 changed files with 20 additions and 18 deletions
|
@ -111,14 +111,15 @@ shellinaboxd_LDADD = liblogging.la \
|
|||
shellinaboxd_LDFLAGS = -static
|
||||
|
||||
objcopyflags = case "$(host_cpu)" in \
|
||||
i[0-9]86) echo '-O elf32-i386 -B i386';; \
|
||||
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;\
|
||||
s/architecture: *\([^,]*\).*/-B \1/;t; \
|
||||
d';; \
|
||||
esac
|
||||
|
||||
|
|
|
@ -373,14 +373,15 @@ shellinaboxd_LDADD = liblogging.la \
|
|||
|
||||
shellinaboxd_LDFLAGS = -static
|
||||
objcopyflags = case "$(host_cpu)" in \
|
||||
i[0-9]86) echo '-O elf32-i386 -B i386';; \
|
||||
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;\
|
||||
s/architecture: *\([^,]*\).*/-B \1/;t; \
|
||||
d';; \
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in a new issue