added shared object library support
authorAravind Batni <aravindbr@ti.com>
Fri, 13 Sep 2013 22:45:47 +0000 (18:45 -0400)
committerAravind Batni <aravindbr@ti.com>
Fri, 13 Sep 2013 22:45:47 +0000 (18:45 -0400)
build/armv7/librm_aearmv7.mk [changed mode: 0644->0755]
docs/ReleaseNotes_RM.doc
docs/ReleaseNotes_RM.pdf
makefile_armv7 [changed mode: 0644->0755]
package.bld
package.xdc
rmver.h [changed mode: 0755->0644]
test/k2h/armv7/linux/build/makefile [changed mode: 0644->0755]
test/k2k/armv7/linux/build/makefile

old mode 100644 (file)
new mode 100755 (executable)
index 9b42547..7c51b74
@@ -17,9 +17,13 @@ space =$(empty) $(empty)
 # Output for prebuilt generated libraries
 ARMV7LIBDIR ?= ./lib
 ARMV7OBJDIR ?= ./obj
+ARMV7OBJDIR_SO := $(ARMV7OBJDIR)/rm/lib_so
 ARMV7OBJDIR := $(ARMV7OBJDIR)/rm/lib
 ARMV7BINDIR ?= ./bin
 
+# Default optimization is on
+DEBUG_FLAG    ?= -O2
+
 ifdef CROSS_TOOL_INSTALL_PATH
 # Support backwards compatibility with KeyStone1 approach
  CC = $(CROSS_TOOL_INSTALL_PATH)/$(CROSS_TOOL_PRFX)gcc
@@ -30,7 +34,8 @@ endif
 
 INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(INCDIR))))
 
-INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD $(CFLAGS) $(LDFLAGS)
+INTERNALDEFS = -D__ARMv7 -D_LITTLE_ENDIAN=1 -D_VIRTUAL_ADDR_SUPPORT -DMAKEFILE_BUILD
+CFLAGS += $(INTERNALDEFS)
 
 OBJEXT = o 
 INTERNALLINKDEFS =
@@ -58,18 +63,33 @@ COMMONSRCC =        \
 
 # FLAGS for the COMMONSRC Files
 COMMONSRCCFLAGS = $(DEBUG_FLAG) -I$(SRCDIR) -I$(UTLSRCDIR) -I.
+CFLAGS +=$(COMMONSRCCFLAGS)
 
 # Make Rule for the COMMONSRC Files
 COMMONSRCCOBJS = $(patsubst %.c, $(ARMV7OBJDIR)/%.$(OBJEXT), $(COMMONSRCC))
+COMMONSRCCOBJS_SO = $(patsubst %.c, $(ARMV7OBJDIR_SO)/%.$(OBJEXT), $(COMMONSRCC))
 
 $(COMMONSRCCOBJS): $(ARMV7OBJDIR)/%.$(OBJEXT): %.c $(ARMV7OBJDIR)/.created
        -@echo compiling $< ...
-       @$(CC) -c $(COMMONSRCCFLAGS) $(INTERNALDEFS) $(INCS)  $< -o $@
+       @$(CC) -c $(CFLAGS) $(INCS)  $< -o $@
 
+$(COMMONSRCCOBJS_SO): $(ARMV7OBJDIR_SO)/%.$(OBJEXT): %.c $(ARMV7OBJDIR_SO)/.created
+       -@echo compiling $< ...
+       @$(CC) -c $(CFLAGS) -fPIC $(INCS)  $< -o $@
+       
 $(ARMV7LIBDIR)/librm.a: $(COMMONSRCCOBJS) $(ARMV7LIBDIR)/.created
        @echo archiving $? into $@ ...
        @$(AR) -r $@ $?
 
