summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extra/Configs/Config.sh4
-rw-r--r--libc/sysdeps/linux/sh/Makefile8
-rw-r--r--libc/sysdeps/linux/sh/_mmap.c1
-rw-r--r--libc/sysdeps/linux/sh/pipe.c1
4 files changed, 10 insertions, 4 deletions
diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh
index 4e337e6f1..c19c04e2d 100644
--- a/extra/Configs/Config.sh
+++ b/extra/Configs/Config.sh
@@ -75,6 +75,10 @@ ifeq ($(strip $(TARGET_PROC)),SH3)
ARCH_CFLAGS += -ml
HAS_MMU = true
endif
+ifeq ($(strip $(TARGET_PROC)),SH4)
+ARCH_CFLAGS += -ml -m4
+HAS_MMU = true
+endif
endif
# Set this to `false' if you don't have/need basic floating point support
diff --git a/libc/sysdeps/linux/sh/Makefile b/libc/sysdeps/linux/sh/Makefile
index 4f76b49a5..70f3ccacd 100644
--- a/libc/sysdeps/linux/sh/Makefile
+++ b/libc/sysdeps/linux/sh/Makefile
@@ -23,9 +23,9 @@
TOPDIR=../../../../
include $(TOPDIR)Rules.mak
-ASFLAGS=$(CFLAGS)
-CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
+CFLAGS+= -I../
+SFLAGS= $(CFLAGS) -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
@@ -50,11 +50,11 @@ ar-target: $(OBJS) $(CRT0_OBJ)
cp $(CRT0_OBJ) $(TOPDIR)libc/$(CRT0_OBJ)
$(CRT0_OBJ): %.o : %.S
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(SFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(SOBJS): %.o : %.S
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(SFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(COBJS): %.o : %.c
diff --git a/libc/sysdeps/linux/sh/_mmap.c b/libc/sysdeps/linux/sh/_mmap.c
index 70155b028..11b452b43 100644
--- a/libc/sysdeps/linux/sh/_mmap.c
+++ b/libc/sysdeps/linux/sh/_mmap.c
@@ -20,6 +20,7 @@
*/
#include <unistd.h>
+#include <errno.h>
#include <sys/mman.h>
#include <sys/syscall.h>
diff --git a/libc/sysdeps/linux/sh/pipe.c b/libc/sysdeps/linux/sh/pipe.c
index 1fb399afc..b07f42d31 100644
--- a/libc/sysdeps/linux/sh/pipe.c
+++ b/libc/sysdeps/linux/sh/pipe.c
@@ -1,6 +1,7 @@
/* Copyright (C) 2001 Lineo, <davidm@lineo.com> */
+#include <errno.h>
#include <unistd.h>
#include <syscall.h>