Skip to contentSkip to conversation

poppler: Extend the c/c++ flags fix to cover clang

PATCH New Khem Raj 1 participant 3 messages Nov 17, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 poppler: Extend the c/c++ flags fix to cover clang

---
 ...Do-not-overwrite-all-our-build-flags.patch | 24 +++++++++++++++----
 1 file changed, 19 insertions(+), 5 deletions(-)
meta-oe/recipes-support/poppler/poppler/0001-Do-not-overwrite-all-our-build-flags.patch +19 -5
index 18f508519e..05e0abede6 100644
@@ -13,11 +13,9 @@ Signed-off-by: Andreas Müller <[email protected]>
  cmake/modules/PopplerMacros.cmake | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index ccb2790..0f392cb 100644
 --- a/cmake/modules/PopplerMacros.cmake
 +++ b/cmake/modules/PopplerMacros.cmake
-@@ -125,14 +125,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+@@ -123,14 +123,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
    set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
  
    set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
@@ -34,5 +32,21 @@ index ccb2790..0f392cb 100644
    set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
    set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
    set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
--- 
-2.14.3
+@@ -167,7 +167,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL
+   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
+ 
+   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
+-  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE")
++  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -D_DEFAULT_SOURCE ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
+   # clang does not support -fno-reorder-blocks -fno-schedule-insns, so do not use -O2
+@@ -175,7 +175,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL
+   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
+   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
+   set(_save_cflags "${CMAKE_C_FLAGS}")
+-  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
++  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
+   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
+   # clang does not support -fno-reorder-blocks -fno-schedule-insns, so do not use -O2
Signature · 1 line
2.24.0
author
#1 lore raw

PATCH 2/3 pidgin-sipe: Fix another case of struct incompatiblility due to 64bit time_t

---
 ...sts-with-time_t-elements-to-8byte-bo.patch | 50 +++++++++++++++++++
 .../pidgin/pidgin-sipe_1.25.0.bb              |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Align-structs-casts-with-time_t-elements-to-8byte-bo.patch
meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Align-structs-casts-with-time_t-elements-to-8byte-bo.patch new file +50 -0
new file mode 100644
index 0000000000..87a6435f7e
@@ -0,0 +1,50 @@
+From 1110d3036e73d0571f70f6758f3179e5048c0b5d Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 16 Nov 2019 11:07:42 -0800
+Subject: [PATCH] Align structs casts with time_t elements to 8byte boundary
+
+This helps with 64bit time_t conversion, especially where these
+structures are typcasted to another struct types which have time_t
+element, that now increases the natural alignment boundary of structures
+to 8-bytes.
+
+Fixes
+../../../pidgin-sipe-1.25.0/src/core/sipe-user.c:124:43: error: cast from 'struct sipe_core_public *' to 'struct sipe_core_private *' increases required alignment from 4 to 8 [-Werror,-Wcast-align]
+        struct sipe_core_private *sipe_private = SIPE_CORE_PRIVATE;
+                                                 ^~~~~~~~~~~~~~~~~
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/api/sipe-core.h            | 2 +-
+ src/core/sipe-http-transport.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/api/sipe-core.h b/src/api/sipe-core.h
+index cde0a9c..bd818bb 100644
+--- a/src/api/sipe-core.h
++++ b/src/api/sipe-core.h
+@@ -148,7 +148,7 @@ struct sipe_core_public {
+ 
+ 	/* server information */
+ 	/* currently nothing */
+-};
++} __attribute__((aligned(8)));
+ 
+ /**
+  * Initialize & destroy functions for the SIPE core
+diff --git a/src/core/sipe-http-transport.h b/src/core/sipe-http-transport.h
+index d82cd1b..08eb150 100644
+--- a/src/core/sipe-http-transport.h
++++ b/src/core/sipe-http-transport.h
+@@ -46,7 +46,7 @@ struct sipe_http_connection_public {
+ 	gchar *host;
+ 	guint32 port;
+ 	gboolean connected;
+-};
++} __attribute__((aligned(8)));
+ 
+ /**
+  * Check if we're shutting down the HTTP stack
+-- 
+2.24.0
+
meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb +1 -0
index 7dc63164e3..99fcf3c6d0 100644
@@ -9,6 +9,7 @@ inherit autotools gettext pkgconfig
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/sipe/pidgin-sipe-${PV}.tar.xz \
            file://0001-sipe-consider-64bit-time_t-when-printing.patch \
+           file://0001-Align-structs-casts-with-time_t-elements-to-8byte-bo.patch \
 "
 
 SRC_URI[md5sum] = "0e742f021dc8c3f17435aea05c3e0314"
Signature · 1 line
2.24.0
author
#2 lore raw

PATCH 3/3 gperftools: Convert static and libunwind support to packageconfig

In reply to Khem Raj

Disable libunwind on musl/arm

---
 meta-oe/recipes-support/gperftools/gperftools_2.7.bb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta-oe/recipes-support/gperftools/gperftools_2.7.bb +5 -4
index fdb82519bc..2cdb2e2740 100644
@@ -2,7 +2,6 @@ SUMMARY = "Fast, multi-threaded malloc() and nifty performance analysis tools"
 HOMEPAGE = "https://github.com/gperftools/gperftools"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=762732742c73dc6c7fbe8632f06c059a"
-DEPENDS += "libunwind"
 
 SRCREV = "9608fa3bcf8020d35f59fbf70cd3cbe4b015b972"
 SRC_URI = "git://github.com/gperftools/gperftools \
@@ -28,9 +27,11 @@ COMPATIBLE_HOST_mipsarch_libc-glibc = "null"
 ARM_INSTRUCTION_SET_armv5 = "arm"
 ARM_INSTRUCTION_SET_toolchain-clang_arm = "arm"
 
-# Ensure static libs are always enabled, as they seem to be not produced by
-# default at least on ARM.
-EXTRA_OECONF_append += " --enable-static"
+PACKAGECONFIG ?= "libunwind static"
+PACKAGECONFIG_remove_arm_libc-musl = "libunwind"
+
+PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+PACKAGECONFIG[static] = "--enable-static,--disable-static,"
 
 PACKAGE_BEFORE_PN += "libtcmalloc-minimal"
 FILES_libtcmalloc-minimal = "${libdir}/libtcmalloc_minimal*${SOLIBS} ${libdir}/libtcmalloc_minimal_debug*${SOLIBS}"
Signature · 1 line
2.24.0