OSDN Git Service

test: get out of the endless while loop, when bind failed
[uclinux-h8/uClibc.git] / Rules.mak
index bab3fc5..19cc38a 100644 (file)
--- a/Rules.mak
+++ b/Rules.mak
@@ -200,9 +200,8 @@ check_gcc=$(shell \
 check_as=$(shell \
        if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
        then echo "-Wa,$(1)"; fi)
-# FIXME: filter -fuse-ld=% and pass that, too!!
 check_ld=$(shell \
-       if $(CC) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
+       if $(CC) $(LDFLAG-fuse-ld) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
        then echo "$(1)"; fi)
 
 # Use variable indirection here so that we can have variable
@@ -255,6 +254,8 @@ ARFLAGS:=cr
 
 # Note: The check for -nostdlib has to be before all calls to check_ld
 $(eval $(call check-gcc-var,-nostdlib))
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+# deliberately not named CFLAG-fuse-ld since unchecked and from user
 
 # Flags in OPTIMIZATION are used only for non-debug builds
 
@@ -280,6 +281,7 @@ GCC_VER := $(subst ., ,$(GCC_VER))
 GCC_MAJOR_VER ?= $(word 1,$(GCC_VER))
 #GCC_MINOR_VER ?= $(word 2,$(GCC_VER))
 
+ifneq ($(TARGET_ARCH),arc)
 ifeq ($(GCC_MAJOR_VER),4)
 # shrinks code, results are from 4.0.2
 # 0.36%
@@ -292,7 +294,7 @@ OPTIMIZATION += $(CFLAG_-fno-tree-dominator-opts)
 $(eval $(call check-gcc-var,-fno-strength-reduce))
 OPTIMIZATION += $(CFLAG_-fno-strength-reduce)
 endif
-
+endif
 
 # CPU_CFLAGS-y contain options which are not warnings,
 # not include or library paths, and not optimizations.
@@ -420,6 +422,7 @@ ifeq ($(TARGET_ARCH),mips)
        CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
        CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32R2)+=-march=mips32r2 -mtune=mips32r2
        CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
+       CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64R2)+=-mips64r2 -mtune=mips64r2
        ifeq ($(strip $(ARCH_BIG_ENDIAN)),y)
                CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-Wl,-melf64btsmip
                CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-Wl,-melf32btsmip
@@ -551,6 +554,12 @@ ifeq ($(TARGET_ARCH),c6x)
        CPU_LDFLAGS-y += $(CPU_CFLAGS)
 endif
 
+ifeq ($(TARGET_ARCH),arc)
+       CPU_CFLAGS-y += -mlock -mswape
+       CPU_CFLAGS-$(CONFIG_ARC_CPU_700) += -mA7
+       CPU_LDFLAGS-y += $(CPU_CFLAGS) -marclinux
+endif
+
 $(eval $(call check-gcc-var,$(PIEFLAG_NAME)))
 PIEFLAG := $(CFLAG_$(PIEFLAG_NAME))
 ifeq ($(PIEFLAG),)
@@ -652,9 +661,6 @@ CFLAGS := $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
        -I$(top_srcdir)libc/sysdeps/linux \
        -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) \
        -I$(top_srcdir)ldso/include -I.
-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
-endif
 
 # We need this to be checked within libc-symbols.h
 ifneq ($(HAVE_SHARED),y)
@@ -664,7 +670,7 @@ endif
 $(eval $(call check-ld-var,--warn-once))
 $(eval $(call check-ld-var,--sort-common))
 $(eval $(call check-ld-var,--discard-all))
-LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \
+LDFLAGS_NOSTRIP:=$(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) -shared \
        -Wl,--warn-common $(CFLAG_-Wl--warn-once) -Wl,-z,combreloc
 # binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
 #$(eval $(call check-ld-var,--gc-sections))
@@ -704,9 +710,6 @@ LDFLAGS += -Wl,-s
 else
 STRIPTOOL := true -Stripping_disabled
 endif
-ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
-CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
-endif
 
 ifeq ($(DOMULTI),y)
 # we try to compile all sources at once into an object (IMA), but
@@ -724,6 +727,9 @@ else
 DOMULTI:=n
 endif
 
+ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
+CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
+endif
 ifneq ($(strip $(UCLIBC_EXTRA_LDFLAGS)),"")
 LDFLAGS += $(call qstrip,$(UCLIBC_EXTRA_LDFLAGS))
 endif