+librm.so: $(COMMONSRCCOBJS_SO)
+       @echo archiving $? into $(ARMV7LIBDIR)/$@.1 ...
+       @$(CC) $(DEBUG_FLAG) -ggdb2 -Wl,-soname=$@.1 -shared -fPIC ${LDFLAGS} -o $@.1.0.0 $^
+       @ln -s $@.1.0.0 $@.1
+       @ln -s $@.1     $@
+       @mv -f $@.1.0.0 $(ARMV7LIBDIR)/$@.1.0.0
+       @mv -f $@.1 $(ARMV7LIBDIR)/$@.1
+       @mv -f $@   $(ARMV7LIBDIR)/$@
+       
 $(ARMV7OBJDIR)/.created:
        @mkdir -p $(ARMV7OBJDIR)
        @touch $(ARMV7OBJDIR)/.created
@@ -78,6 +98,10 @@ $(ARMV7LIBDIR)/.created:
        @mkdir -p $(ARMV7LIBDIR)
        @touch $(ARMV7LIBDIR)/.created
 
+$(ARMV7OBJDIR_SO)/.created:
+       @mkdir -p $(ARMV7OBJDIR_SO)
+       @touch $(ARMV7OBJDIR_SO)/.created
+               
 clean:
        @$(RMDIR) $(ARMV7OBJDIR)
 
index 4697980b5a9799ae9dfa5bb8050562ed0935f260..b347af0953b851fdc0f1a14ad58719d60be5f30b 100644 (file)
Binary files a/docs/ReleaseNotes_RM.doc and b/docs/ReleaseNotes_RM.doc differ
index e6b21010c3999574def4d839dbf4a79347ce4374..93097c38c95cc7c6a3f70f3e617dc22597217f0a 100644 (file)
Binary files a/docs/ReleaseNotes_RM.pdf and b/docs/ReleaseNotes_RM.pdf differ
old mode 100644 (file)
new mode 100755 (executable)
index 674e597..f5c8d10
@@ -16,6 +16,7 @@ export ARMV7LIBDIR ?= ./lib
 export DEVICE ?=k2h
 export ARMV7OBJDIR ?= ./obj/$(DEVICE)
 export ARMV7BINDIR ?= ./bin/$(DEVICE)
+export USEDYNAMIC_LIB ?= "no"
 
 # ROOT Directory
 export ROOTDIR := ../../..
@@ -66,11 +67,14 @@ tests:
 #      @$(MAKE) -f ./example/InfraDmaSC/$(DEVICE)/armv7/linux/build/makefile all
 
 # Make rule to create $(ARMV7LIBDIR)/librm.a library
-.libraries: $(ARMV7LIBDIR)/librm.a
+.libraries: $(ARMV7LIBDIR)/librm.a librm.so
 
 $(ARMV7LIBDIR)/librm.a::
        @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
 
+librm.so:
+       @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
+       
 # Rule to clean $(ARMV7LIBDIR)/librm.a library
 clean:
        @$(MAKE) -f ./build/armv7/librm_aearmv7.mk $@
@@ -78,7 +82,9 @@ clean:
        @$(RMDIR) $(ARMV7OBJDIR)/rm
        @$(RMDIR) $(ARMV7BINDIR)/rm
        @$(RM) $(ARMV7LIBDIR)/librm.a
-
+       @$(RM) $(ARMV7LIBDIR)/librm.so
+       @$(RM) $(ARMV7LIBDIR)/librm.so.*
+       
 installbin:
        install -d $(INSTALL_BIN_BASE_DIR)
        install -d $(INSTALL_BIN_BASE_DIR)/device/k2k/
