From 10829b2f78de91f66c7da5f7a2a2fe6d252eb38d Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Thu, 3 May 2012 07:08:43 +0200 Subject: Fix fat test program not compiling (FS#12646). This changes the way creat() is wrapped around in native builds so more experienced devs should look at it. This patch forces to compile fat test in 32bit mode. Building natively on x86-64 works just fine but our fat code apparently can't deal with 64bit pointers/ints correctly. Change-Id: I000015094f7db957ce826c22672608cd419908b0 Reviewed-on: http://gerrit.rockbox.org/228 Reviewed-by: Thomas Martitz --- firmware/test/fat/Makefile | 17 ++++++----------- firmware/test/fat/main.c | 5 +++-- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'firmware/test/fat') diff --git a/firmware/test/fat/Makefile b/firmware/test/fat/Makefile index 74d2628ab7..3e04724f67 100644 --- a/firmware/test/fat/Makefile +++ b/firmware/test/fat/Makefile @@ -1,26 +1,21 @@ FIRMWARE = ../.. -export BUILDDATE=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') -export CPU=arm -export TARGET=-DIPOD_VIDEO -export TARGET_INC=-I$(FIRMWARE)/target/arm/ipod/video -I$(FIRMWARE)/target/arm/ipod -I$(FIRMWARE)/target/arm - DRIVERS = ../../drivers EXPORT = ../../export -INCLUDE = -I$(EXPORT) -I$(FIRMWARE)/include - -DEFINES = -DTEST_FAT -DDEBUG -DCRT_DISPLAY -DDISK_WRITE -DHAVE_FAT16SUPPORT -D__PCTOOL__ +BUILDDATE=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') +INCLUDE = -I$(EXPORT) -I$(FIRMWARE)/include -I$(FIRMWARE)/target/hosted -I$(FIRMWARE)/target/hosted/sdl +DEFINES = -DTEST_FAT -DDEBUG -DDISK_WRITE -DHAVE_FAT16SUPPORT -D__PCTOOL__ -CFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE) $(BUILDDATE) -I$(FIRMWARE)/libc/include -SIMFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE) +CFLAGS = -g -m32 -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) $(BUILDDATE) -I. $(INCLUDE) -I$(FIRMWARE)/libc/include +SIMFLAGS = -g -m32 -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE) TARGET = fat all: $(TARGET) $(TARGET): fat.o ata-sim.o main.o disk.o dir.o file.o ctype.o unicode.o strlcpy.o - gcc -g -o fat $+ -lfl + gcc -g -m32 -o fat $+ fat.o: $(DRIVERS)/fat.c $(EXPORT)/fat.h $(EXPORT)/ata.h $(CC) $(CFLAGS) -c $< -o $@ diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index a9220d15b7..756f326bb3 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c @@ -9,6 +9,7 @@ #include "dir.h" #include "file.h" #include "ata.h" +#include "storage.h" void dbg_dump_sector(int sec); void dbg_dump_buffer(unsigned char *buf, int len, int offset); @@ -432,7 +433,7 @@ void dbg_tail(char* name) if( rc > 0 ) { buf[rc]=0; - printf("%d:\n%s\n", strlen(buf), buf); + printf("%d:\n%s\n", (int)strlen(buf), buf); } else if ( rc == 0 ) { DEBUGF("EOF\n"); @@ -463,7 +464,7 @@ int dbg_head(char* name) if( rc > 0 ) { buf[rc]=0; - printf("%d:\n%s\n", strlen(buf), buf); + printf("%d:\n%s\n", (int)strlen(buf), buf); } else if ( rc == 0 ) { DEBUGF("EOF\n"); -- cgit v1.2.3