From f0fc207ce7ded4dde29fdd49ebb40039eb220fbd Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 1 Dec 2014 14:21:28 -0500 Subject: [PATCH] tb_asm: update to compile on x86_64 systems sstrip won't happen though --- tb_asm/Makefile | 10 +++++----- tb_asm/arch.h | 6 ++++-- tb_asm/configure.c | 12 +++++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tb_asm/Makefile b/tb_asm/Makefile index 0e81412..385a09b 100644 --- a/tb_asm/Makefile +++ b/tb_asm/Makefile @@ -15,18 +15,18 @@ compress_data.o: compress_data.c lzss.o: lzss.c - gcc -O2 -Wall -c lzss.c + $(CC) $(CFLAGS) -c lzss.c lzss_new.o: lzss_new.c - gcc -O2 -Wall -c lzss_new.c + $(CC) $(CFLAGS) -c lzss_new.c tb_asm: tb_asm.o ./sstrip/sstrip - ld -o tb_asm tb_asm.o + ld -melf_i386 -N -o tb_asm tb_asm.o ./sstrip/sstrip tb_asm tb_asm.o: tb_asm.s data.lzss data.labels - as -o tb_asm.o tb_asm.s + as --32 -o tb_asm.o tb_asm.s tb_asm.s: configure ./configure @@ -40,7 +40,7 @@ data.lzss: compress_data data.inc configure: configure.c - gcc -O2 -Wall -o configure configure.c + $(CC) $(CFLAGS) -o configure configure.c clean: rm -f *~ *.o tb_asm tb_asm.s core configure compress_data data.lzss data.header data.raw data.labels diff --git a/tb_asm/arch.h b/tb_asm/arch.h index 9e91ad7..02aa2e4 100644 --- a/tb_asm/arch.h +++ b/tb_asm/arch.h @@ -12,6 +12,7 @@ #define ARCH_SH3 11 #define ARCH_SPARC 12 #define ARCH_VAX 13 +#define ARCH_X86_64 14 char *arch_names[]={ @@ -19,7 +20,7 @@ char *arch_names[]={ "alpha", "arm", "cris", - "ia64", + "ia64", "ix86", "m68k", "mips", @@ -28,5 +29,6 @@ char *arch_names[]={ "s390", "sh3", "sparc", - "vax" + "vax", + "x86_64", }; diff --git a/tb_asm/configure.c b/tb_asm/configure.c index e2e2186..c012f44 100644 --- a/tb_asm/configure.c +++ b/tb_asm/configure.c @@ -7,14 +7,14 @@ #include "arch.h" int linux_detect_arch(void) { - + /* Yes this is a bit messy, but it cleans up the makefile a bit *\ \* The C-Preproccessor can be out friend ;) */ /* return ARCH_SPARC; */ - + #if defined(__alpha__) - return ARCH_ALPHA; + return ARCH_ALPHA; #elif defined(__arm__) return ARCH_ARM; #elif defined(__cris__) @@ -34,14 +34,16 @@ int linux_detect_arch(void) { #elif defined(__s390__) return ARCH_S390; #elif defined(__sh3__) || defined(__sh2__) || defined(__sh4) - return ARCH_SH3 + return ARCH_SH3 #elif defined(__sparc__) return ARCH_SPARC; #elif defined(__vax__) return ARCH_VAX; +#elif defined(__x86_64__) + return ARCH_IX86; #else return ARCH_UNKNOWN; -#endif +#endif }