summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauren Post <lauren.post@nxp.com>2016-09-09 13:51:27 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2016-09-13 17:47:00 -0300
commiteb8d5f7f8f223b65a40b35548528ab0d8397df35 (patch)
treea7b36922478259371aa730675deb447a6df00860
parenteb597c0e7969112e97b1ad130c7be59c33726c04 (diff)
downloadmeta-fsl-arm-eb8d5f7f8f223b65a40b35548528ab0d8397df35.tar.gz
imx-test: Add patch to fix build breaks wtih ldflag change
This fixes the build breaks with unit tests that includes external libraries Signed-off-by: Lauren Post <lauren.post@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--recipes-bsp/imx-test/imx-test/0001-imx-test-Fix-Makefiles-to-handle-library-dependencie.patch170
-rw-r--r--recipes-bsp/imx-test/imx-test_5.4.1.bb2
2 files changed, 172 insertions, 0 deletions
diff --git a/recipes-bsp/imx-test/imx-test/0001-imx-test-Fix-Makefiles-to-handle-library-dependencie.patch b/recipes-bsp/imx-test/imx-test/0001-imx-test-Fix-Makefiles-to-handle-library-dependencie.patch
new file mode 100644
index 0000000..417e29c
--- /dev/null
+++ b/recipes-bsp/imx-test/imx-test/0001-imx-test-Fix-Makefiles-to-handle-library-dependencie.patch
@@ -0,0 +1,170 @@
1From 251612f51136568331d3cf3826bf08c3f70d7eee Mon Sep 17 00:00:00 2001
2From: Lauren Post <lauren.post@nxp.com>
3Date: Wed, 24 Aug 2016 14:54:33 -0500
4Subject: [PATCH] imx-test: Fix Makefiles to handle library dependencies
5
6Applications with library dependencies need different handling to pull in both
7CFLAGS and LDFLAGS. Without these changes the library dependencies are not
8linked in correctly causing build breaks.
9
10Signed-off-by: Lauren Post <lauren.post@nxp.com>
11---
12 test/mxc_cec_test/Makefile | 13 ++++++++++---
13 test/mxc_i2c_slave_test/Makefile | 12 ++++++++++--
14 test/mxc_mpeg4_enc_test/Makefile | 18 ++++++------------
15 test/pxp_lib_test/Makefile | 16 ++++++++++------
16 test/pxp_v4l2_test/Makefile | 19 ++++++++++++++++---
17 5 files changed, 52 insertions(+), 26 deletions(-)
18
19diff --git a/test/mxc_cec_test/Makefile b/test/mxc_cec_test/Makefile
20index 8327784..9d7ee9e 100755
21--- a/test/mxc_cec_test/Makefile
22+++ b/test/mxc_cec_test/Makefile
23@@ -2,11 +2,18 @@
24 # Makefile for MediaLB driver test app.
25 #
26 INC += -I$(LINUXPATH)/include
27-CFLAGS += -lpthread -lcec -lrt
28
29-OBJS = $(OBJDIR)/mxc_cec_test.out
30+TARGET = $(OBJDIR)/mxc_cec_test.out
31+OBJ = mxc_cec_test.o
32+
33+all : $(TARGET)
34+
35+LDFLAGS += -lpthread -lcec -lrt -lstdc++ -pthread
36+
37+$(TARGET):$(OBJ)
38+ $(CC) -o $(TARGET) $(OBJ) $(LDFLAGS) -Os
39+ $(STRIP) $(TARGET)
40
41-all : $(OBJS)
42
43 .PHONY: clean
44 clean :
45diff --git a/test/mxc_i2c_slave_test/Makefile b/test/mxc_i2c_slave_test/Makefile
46index 07d0ff1..2b6b8ef 100644
47--- a/test/mxc_i2c_slave_test/Makefile
48+++ b/test/mxc_i2c_slave_test/Makefile
49@@ -2,9 +2,17 @@
50
51 CFLAGS += -lpthread
52
53-OBJS = $(OBJDIR)/mxc_i2c_slave_test.out
54+TARGET = $(OBJDIR)/mxc_i2c_slave_test.out
55
56-all : $(OBJS)
57+all : $(TARGET)
58+
59+LDFLAGS += -lpthread -lstdc++ -pthread
60+
61+OBJ = mxc_i2c_slave_test.o
62+
63+$(TARGET):$(OBJ)
64+ $(CC) -o $(TARGET) $(OBJ) $(LDFLAGS) -Os
65+ $(STRIP) $(TARGET)
66
67 .PHONY: clean
68 clean :
69diff --git a/test/mxc_mpeg4_enc_test/Makefile b/test/mxc_mpeg4_enc_test/Makefile
70index 842ab58..1de4115 100644
71--- a/test/mxc_mpeg4_enc_test/Makefile
72+++ b/test/mxc_mpeg4_enc_test/Makefile
73@@ -6,27 +6,21 @@ CFLAGS += -I . -lpthread
74
75 EXES = $(OBJDIR)/cam2mpeg4.out
76 SCRIPTS = $(OBJDIR)/autorun-hantro.sh
77-ifeq "$(PLATFORM)" "MXC30030EVB"
78-LIBS = libmpeg4enc_cif.a
79-TEMP_EXE = $(OBJDIR)/cam2mpeg4_cif.out
80-OBJS = $(OBJDIR)/cam2mpeg4_cif.o
81-else
82 LIBS = libmpeg4enc_vga.a
83-TEMP_EXE = $(OBJDIR)/cam2mpeg4_vga.out
84-OBJS = $(OBJDIR)/cam2mpeg4_vga.o
85-endif
86+OBJS = cam2mpeg4_vga.o
87
88 all: $(EXES) $(SCRIPTS)
89
90-$(EXES): $(TEMP_EXE)
91- @mv $< $@
92+LDFLAGS += -lpthread
93+
94+$(EXES): $(OBJS)
95+ $(CC) -o $(EXES) $(OBJS) libmpeg4enc_vga.a $(LDFLAGS) -Os
96+ $(STRIP) $(EXES)
97
98 .PHONY: clean
99 clean:
100 rm -f $(EXES) $(OBJS) $(SCRIPTS)
101
102-$(TEMP_EXE): $(LIBS)
103-
104 #
105 # include the Rules
106 #
107diff --git a/test/pxp_lib_test/Makefile b/test/pxp_lib_test/Makefile
108index 978bea5..c73e4c2 100644
109--- a/test/pxp_lib_test/Makefile
110+++ b/test/pxp_lib_test/Makefile
111@@ -1,13 +1,16 @@
112 SRCS = pxp_test.c utils.c
113-CFLAGS += -lpxp -lpthread
114
115-OBJS = $(OBJDIR)/pxp_test.out \
116- $(OBJDIR)/autorun-pxp.sh
117-$(OBJS): $(SRCS)
118- mkdir -p $(OBJDIR)
119- $(VERBOSE) $(CC) -g $(INC) $(CFLAGS) $^ $(LIBS) -o $@
120+TARGET = $(OBJDIR)/pxp_test.out
121
122-all: $(OBJS)
123+all: $(TARGET)
124+
125+OBJ = pxp_test.o utils.o
126+
127+LDFLAGS += -pthread -lpxp -lstdc++ -pthread
128+
129+$(OBJDIR)/pxp_test.out: $(OBJ)
130+ $(CC) -o $(OBJDIR)/pxp_test.out $(OBJ) $(LDFLAGS) -Os
131+ $(STRIP) $(OBJDIR)/pxp_test.out
132
133 .PHONY: clean
134 clean:
135diff --git a/test/pxp_v4l2_test/Makefile b/test/pxp_v4l2_test/Makefile
136index 8f72e63..da83f8a 100644
137--- a/test/pxp_v4l2_test/Makefile
138+++ b/test/pxp_v4l2_test/Makefile
139@@ -1,12 +1,25 @@
140 # Just use the pxp library to get contiguous physical memory for USERPTR testing
141 # However, be aware that this is not the only way.
142-CFLAGS += -lpthread -lpxp -DGET_CONTI_PHY_MEM_VIA_PXP_LIB
143+CFLAGS += -DGET_CONTI_PHY_MEM_VIA_PXP_LIB
144
145-OBJS = $(OBJDIR)/pxp_v4l2_test.out \
146+TARGET = $(OBJDIR)/pxp_v4l2_test.out \
147 $(OBJDIR)/pxp_v4l2_out_test.sh \
148 $(OBJDIR)/mx6s_v4l2_capture.out
149
150-all : $(OBJS)
151+all : $(TARGET)
152+
153+LDFLAGS += -lpthread -lpxp -lstdc++ -pthread
154+
155+$(OBJDIR)/pxp_v4l2_test.out : pxp_v4l2_test.o
156+ $(CC) -o $(OBJDIR)/pxp_v4l2_test.out pxp_v4l2_test.o $(LDFLAGS) -Os
157+ $(STRIP) $(OBJDIR)/pxp_v4l2_test.out
158+
159+$(OBJDIR)/mx6s_v4l2_capture.out : mx6s_v4l2_capture.o
160+ $(CC) -o $(OBJDIR)/mx6s_v4l2_capture.out mx6s_v4l2_capture.o $(LDFLAGS) -Os
161+ $(STRIP) $(OBJDIR)/mx6s_v4l2_capture.out
162+
163+$(OBJDIR)/pxp_v4l2_out_test.sh: pxp_v4l2_out_test.sh
164+ cp pxp_v4l2_out_test.sh $(OBJDIR)
165
166 .PHONY: clean
167 clean :
168--
1691.9.1
170
diff --git a/recipes-bsp/imx-test/imx-test_5.4.1.bb b/recipes-bsp/imx-test/imx-test_5.4.1.bb
index e33cc8d..b3bad70 100644
--- a/recipes-bsp/imx-test/imx-test_5.4.1.bb
+++ b/recipes-bsp/imx-test/imx-test_5.4.1.bb
@@ -5,6 +5,8 @@ include imx-test.inc
5SRC_URI[md5sum] = "fa1a5cdcfbdd6a3fed0ab4a5fd1f97bc" 5SRC_URI[md5sum] = "fa1a5cdcfbdd6a3fed0ab4a5fd1f97bc"
6SRC_URI[sha256sum] = "997ec10bdc6991e9687a2c2fa5816bb50b08d73bcfe4093f988a7cac4bf0b06a" 6SRC_URI[sha256sum] = "997ec10bdc6991e9687a2c2fa5816bb50b08d73bcfe4093f988a7cac4bf0b06a"
7 7
8SRC_URI += "file://0001-imx-test-Fix-Makefiles-to-handle-library-dependencie.patch"
9
8PR = "r1" 10PR = "r1"
9 11
10COMPATIBLE_MACHINE = "(mx6|mx6ul|mx7)" 12COMPATIBLE_MACHINE = "(mx6|mx6ul|mx7)"