dlt-daemon: build with -fPIC 35/8935/1
authorMartin Kelly <mkelly@xevo.com>
Mon, 27 Mar 2017 22:06:28 +0000 (15:06 -0700)
committerMartin Kelly <mkelly@xevo.com>
Mon, 27 Mar 2017 22:52:41 +0000 (15:52 -0700)
I tried turning on the Yocto security flags and hit a compilation
error due to dlt-daemon's copy of gtest not compiling. Adding -fPIC
fixes the issue.

Change-Id: I21f81949436e553426f7d1b7e17dd39717f0cf9d
Signed-off-by: Martin Kelly <mkelly@xevo.com>
meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.11.1.bb
meta-ivi-common/recipes-extended/dlt-daemon/dlt-daemon_2.15.0.bb

index 183e2e9..dc7cc94 100644 (file)
@@ -29,6 +29,15 @@ S = "${WORKDIR}/git"
 
 inherit gzipnative autotools gettext cmake systemd
 
+# -fPIC is needed to prevent relocation errors when we compile gtest with
+# Yocto security flags. See this issue for more details:
+#
+# https://github.com/google/googletest/issues/854
+#
+# If that issue is fixed, we can probably remove the manual -fPIC flags here.
+OECMAKE_C_FLAGS += " -fPIC"
+OECMAKE_CXX_FLAGS += " -fPIC"
+
 PACKAGES += "${PN}-systemd"
 SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
 SYSTEMD_SERVICE_${PN} = "dlt-system.service dlt.service"
index 8ab95d1..d068f25 100644 (file)
@@ -23,6 +23,15 @@ S = "${WORKDIR}/git"
 
 inherit gzipnative autotools gettext cmake systemd
 
+# -fPIC is needed to prevent relocation errors when we compile gtest with
+# Yocto security flags. See this issue for more details:
+#
+# https://github.com/google/googletest/issues/854
+#
+# If that issue is fixed, we can probably remove the manual -fPIC flags here.
+OECMAKE_C_FLAGS += " -fPIC"
+OECMAKE_CXX_FLAGS += " -fPIC"
+
 PACKAGES += "${PN}-systemd"
 SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
 SYSTEMD_SERVICE_${PN} = "dlt-system.service dlt.service"