Browse Source

everything uses now CFLAGS, no need to add anything to CPU_FLAGS, add -DSTATIC for those not needing shared libs, needed to be seen in libc-symbols.h

Peter S. Mazinger 19 years ago
parent
commit
c57c602353
1 changed files with 23 additions and 17 deletions
  1. 23 17
      Rules.mak

+ 23 - 17
Rules.mak

@@ -97,6 +97,8 @@ endif
 
 
 ifneq ($(HAVE_SHARED),y)
 ifneq ($(HAVE_SHARED),y)
 libc :=
 libc :=
+interp :=
+ldso :=
 endif
 endif
 
 
 ifndef CROSS
 ifndef CROSS
@@ -304,21 +306,28 @@ endif
 XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS)))
 XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS)))
 CPU_CFLAGS=$(subst ",, $(strip $(CPU_CFLAGS-y)))
 CPU_CFLAGS=$(subst ",, $(strip $(CPU_CFLAGS-y)))
 
 
-# Make sure "char" behavior is the same everywhere
+SSP_DISABLE_FLAGS ?= $(call check_gcc,-fno-stack-protector,)
-CPU_CFLAGS += -fsigned-char
+ifeq ($(UCLIBC_BUILD_SSP),y)
+SSP_CFLAGS := $(call check_gcc,-fno-stack-protector-all,)
+SSP_CFLAGS += $(call check_gcc,-fstack-protector,)
+SSP_ALL_CFLAGS ?= $(call check_gcc,-fstack-protector-all,)
+else
+SSP_CFLAGS := $(SSP_DISABLE_FLAGS)
+endif
 
 
-# only i386 is known to work if compile.S gets -D__ASSEMBLER__
+# Some nice CFLAGS to work with
-#CPU_CFLAGS += $(call check_gcc,-std=c99,)
+CFLAGS := -include $(top_builddir)include/libc-symbols.h \
+	$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
+	-fno-builtin -nostdinc -I$(top_builddir)include -I.
 
 
 LDADD_LIBFLOAT=
 LDADD_LIBFLOAT=
 ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
 ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
-# Add -msoft-float to the CPU_FLAGS since ldso and libdl ignore CFLAGS.
 # If -msoft-float isn't supported, we want an error anyway.
 # If -msoft-float isn't supported, we want an error anyway.
 # Hmm... might need to revisit this for arm since it has 2 different
 # Hmm... might need to revisit this for arm since it has 2 different
 # soft float encodings.
 # soft float encodings.
 ifneq ($(TARGET_ARCH),nios)
 ifneq ($(TARGET_ARCH),nios)
 ifneq ($(TARGET_ARCH),nios2)
 ifneq ($(TARGET_ARCH),nios2)
-    CPU_CFLAGS += -msoft-float
+CFLAGS += -msoft-float
 endif
 endif
 endif
 endif
 ifeq ($(TARGET_ARCH),arm)
 ifeq ($(TARGET_ARCH),arm)
@@ -328,19 +337,16 @@ ifeq ($(TARGET_ARCH),arm)
 endif
 endif
 endif
 endif
 
 
-SSP_DISABLE_FLAGS?=$(call check_gcc,-fno-stack-protector,)
+# Make sure "char" behavior is the same everywhere
-ifeq ($(UCLIBC_BUILD_SSP),y)
+CFLAGS += -fsigned-char
-SSP_CFLAGS:=$(call check_gcc,-fno-stack-protector-all,)
+
-SSP_CFLAGS+=$(call check_gcc,-fstack-protector,)
+# We need this to be checked within libc-symbols.h
-SSP_ALL_CFLAGS?=$(call check_gcc,-fstack-protector-all,)
+ifneq ($(HAVE_SHARED),y)
-else
+CFLAGS += -DSTATIC
-SSP_CFLAGS:=$(SSP_DISABLE_FLAGS)
 endif
 endif
 
 
-# Some nice CFLAGS to work with
+# only i386 is known to work if compile.S gets -D__ASSEMBLER__
-CFLAGS:=-include $(top_builddir)include/libc-symbols.h \
+#CFLAGS += $(call check_gcc,-std=c99,)
-	$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
-	-fno-builtin -nostdinc -I$(top_builddir)include -I.
 
 
 LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc
 LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc