From b043863c74f754485b4a4a0cb84079c586004631 Mon Sep 17 00:00:00 2001 From: "John L. Whiteman" Date: Fri, 9 Jan 2015 15:08:40 -0700 Subject: [PATCH] Coverity fixes for TC-2075. Makefile changes. Change-Id: I1ce947c24188a7f1f7397c583280ba4e184d3d3b Signed-off-by: John L. Whiteman --- framework/Makefile | 19 +++++++++++++++++-- framework/Makefile_TPCSSerDaemon | 4 ++-- framework/Makefile_TWPSerDaemon | 8 ++++++-- framework/Makefile_channel_client | 2 +- framework/Makefile_channel_server | 2 +- packaging/csf-framework.changes | 3 +++ packaging/csf-framework.spec | 2 +- 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/framework/Makefile b/framework/Makefile index c0a14dd..fc00d3e 100644 --- a/framework/Makefile +++ b/framework/Makefile @@ -64,17 +64,32 @@ endif CFLAGS := $(CFLAGS) $(PKCL_CFLAGS) $(TCS_CFLAGS) +# Define a list of pkg-config packages we want to use +pkg_packages = dlog + +PKG_CFLAGS = $(shell pkg-config --cflags $(pkg_packages)) +PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) + +# Combine user supplied, additional, and pkg-config flags +ifeq ($(TCS_CFG), release) + PKGLD_FLAGS = + PKGCFLAGS = +else + PKGLD_FLAGS += $(PKG_LDFLAGS) -L./lib + PKGCFLAGS += -I$(SRCDIR) $(PKCL_CFLAGS) $(PKG_CFLAGS) +endif + SOURCES = $(SRCDIR)/TCSImpl.c $(SRCDIR)/TWPImpl.c OBJECTS = $(OUTDIR)/TCSImpl.o $(OUTDIR)/TWPImpl.o $(OUTDIR)/%.o: $(SRCDIR)/%.c - $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c + $(CC) $(CFLAGS) $(PKGCFLAGS) -I. -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c all: $(OUTDIR) $(TARGET) $(TARGET): $(OBJECTS) - $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKGLD_FLAGS) $(OUTDIR): @mkdir $(OUTDIR) diff --git a/framework/Makefile_TPCSSerDaemon b/framework/Makefile_TPCSSerDaemon index 4e1f4f1..47614bf 100644 --- a/framework/Makefile_TPCSSerDaemon +++ b/framework/Makefile_TPCSSerDaemon @@ -71,7 +71,7 @@ PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) LD_FLAGS += $(PKG_LDFLAGS) -lscserver -L./lib -lxml2 GBS_CFLAGS = -I${SYSROOT}/usr/include/dbus-1.0 -I${SYSROOT}/usr/lib/dbus-1.0/include -I${SYSROOT}/usr/include/libxml2 -CFLAGS += -Wall -I$(SRCDIR) $(PKCL_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) +CFLAGS += -I$(SRCDIR) $(PKCL_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) SOURCES = $(SRCDIR)/TPCSSerDaemon.c \ $(SRCDIR)/IpcForkDaemon.c @@ -85,7 +85,7 @@ $(OUTDIR)/%.o: $(SRCDIR)/%.c all: $(OUTDIR) $(TARGET) $(TARGET): $(OBJECTS) - $(CC) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) + $(CC) -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS) $(PKG_LDFLAGS) $(OUTDIR): @mkdir $(OUTDIR) diff --git a/framework/Makefile_TWPSerDaemon b/framework/Makefile_TWPSerDaemon index f1b896a..14e36de 100644 --- a/framework/Makefile_TWPSerDaemon +++ b/framework/Makefile_TWPSerDaemon @@ -71,7 +71,11 @@ OBJECTS = $(OUTDIR)/TWPSerDaemon.o \ $(OUTDIR)/IpcForkDaemon.o # Define a list of pkg-config packages we want to use -pkg_packages = dbus-glib-1 dlog +ifeq ($(TCS_CFG), release) + pkg_packages = dbus-glib-1 +else + pkg_packages = dbus-glib-1 dlog +endif PKG_CFLAGS = $(shell pkg-config --cflags $(pkg_packages)) PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) @@ -80,7 +84,7 @@ PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) PKGLD_FLAGS += $(PKG_LDFLAGS) -lscserver -L./lib GBS_CFLAGS = -I${SYSROOT}/usr/include/dbus-1.0 -I${SYSROOT}/usr/lib/dbus-1.0/include -PKGCFLAGS += -Wall -I$(SRCDIR) $(PKCL_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) +PKGCFLAGS += -I$(SRCDIR) $(PKCL_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) $(OUTDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) $(PKGCFLAGS) -I. -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c diff --git a/framework/Makefile_channel_client b/framework/Makefile_channel_client index 2b31c9b..a1ce28e 100644 --- a/framework/Makefile_channel_client +++ b/framework/Makefile_channel_client @@ -76,7 +76,7 @@ PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) LD_FLAGS += $(PKG_LDFLAGS) GBS_CFLAGS = -I${SYSROOT}/usr/include/dbus-1.0 -I${SYSROOT}/usr/lib/dbus-1.0/include -CFLAGS += $(PKCL_CFLAGS) $(TCS_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) -Wall -Werror +CFLAGS += $(PKCL_CFLAGS) $(TCS_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) SOURCES = $(SRCDIR)/IpcClient.c \ $(SRCDIR)/IpcStructs.c diff --git a/framework/Makefile_channel_server b/framework/Makefile_channel_server index a302794..e5b94c1 100644 --- a/framework/Makefile_channel_server +++ b/framework/Makefile_channel_server @@ -75,7 +75,7 @@ PKG_LDFLAGS = $(shell pkg-config --libs $(pkg_packages)) LD_FLAGS += $(PKG_LDFLAGS) GBS_CFLAGS = -I${SYSROOT}/usr/include/dbus-1.0 -I${SYSROOT}/usr/lib/dbus-1.0/include -CFLAGS += $(PKCL_CFLAGS) $(TCS_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) -Wall -Werror +CFLAGS += $(PKCL_CFLAGS) $(TCS_CFLAGS) $(GBS_CFLAGS) $(PKG_CFLAGS) SOURCES = $(SRCDIR)/IpcServer.c \ $(SRCDIR)/IpcServerError.c \ diff --git a/packaging/csf-framework.changes b/packaging/csf-framework.changes index fa501cc..befd2f6 100644 --- a/packaging/csf-framework.changes +++ b/packaging/csf-framework.changes @@ -1,3 +1,6 @@ +* Fri Jan 09 2015 John L. Whiteman upstream/2.0.2.1-6-gda86fc8 +- Coverity fixes for TC-2075. Makefile changes. + * Thu Aug 14 2014 John L. Whiteman upstream/2.0.2-1-gf74ac25 - Fixed the HTTP test code for TWP testing per Samsung report diff --git a/packaging/csf-framework.spec b/packaging/csf-framework.spec index efb4455..4b63aca 100644 --- a/packaging/csf-framework.spec +++ b/packaging/csf-framework.spec @@ -1,6 +1,6 @@ Summary: Content Security Framework Name: csf-framework -Version: 2.0.2 +Version: 2.0.2.1 Release: 0 License: BSD-3-Clause Group: Security/Libraries -- 2.7.4