@@ -86,13 +92,16 @@ installbin:
        $(CP) ./device/k2h/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2h
        $(CP) ./device/k2k/*.dtb $(INSTALL_BIN_BASE_DIR)/device/k2k
        install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer.out    $(INSTALL_BIN_BASE_DIR)/rmServer_$(DEVICE).out 
-
+       install -c -m 755 $(ARMV7BINDIR)/rm/test/rmServer_so.out $(INSTALL_BIN_BASE_DIR)/rmServer_so_$(DEVICE).out      
+       
 installbin_test:
        install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test
        install -d $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files             
        $(CP) ./test/dts_files/*.dtb $(INSTALL_BIN_BASE_DIR)/ti/drv/rm/test/dts_files
        install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest.out $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest_$(DEVICE).out
        install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest.out   $(INSTALL_BIN_BASE_DIR)/rmDspClientTest_$(DEVICE).out
+       install -c -m 755 $(ARMV7BINDIR)/rm/test/rmLinuxClientTest_so.out $(INSTALL_BIN_BASE_DIR)/rmLinuxClientTest_so_$(DEVICE).out
+       install -c -m 755 $(ARMV7BINDIR)/rm/test/rmDspClientTest_so.out   $(INSTALL_BIN_BASE_DIR)/rmDspClientTest_so_$(DEVICE).out
 
 install:
        install -d $(INSTALL_INC_BASE_DIR)/ti/drv/rm/util
@@ -111,5 +120,7 @@ install:
        $(CP) ./device/k2k/*.dtb $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k   
        $(CP) ./device/k2k/*.dts $(INSTALL_INC_BASE_DIR)/ti/drv/rm/device/k2k                   
        @$(CP) -r $(ARMV7LIBDIR)/*.a         $(INSTALL_LIB_BASE_DIR)
+       @$(CP) -r $(ARMV7LIBDIR)/*.so        $(INSTALL_LIB_BASE_DIR)
+       @$(CP) -r $(ARMV7LIBDIR)/*.so.*      $(INSTALL_LIB_BASE_DIR)    
 # Make rule to create examples Stub
 examples:
index 90841546cc0126305c46540002232f4bdac36751..906d2436c7de00fdc33bb05508c1557a8f8a7c56 100644 (file)
 /* List of all subdirectories that combine to make the RM Package. */\r
 var subDirectories = ["src", "docs", "device", "include", "test", "util"];\r
 \r
+/* Generate paver.h */\r
+var tplt = xdc.loadTemplate("./rmver.h.xdt");\r
+tplt.genFile("./rmver.h",lldReleaseVersion);   \r
+\r
 /* Determine if we need to create the InstallJammer Application or not? \r
  * RM Deliverables be either of the following formats:\r
  *  - TAR Ball Package\r
@@ -108,10 +112,6 @@ tplt.genFile("./docs/Doxyfile",lldReleaseVersion);
 var tplt = xdc.loadTemplate("./Settings.xdc.xdt");\r
 tplt.genFile("./Settings.xdc",lldReleaseVersion); \r
 \r
-/* Generate paver.h */\r
-var tplt = xdc.loadTemplate("./rmver.h.xdt");\r
-tplt.genFile("./rmver.h",lldReleaseVersion);      \r
-\r
 /* Check if we need to create the mini package? */\r
 var miniBuild = java.lang.System.getenv("MINI_PACKAGE");\r
 \r
index 5ab0df169fcda2ab5ddf96d1feb52bc858ee35c4..cb179a9e97d7fcc89ba99e04d12f311a8d6c3550 100755 (executable)
@@ -9,6 +9,6 @@
  * Copyright (C) 2012-2013, Texas Instruments, Inc.\r
  *****************************************************************************/\r
 \r
