[PATCH 04/15] build-link-with-libgcc.patch

Andy Green andy at openmoko.com
Wed Aug 13 01:59:09 CEST 2008


libgcc has divide and things we would like to use

Signed-off-by: Andy Green <andy at openmoko.com>
---

 Makefile  |    3 ++-
 config.mk |    9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 43511ec..0cf54e3 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,7 @@ C_OBJS	= $(patsubst %.c,%.o, $(C_SRCS))
 #SRCS	:= $(START: .o=.S) $(COBJS: .o=.c)
 SRCS	= ${S_SRCS} ${C_SRCS}
 OBJS	= ${S_OBJS} ${C_OBJS}
+LIBS	= -L${COMPILER_LIB_PATH} -lgcc
 
 # GTA02 A5 and A6 U-Boot will eat these for DFU action
 UDFU_VID = 0x1d50
@@ -51,7 +52,7 @@ all:${UDFU_IMAGE}
 ${OBJS}:${SRCS}
 
 ${UDFU_IMAGE}:${OBJS}
-	$(LD) ${LDFLAGS} -T$(LDS) -g $(OBJS) -o ${TARGET}  
+	$(LD) ${LDFLAGS} -T$(LDS) -g $(OBJS) -o ${TARGET} ${LIBS}
 	$(OBJCOPY) -O binary -S ${TARGET} ${IMAGE}
 	$(MKUDFU) -v ${UDFU_VID} -p ${UDFU_PID} -r ${UDFU_REV} \
 						-d ${IMAGE} ${UDFU_IMAGE}
diff --git a/config.mk b/config.mk
index 5d01952..b8cb833 100644
--- a/config.mk
+++ b/config.mk
@@ -1,8 +1,13 @@
 #
 # Include the make variables (CC, etc...)
 #
-#CROSS_COMPILE=arm-softfloat-linux-gnu-
-CROSS_COMPILE=/usr/local/openmoko/arm/bin/arm-angstrom-linux-gnueabi-
+
+CROSS_PATH=/usr/local/openmoko/arm
+CROSS_COMPILE=${CROSS_PATH}/bin/arm-angstrom-linux-gnueabi-
+
+####
+COMPILER_LIB_PATH_PRE=${CROSS_PATH}/lib/gcc/arm-angstrom-linux-gnueabi
+COMPILER_LIB_PATH=${COMPILER_LIB_PATH_PRE}/`ls ${COMPILER_LIB_PATH_PRE}`
 
 AS	= $(CROSS_COMPILE)as
 LD	= $(CROSS_COMPILE)ld





More information about the openmoko-kernel mailing list