diff --git a/arch/sparc64/build.xml b/arch/sparc64/build.xml index eee4ed0..947c3bf 100644 --- a/arch/sparc64/build.xml +++ b/arch/sparc64/build.xml @@ -61,7 +61,6 @@ - diff --git a/arch/sparc64/context.c b/arch/sparc64/context.c index 84ae42a..75913b3 100644 --- a/arch/sparc64/context.c +++ b/arch/sparc64/context.c @@ -20,7 +20,7 @@ void __exit_context(void); /* assembly routine */ * It is placed at the bottom of our stack, and loaded by assembly routine * to start us up. */ -struct context main_ctx = { +const struct context main_ctx = { .regs[REG_SP] = (uint64_t) &_estack - 96, .pc = (uint64_t) start_main, .npc = (uint64_t) start_main + 4, diff --git a/arch/unix/blk.c b/arch/unix/blk.c index 28bcf15..b1f955d 100644 --- a/arch/unix/blk.c +++ b/arch/unix/blk.c @@ -47,7 +47,7 @@ blk_open( blk_data_t *pb ) } static void -blk_close( blk_data_t *pb ) +blk_close( __attribute__((unused)) blk_data_t *pb ) { selfword("close-deblocker"); } @@ -80,20 +80,20 @@ blk_read_blocks( blk_data_t *pb ) /* ( -- bs ) */ static void -blk_block_size( blk_data_t *pb ) +blk_block_size( __attribute__((unused)) blk_data_t *pb ) { PUSH( 512 ); } /* ( -- maxbytes ) */ static void -blk_max_transfer( blk_data_t *pb ) +blk_max_transfer( __attribute__((unused)) blk_data_t *pb ) { PUSH( 1024*1024 ); } static void -blk_initialize( blk_data_t *pb ) +blk_initialize( __attribute__((unused)) blk_data_t *pb ) { fword("is-deblocker"); } diff --git a/arch/unix/unix.c b/arch/unix/unix.c index 41318a7..81fa3e8 100644 --- a/arch/unix/unix.c +++ b/arch/unix/unix.c @@ -309,7 +309,7 @@ static void init_memory(void) PUSH((ucell) memory + MEMORY_SIZE); } -void exception(cell no) +void exception(__attribute__((unused)) cell no) { /* * this is a noop since the dictionary has to take care diff --git a/config/examples/sparc64_rules.xml b/config/examples/sparc64_rules.xml index 2f293e0..9c4645a1 100644 --- a/config/examples/sparc64_rules.xml +++ b/config/examples/sparc64_rules.xml @@ -26,7 +26,7 @@ ifeq ($(shell uname), Linux) endif CFLAGS := -Os -Wall -W -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin -g -CFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany +CFLAGS+= -Wa,-xarch=v9 -Wa,-64 -m64 -mcpu=ultrasparc -mcmodel=medany CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include diff --git a/config/scripts/crosscflags b/config/scripts/crosscflags new file mode 100644 index 0000000..01f010c --- /dev/null +++ b/config/scripts/crosscflags @@ -0,0 +1,54 @@ +#!/bin/sh + +host=$1 +target=$2 + +if test "$host" = "sparc"; then + host="sparc32" +fi + +if test "$host" = "powerpc" -o "$host" = "mips" -o "$host" = "s390" -o "$host" = "sparc32" -o "$host" = "sparc64" -o "$host" = "m68k" -o "$host" = "armv4b"; then + hostbigendian="yes" +else + hostbigendian="no" +fi + +# host long bits test +if test "$host" = "sparc64" -o "$host" = "ia64" -o "$host" = "x86_64" -o "$host" = "alpha"; then + hostlongbits="64" +else + hostlongbits="32" +fi + +if test "$target" = "powerpc" -o "$target" = "mips" -o "$target" = "s390" -o "$target" = "sparc32" -o "$target" = "sparc64" -o "$target" = "m68k" -o "$target" = "armv4b"; then + targetbigendian="yes" +else + targetbigendian="no" +fi + +# target long bits test +if test "$target" = "sparc64" -o "$target" = "ia64" -o "$target" = "x86_64" -o "$target" = "alpha"; then + targetlongbits="64" +else + targetlongbits="32" +fi + +if test "$targetbigendian" = "$hostbigendian"; then + cflags="-USWAP_ENDIANNESS" +else + cflags="-DSWAP_ENDIANNESS" +fi + +if test "$targetlongbits" = "$hostlongbits"; then + cflags="$cflags -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH" +elif test "$targetlongbits" -lt "$hostlongbits"; then + cflags="$cflags -DNATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH" +else + cflags="$cflags -DNATIVE_BITWIDTH_LARGER_THAN_HOST_BITWIDTH" +fi + +if test "$host" = "x86" -a "$targetlongbits" = "64"; then + cflags="$cflags -DNEED_FAKE_INT128_T" +fi + +echo "$cflags" diff --git a/kernel/internal.c b/kernel/internal.c index 67eedc3..74fa2c9 100644 --- a/kernel/internal.c +++ b/kernel/internal.c @@ -178,9 +178,11 @@ static void call(void) static void sysdebug(void) { - cell errorno=POP(); #ifdef FCOMPILER + cell errorno=POP(); exception(errorno); +#else + (void) POP(); #endif } diff --git a/modules/disk-label.c b/modules/disk-label.c index d7bd89a..b1c2850 100644 --- a/modules/disk-label.c +++ b/modules/disk-label.c @@ -168,7 +168,7 @@ dlabel_tell( dlabel_info_t *di ) /* ( addr len -- actual ) */ static void -dlabel_write( dlabel_info_t *di ) +dlabel_write( __attribute__((unused)) dlabel_info_t *di ) { DDROP(); PUSH( -1 ); @@ -185,7 +185,7 @@ dlabel_offset( dlabel_info_t *di ) /* ( addr -- size ) */ static void -dlabel_load( dlabel_info_t *di ) +dlabel_load( __attribute__((unused)) dlabel_info_t *di ) { /* XXX: try the load method of the part package */ diff --git a/modules/nvram.c b/modules/nvram.c index 239d7c6..a5ab448 100644 --- a/modules/nvram.c +++ b/modules/nvram.c @@ -275,7 +275,7 @@ nvram_write( nvram_ibuf_t *nd ) /* ( -- size ) */ static void -nvram_size( nvram_ibuf_t *nd ) +nvram_size( __attribute__((unused)) nvram_ibuf_t *nd ) { PUSH( nvram.size ); }