This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Blackfin multilib cleanup


This patch is the libgloss part for Blackfin multilib cleanup:

http://gcc.gnu.org/ml/gcc-patches/2008-05/msg00958.html

This patch depends on the hardware support patch I just sent out today.

Please review and apply. Thanks.


Jie


2008-08-07  Jie Zhang  <jie.zhang@analog.com>

	* bfin/Makefile.in (BOARD_CRT0S): Add basiccrt561.o,
	basiccrt561s.o and basiccrt561b.o.
	(basiccrt.o, basiccrts.o, basiccrt561.o, basiccrt561s.o,
	basiccrt561b.o): Rewrite rules.
	* bfin/basiccrt.S: Remove useless __ADSPBF561_COREB__ in
	workaround code for 05000229.


Index: libgloss/bfin/Makefile.in
===================================================================
--- libgloss/bfin/Makefile.in.orig	2008-07-24 18:27:10.000000000 +0800
+++ libgloss/bfin/Makefile.in	2008-07-24 18:42:14.000000000 +0800
@@ -71,8 +71,7 @@
 BOARD_LDFLAGS	=
 BOARD_BSP	= # We actually use libnosys.a
 BOARD_CRT0S	= basiccrt.o basiccrts.o
-BOARD_CRT0S	+= $(shell if [[ x$$($(CC) $(CFLAGS) -print-multi-directory) \
-			= xbf561* ]]; then echo basiccrtb.o; fi)
+BOARD_CRT0S	+= basiccrt561.o basiccrt561s.o basiccrt561b.o
 BOARD_OBJS	=
 BOARD_TEST	=
 BOARD_INSTALL	= install-board
@@ -98,13 +97,42 @@
 #
 #
 crt0.o: crt0.S
-basiccrt.o: basiccrt.S
 
-basiccrtb.o: basiccrt.S
-	$(CC) -D__ADSPBF561_COREB__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -o $@ -c $<
+basiccrt.o: basiccrt.S
+ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS)))
+	$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -o $@ -c $<
+else
+	$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf532-any -o $@ -c $<
+endif
 
 basiccrts.o: basiccrt.S
+ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS)))
 	$(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -o $@ -c $<
+else
+	$(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf532-any -o $@ -c $<
+endif
+
+basiccrt561.o: basiccrt.S
+ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS)))
+	$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $<
+else
+	$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $<
+endif
+
+basiccrt561s.o: basiccrt.S
+ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS)))
+	$(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $<
+else
+	$(CC) -D__BFIN_SDRAM $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $<
+endif
+
+
+basiccrt561b.o: basiccrt.S
+ifneq (,$(findstring mcpu=bf532-none,$(CFLAGS)))
+	$(CC) -D__ADSPBF561_COREB__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-none -o $@ -c $<
+else
+	$(CC) -D__ADSPBF561_COREB__ $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -mcpu=bf561-any -o $@ -c $<
+endif
 
 clean mostlyclean:
 	rm -f a.out core *.i *.o ${SIM_BSP} ${BOARD_BSP}
Index: libgloss/bfin/basiccrt.S
===================================================================
--- libgloss/bfin/basiccrt.S.orig	2008-07-24 18:27:10.000000000 +0800
+++ libgloss/bfin/basiccrt.S	2008-07-24 18:42:14.000000000 +0800
@@ -80,7 +80,6 @@
 	SYSCFG = R1;
 #endif
 #if WA_05000229
-#ifndef __ADSPBF561_COREB__
    // Avoid Anomaly 05-00-0229: DMA5_CONFIG and SPI_CTL not cleared on reset.
    R1 = 0x400;
 #if defined(__ADSPBF538__) || defined(__ADSPBF539__)
@@ -97,7 +96,6 @@
    R1 = 0;
    W[P0] = R1.L;
 #endif
-#endif
 	// Zap loop counters to zero, to make sure that
 	// hw loops are disabled - it could be really baffling
 	// if the counters and bottom regs are set, and we happen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]