From: <ljs...@us...> - 2012-06-06 02:35:31
|
Revision: 800 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=800&view=rev Author: ljsebald Date: 2012-06-06 02:35:24 +0000 (Wed, 06 Jun 2012) Log Message: ----------- A few changes to go along with the update for GCC 4.7.0 and Newlib 1.20.0. The new ARM CFLAGS and AFLAGS require at least binutils 2.19, and are required for the change from arm-elf to arm-eabi that will be required for future versions of GCC (as arm-elf will likely be removed in GCC 4.8.0). Modified Paths: -------------- kos/environ_dreamcast.sh kos/kernel/fs/fs.c kos/kernel/libc/newlib/newlib_fcntl.c Modified: kos/environ_dreamcast.sh =================================================================== --- kos/environ_dreamcast.sh 2012-06-06 02:28:23 UTC (rev 799) +++ kos/environ_dreamcast.sh 2012-06-06 02:35:24 UTC (rev 800) @@ -1,9 +1,9 @@ # KallistiOS environment variable settings. These are the shared pieces # for the Dreamcast(tm) platform. -export KOS_CFLAGS="${KOS_CFLAGS} -ml -m4-single-only -fno-crossjumping" +export KOS_CFLAGS="${KOS_CFLAGS} -ml -m4-single-only -ffunction-sections -fdata-sections" export KOS_AFLAGS="${KOS_AFLAGS} -little" -export KOS_LDFLAGS="${KOS_LDFLAGS} -ml -m4-single-only -Wl,-Ttext=0x8c010000" +export KOS_LDFLAGS="${KOS_LDFLAGS} -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections" # Needed for GCC >= 4 export KOS_LD_SCRIPT="-T${KOS_BASE}/utils/ldscripts/shlelf.xc" @@ -14,6 +14,6 @@ export DC_ARM_AR="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-ar" export DC_ARM_OBJCOPY="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-objcopy" export DC_ARM_LD="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-ld" - export DC_ARM_CFLAGS="-mcpu=arm7 -Wall -O2 -fno-strict-aliasing" - export DC_ARM_AFLAGS="-mcpu=arm7" + export DC_ARM_CFLAGS="-mcpu=arm7di -Wall -O2 -fno-strict-aliasing -Wl,--fix-v4bx -Wa,--fix-v4bx" + export DC_ARM_AFLAGS="-mcpu=arm7di --fix-v4bx" fi Modified: kos/kernel/fs/fs.c =================================================================== --- kos/kernel/fs/fs.c 2012-06-06 02:28:23 UTC (rev 799) +++ kos/kernel/fs/fs.c 2012-06-06 02:35:24 UTC (rev 800) @@ -615,9 +615,8 @@ } } -int fs_fcntl(file_t fd, int cmd, ...) { +int fs_vfcntl(file_t fd, int cmd, va_list ap) { fs_hnd_t *h = fs_map_hnd(fd); - va_list ap; int rv; if(!h) { @@ -630,13 +629,21 @@ return -1; } - va_start(ap, cmd); rv = h->handler->fcntl(h->hnd, cmd, ap); - va_end(ap); return rv; } +int fs_fcntl(file_t fd, int cmd, ...) { + va_list ap; + int rv; + + va_start(ap, cmd); + rv = fs_vfcntl(fd, cmd, ap); + va_end(ap); + return rv; +} + /* Initialize FS structures */ int fs_init() { return 0; Modified: kos/kernel/libc/newlib/newlib_fcntl.c =================================================================== --- kos/kernel/libc/newlib/newlib_fcntl.c 2012-06-06 02:28:23 UTC (rev 799) +++ kos/kernel/libc/newlib/newlib_fcntl.c 2012-06-06 02:35:24 UTC (rev 800) @@ -14,3 +14,15 @@ int _fcntl_r(struct _reent *reent, int fd, int cmd, int arg) { return fs_fcntl(fd, cmd, arg); } + +extern int fs_vfcntl(file_t fd, int cmd, va_list ap); + +int fcntl(int fd, int cmd, ...) { + va_list ap; + int rv; + + va_start(ap, cmd); + rv = fs_vfcntl(fd, cmd, ap); + va_end(ap); + return rv; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |