Skip to contentSkip to conversation

upm: Drop gcc-only warnings

PATCH New Khem Raj 1 participant 4 messages Apr 5, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 upm: Drop gcc-only warnings

This helps in compiling upm with clang, in followup patch we wll disabled Werror too

---
 ...isable-using-Wno-maybe-uninitialized.patch | 37 +++++++++++++++++++
 meta-oe/recipes-extended/upm/upm_git.bb       |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta-oe/recipes-extended/upm/upm/0001-cmake-Disable-using-Wno-maybe-uninitialized.patch
meta-oe/recipes-extended/upm/upm/0001-cmake-Disable-using-Wno-maybe-uninitialized.patch new file +37 -0
new file mode 100644
index 0000000000..2f581855f5
@@ -0,0 +1,37 @@
+From 169f62770f63a43b15d4d4c82336fd57c8467cfe Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 4 Apr 2020 21:43:51 -0700
+Subject: [PATCH] cmake: Disable using -Wno-maybe-uninitialized
+
+This warning causes clang builds to fail because this is not a
+recognised warning with clang
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -6,7 +6,6 @@
+ set (SWIG_CXX_DISABLE_WARNINGS -Wno-error
+                                -Wno-delete-non-virtual-dtor
+                                -Wno-unused-function
+-                               -Wno-maybe-uninitialized
+                                -Wno-strict-aliasing)
+ 
+ # If building under android, make sure swig gets an ANDROID flag
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -115,8 +115,7 @@ endif (WERROR)
+ upm_add_compile_flags(C ${C_CXX_WARNING_FLAGS}
+   -Winit-self
+   -Wimplicit
+-  -Wsign-compare
+-  -Wmissing-parameter-type)
++  -Wsign-compare)
+ 
+ # Set CXX compiler warning flags at top-level scope and emit a warning about
+ # unsupported flags
meta-oe/recipes-extended/upm/upm_git.bb +1 -0
index c851c93bc4..3ab6bbb6ba 100644
@@ -15,6 +15,7 @@ SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=http \
            file://0001-Use-stdint-types.patch \
            file://0001-initialize-local-variables-before-use.patch \
            file://0001-cmake-Disable-Wno-misleading-indentation-with-clang-.patch \
+           file://0001-cmake-Disable-using-Wno-maybe-uninitialized.patch \
            "
 
 SRC_URI_append_toolchain-clang_x86 = " file://0001-nmea_gps-Link-with-latomic.patch "
Signature · 1 line
2.26.0
author
#1 lore raw

PATCH 2/4 upm: Undefine PYTHON_EXECUTABLE cmake variable

upm has its own mechanism to detect python that it has inherited from openCV, this was forked long time ago and never updated to latest from openCV, ideally it should be fixed to entertain PYTHON_EXECUTABLE variable passed from cmake but it does not and causes build errors, proper fix is left for upm community, here we ensure that we can still compile after OE-Core change

cmake: fix Python executable with cmake

Cc Martin Kelly <[email protected]>
Cc Richard Purdie <[email protected]>
---
 meta-oe/recipes-extended/upm/upm_git.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-extended/upm/upm_git.bb +2 -0
index 3ab6bbb6ba..2e8ec0e022 100644
@@ -27,6 +27,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
 
 inherit distutils3-base cmake pkgconfig
 
+EXTRA_OECMAKE += "-UPYTHON_EXECUTABLE"
+
 # override this in local.conf to get needed bindings.
 # BINDINGS_pn-upm="python"
 # will result in only the python bindings being built/packaged.
Signature · 1 line
2.26.0
author
#2 lore raw

PATCH 3/4 upm: Disable Werror

In reply to Khem Raj

New compilers sometime find new warnings, its best to report them upstream but not break distro builds

---
 meta-oe/recipes-extended/upm/upm_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/upm/upm_git.bb +1 -1
index 2e8ec0e022..5b3585c141 100644
@@ -27,7 +27,7 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
 
 inherit distutils3-base cmake pkgconfig
 
-EXTRA_OECMAKE += "-UPYTHON_EXECUTABLE"
+EXTRA_OECMAKE += "-UPYTHON_EXECUTABLE -DWERROR=off"
 
 # override this in local.conf to get needed bindings.
 # BINDINGS_pn-upm="python"
Signature · 1 line
2.26.0
author
#3 lore raw

PATCH 4/4 mraa: Use -fcommon

In reply to Khem Raj

gcc10 is going to default to -fno-common which is opposite of all previous gcc version defaults, ideally package should be fixed so it can work with -fno-common but this is good enough for now, it does not change default behavious with older compilers

---
 meta-oe/recipes-extended/mraa/mraa_git.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-extended/mraa/mraa_git.bb +2 -0
index e702ce0ba9..403d641ee9 100644
@@ -27,6 +27,8 @@ EXTRA_OECMAKE_append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=
                          -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
                        "
 
+CFLAGS += "-fcommon"
+
 # Prepend mraa-utils to make sure bindir ends up in there
 PACKAGES =+ "${PN}-utils"
 
Signature · 1 line
2.26.0