summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rules.mak5
-rw-r--r--libcrypt/Makefile20
-rw-r--r--libpthread/nptl_db/Makefile5
-rw-r--r--test/Rules.mak4
4 files changed, 24 insertions, 10 deletions
diff --git a/Rules.mak b/Rules.mak
index 4e5189eb3..8525cab7c 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -294,8 +294,11 @@ CFLAGS:=$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc -z defs
ifeq ($(DODEBUG),y)
- #CFLAGS += -g3
+ifeq ($(strip $(TARGET_ARCH)),mips)
+ CFLAGS += -O1 -g3
+else
CFLAGS += -O0 -g3
+endif
LDFLAGS := $(LDFLAGS_NOSTRIP)
STRIPTOOL:= true -Since_we_are_debugging
else
diff --git a/libcrypt/Makefile b/libcrypt/Makefile
index 86781e4c5..2b129a8e2 100644
--- a/libcrypt/Makefile
+++ b/libcrypt/Makefile
@@ -33,29 +33,31 @@ SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
CSRC = $(wildcard *.c)
+OBJS=$(patsubst %.c,%.o, $(CSRC))
+
ifeq ($(strip $(HAVE_SHARED)),y)
all: $(SO_LIB_NAME)
else
all: $(AR_LIB_NAME)
endif
-$(AR_LIB_NAME): $(LIB_NAME).o
+$(AR_LIB_NAME): $(OBJS)
$(INSTALL) -d $(TOPDIR)lib
- $(RM) $@
- $(AR) $(ARFLAGS) $@ $<
+ $(RM) $(AR_LIB_NAME)
+ $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS)
$(SO_LIB_NAME): $(AR_LIB_NAME)
- $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $@
+ $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME)
$(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \
- -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $< \
+ -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \
--no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
-L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC)
$(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION)
- $(LN) -sf $(SO_FULL_NAME) $@
+ $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME)
-$(LIB_NAME).o: $(CSRC)
- $(CC) $(CFLAGS) -o $@ -c $^
- $(STRIPTOOL) -x -R .note -R .comment $@
+$(OBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
clean:
$(RM) *.o *~ core
diff --git a/libpthread/nptl_db/Makefile b/libpthread/nptl_db/Makefile
index a18912b4c..54b48be78 100644
--- a/libpthread/nptl_db/Makefile
+++ b/libpthread/nptl_db/Makefile
@@ -25,8 +25,13 @@ AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a
SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so
SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+ifeq ($(strip $(TARGET_ARCH)),mips)
+CFLAGS := $(CFLAGS:-O1=-O2) -DNOT_IN_libc=1 -DIS_IN_libthread_db=1 $(PTINC) \
+ -std=gnu99 -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
+else
CFLAGS := $(CFLAGS:-O0=-O2) -DNOT_IN_libc=1 -DIS_IN_libthread_db=1 $(PTINC) \
-std=gnu99 -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
+endif
# Remove any -z defs since this lib will have undefined symbols
LDFLAGS := $(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols
diff --git a/test/Rules.mak b/test/Rules.mak
index 8f3167c71..51a45c86b 100644
--- a/test/Rules.mak
+++ b/test/Rules.mak
@@ -72,7 +72,11 @@ check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1;
# use '-Os' optimization if available, else use -O2, allow Config to override
# Override optimization settings when debugging
ifeq ($(DODEBUG),y)
+ ifeq ($(strip $(TARGET_ARCH)),mips)
+OPTIMIZATION = -O1
+ else
OPTIMIZATION = -O0
+ endif
else
OPTIMIZATION += $(call check_gcc,-Os,-O2)
endif