-package ti.drv.rm[02, 00, 00, 06] {\r
+package ti.drv.rm[02, 00, 00, 07] {\r
     module Settings;\r
 }\r
diff --git a/rmver.h b/rmver.h
old mode 100755 (executable)
new mode 100644 (file)
index 7dc2a4c..3f58c47
--- a/rmver.h
+++ b/rmver.h
@@ -51,13 +51,13 @@ extern "C" {
  * format:
  *  0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
  */
-#define RM_VERSION_ID                   (0x02000005)
+#define RM_VERSION_ID                   (0x02000007)
 
 /**
  * @brief   This is the version string which describes the RM along with the
  * date and build information.
  */
-#define RM_VERSION_STR                  "RM Revision: 02.00.00.05"
+#define RM_VERSION_STR                  "RM Revision: 02.00.00.07"
 
 
 #ifdef __cplusplus
old mode 100644 (file)
new mode 100755 (executable)
index 1f60086..e99b69c
@@ -45,16 +45,26 @@ INCDIR := $(PDK_INSTALL_PATH);$(RM_INC_DIR);$(RM_ARM_LIN_TEST_DIR);$(IPC_DEVKIT_
 RM_LIB = -lrm
 IPC_LIBS = -ltiipc -ltiipcutils
 
+ifeq ($(USEDYNAMIC_LIB), yes)
+#presuming ARM executable would depend on dynamic library dependency
+EXE_EXTN = _so
+LIBS     = $(RM_LIB)
+else
+#forcing ARM executable to depend on static LLD libraries
+EXE_EXTN =
+LIBS     = -static $(RM_LIB) -Wl,-Bdynamic
+endif
+
 # Compiler options
 INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -DDEVICE_K2H -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD
 
 # Linker options
-INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(RM_LIB) -lrt -Wl,--end-group -pthread $(LDFLAGS)
+INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
 IPC_INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(IPCLIBDIRS) $(IPC_LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
 
-RM_SERVER_EXE=rmServer.out
-RM_LINUX_CLIENT_TEST_EXE=rmLinuxClientTest.out
-RM_DSP_CLIENT_TEST_EXE=rmDspClientTest.out
+RM_SERVER_EXE=rmServer$(EXE_EXTN).out
+RM_LINUX_CLIENT_TEST_EXE=rmLinuxClientTest$(EXE_EXTN).out
+RM_DSP_CLIENT_TEST_EXE=rmDspClientTest$(EXE_EXTN).out
 
 OBJEXT = o 
 
index b3bd58ceb5dbdf67332ea347f7acf5d3f630b840..c115f9ef2e60d5c433a1d00149ede4146ff7b308 100755 (executable)
@@ -45,16 +45,26 @@ INCDIR := $(PDK_INSTALL_PATH);$(RM_INC_DIR);$(RM_ARM_LIN_TEST_DIR);$(IPC_DEVKIT_
 RM_LIB = -lrm
 IPC_LIBS = -ltiipc -ltiipcutils
 
+ifeq ($(USEDYNAMIC_LIB), yes)
+#presuming ARM executable would depend on dynamic library dependency
+EXE_EXTN = _so
+LIBS     = $(RM_LIB)
+else
+#forcing ARM executable to depend on static LLD libraries
+EXE_EXTN =
+LIBS     = -static $(RM_LIB) -Wl,-Bdynamic
+endif
+
 # Compiler options
 INTERNALDEFS = $(DEBUG_FLAG) -D__ARMv7 -DDEVICE_K2K -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD
 
 # Linker options
-INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(RM_LIB) -lrt -Wl,--end-group -pthread $(LDFLAGS)
+INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
 IPC_INTERNALLINKDEFS = -Wl,--start-group -L $(ARMV7LIBDIR) $(IPCLIBDIRS) $(IPC_LIBS) -lrt -Wl,--end-group -pthread $(LDFLAGS)
 
-RM_SERVER_EXE=rmServer.out
-RM_LINUX_CLIENT_TEST_EXE=rmLinuxClientTest.out
-RM_DSP_CLIENT_TEST_EXE=rmDspClientTest.out
+RM_SERVER_EXE=rmServer$(EXE_EXTN).out
+RM_LINUX_CLIENT_TEST_EXE=rmLinuxClientTest$(EXE_EXTN).out
+RM_DSP_CLIENT_TEST_EXE=rmDspClientTest$(EXE_EXTN).out
 
 OBJEXT = o