[Cbe-oss-dev] [PATCH 1/7 v2]MARS/core: Fix host static lib

Yuji Mano yuji.mano at am.sony.com
Fri Oct 31 11:22:46 EST 2008


This fixes the problem where mars_kernel_entry symbol is undefined in the static
library libmars.a. The problem is the MARS kernel spu embedded object does not
get properly included in the static library.

This is a hack so that we can have the MARS kernel embedded spu object included
into the static library. The hack forces creation of the .lo object file usually
created by libtool. Without the hack there does not seem to be any clean
solution for having automake and libtool to create a libtool object from an
object file created by some external application such as ppu-embedspu.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
v2:
 - create pic .libs/mars_kernel.eo object for shared library

 core/src/host/lib/Makefile.am   |   22 +++++++++++++++-------
 core/src/mpu/kernel/Makefile.am |    2 +-
 2 files changed, 16 insertions(+), 8 deletions(-)

--- a/core/src/host/lib/Makefile.am
+++ b/core/src/host/lib/Makefile.am
@@ -40,7 +40,7 @@ extra_cppflags =
 extra_cflags =
 extra_ldflags =
 
-MARS_KERNEL = ${top_builddir}/../mpu/kernel/mars-kernel
+MARS_KERNEL = ${top_builddir}/../mpu/kernel/mars_kernel
 
 if DEBUG
  extra_cppflags += "-DDEBUG"
@@ -109,7 +109,19 @@ libmars_la_SOURCES = \
 	workload_queue.c \
 	workload_queue.h
 
-libmars_la_DEPENDENCIES = mars-kernel.eo
+nodist_libmars_la_SOURCES = \
+	mars_kernel.eo
+
+libmars_la_DEPENDENCIES = mars_kernel.eo
+
+mars_kernel.eo: ${MARS_KERNEL}
+	$(EMBEDSPU) $(CFLAGS) mars_kernel_entry  $< $@
+	$(EMBEDSPU) $(CFLAGS) -fPIC -DPIC mars_kernel_entry  $< .libs/$@
+
+.eo.lo:
+	@echo "# Generated by ltmain.sh - GNU libtool" > $@
+	@echo "pic_object='.libs/"$<"'" >> $@
+	@echo "non_pic_object='"$<"'" >> $@
 
 # library version-info rules (current:revision:age):
 # * increment 'current', if API is changed and compatibility is broken.
@@ -120,12 +132,8 @@ libmars_la_DEPENDENCIES = mars-kernel.eo
 
 libmars_la_LDFLAGS = \
 	-version-info 1:0:0 \
-	-Wl,-Map -Wl,$@.map -Wl,--cref \
-	-Wl,mars-kernel.eo
+	-Wl,-Map -Wl,$@.map -Wl,--cref
 
 libmars_la_LIBADD = -lspe2
 
-mars-kernel.eo: ${MARS_KERNEL}
-	$(EMBEDSPU) $(CFLAGS) mars_kernel_entry  $< $@
-
 CLEANFILES = *.eo *.map
--- a/core/src/mpu/kernel/Makefile.am
+++ b/core/src/mpu/kernel/Makefile.am
@@ -86,7 +86,7 @@ AM_LDFLAGS = \
 	-Wl,-N \
 	-Wl,-s
 
-noinst_PROGRAMS = mars-kernel
+noinst_PROGRAMS = mars_kernel
 
 mars_kernel_LDADD = $(builddir)/../lib/libmars.a
 




More information about the cbe-oss-dev mailing list