Skip to contentSkip to conversation

cdrkit: Fix build with hardening flags

PATCH New Khem Raj 1 participant 4 messages Jun 28, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 cdrkit: Fix build with hardening flags

---
 meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb |  8 ++--
 ...001-genisoimage-Fix-fprintf-format-errors.patch | 49 ++++++++++++++++++++++
 2 files changed, 53 insertions(+), 4 deletions(-)
 create mode 100644 meta-oe/recipes-multimedia/cdrkit/files/0001-genisoimage-Fix-fprintf-format-errors.patch
meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb +4 -4
index 554b89ffa..f0efc51e1 100644
@@ -5,10 +5,10 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b30d3b2750b668133fc17b401e1b98f8"
 
 # While writing download from cdrkit.org was broken so get sources from debian
-SRC_URI = " \
-    ${DEBIAN_MIRROR}/main/c/${BPN}/${BPN}_${PV}.orig.tar.gz \
-    file://0001-do-not-create-a-run-test-to-determine-order-of-bitfi.patch \
-"
+SRC_URI = "${DEBIAN_MIRROR}/main/c/${BPN}/${BPN}_${PV}.orig.tar.gz \
+           file://0001-do-not-create-a-run-test-to-determine-order-of-bitfi.patch \
+           file://0001-genisoimage-Fix-fprintf-format-errors.patch \
+           "
 SRC_URI[md5sum] = "efe08e2f3ca478486037b053acd512e9"
 SRC_URI[sha256sum] = "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da"
 
meta-oe/recipes-multimedia/cdrkit/files/0001-genisoimage-Fix-fprintf-format-errors.patch new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.13.2
author
#1 lore raw

PATCH 2/4 orrery: Fix build with hardening flags

---
 .../orrery/0001-orrery-Fix-sprintf-format.patch    | 26 ++++++++++++++++++++++
 meta-oe/recipes-navigation/orrery/orrery_2.7.bb    |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-navigation/orrery/orrery/0001-orrery-Fix-sprintf-format.patch
meta-oe/recipes-navigation/orrery/orrery/0001-orrery-Fix-sprintf-format.patch new file +26 -0
new file mode 100644
index 000000000..eb6241fdd
@@ -0,0 +1,26 @@
+From e600d3c09d2f97a197f86e6987d44d142e7b7cdf Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 27 Jun 2017 21:12:17 -0700
+Subject: [PATCH] orrery: Fix sprintf format
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ orrery.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/orrery.c b/orrery.c
+index e3a1f6d..1b31a9f 100644
+--- a/orrery.c
++++ b/orrery.c
+@@ -3767,7 +3767,7 @@ static void drawOptsScreens(void)
+ 		      displayWidth/2 - gdk_string_width(smallFont, scratchString)/2,
+ 		      12, scratchString);
+       for (day = 0; day < 7; day++) {
+-	sprintf(scratchString, dayName[day]);
++	sprintf(scratchString, "%s", dayName[day]);
+ 	gdk_draw_string(pixmap, smallFont, blueGC,
+ 			CAL_DAY_WIDTH/2 + day*CAL_DAY_WIDTH + CAL_LEFT_OFFSET -
+ 			gdk_string_width(smallFont, scratchString)/2,
+-- 
+2.13.2
+
meta-oe/recipes-navigation/orrery/orrery_2.7.bb +2 -1
index 40a6df3c9..1a00b0808 100644
@@ -10,7 +10,8 @@ inherit autotools-brokensep pkgconfig
 SRC_URI = "http://projects.openmoko.org/frs/download.php/923/orrery_2.7_clean.tar.gz \
            file://orrery.png \
            file://use.GdkPixbuf.patch \
-"
+           file://0001-orrery-Fix-sprintf-format.patch \
+           "
 
 SRC_URI[md5sum]    = "bd62a33e7554ee1030313dfcdefcda8b"
 SRC_URI[sha256sum] = "645166a5e05b2064ab630534a514697fc47b681951e7fe1d635c259cbdf7a5e6"
Signature · 1 line
2.13.2
author
#2 lore raw

PATCH 3/4 crash: Pass optimization flags to configure via CC

In reply to Khem Raj

This is because when using fortify warnings we need to have some level of optimization, while we append warnings to CC we dont do the same for optimization, which results in compile failures when doing build with hardened flags

---
 meta-oe/recipes-kernel/crash/crash_7.1.9.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-kernel/crash/crash_7.1.9.bb +1 -0
index 93208e398..d40937e93 100644
@@ -35,6 +35,7 @@ SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5
 inherit gettext
 
 BBCLASSEXTEND = "native cross"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
 
 # crash 7.1.3 and before don't support mips64
 COMPATIBLE_HOST = "^(?!mips64).*"
Signature · 1 line
2.13.2
author
#3 lore raw

PATCH v2 4/4 ipmiutil: Update to 3.0.5

In reply to Khem Raj

for license change information see
https://sourceforge.net/p/ipmiutil/code-git/ci/647a155e219e56d9cec8ffc61ad5f43a35a1af3a/tree/COPYING?diff=adb40a4caea4873586803ba5030b79de1bfca601

---
Changes v1 -> v2:
- Forward port the systemd patch instead of dropping it

 .../ipmiutil/ipmiutil/fix_systemd_path.patch       | 241 +++------------------
 .../{ipmiutil_2.9.6.bb => ipmiutil_3.0.5.bb}       |  26 +--
 2 files changed, 30 insertions(+), 237 deletions(-)
 rename meta-oe/recipes-support/ipmiutil/{ipmiutil_2.9.6.bb => ipmiutil_3.0.5.bb} (76%)
meta-oe/recipes-support/ipmiutil/ipmiutil/fix_systemd_path.patch +25 -216
index 2fa7c6883..33116b3c0 100644
@@ -6,115 +6,11 @@ Upstream Status: Inappropriate [Embedded]
 
 Signed-off-By: Armin Kuster <[email protected]>
 
-Index: ipmiutil-2.9.6/configure
+Index: ipmiutil-3.0.5/configure.ac
 ===================================================================
---- ipmiutil-2.9.6.orig/configure
-+++ ipmiutil-2.9.6/configure
-@@ -792,7 +792,6 @@ LTLIBOBJS
- LIBOBJS
- pkgconfigdir
- SHR_LINK
--SYSTEMD_DIR
- CROSS_LFLAGS
- CROSS_CFLAGS
- SUBDIR_S
-@@ -999,7 +998,7 @@ psdir='${docdir}'
- libdir='${exec_prefix}/lib'
- localedir='${datarootdir}/locale'
- mandir='${datarootdir}/man'
--
-+systemddir='${datarootdir}/ipmiutil'
- ac_prev=
- ac_dashdash=
- for ac_option
-@@ -1594,7 +1593,10 @@ Optional Features:
-   --enable-standalone    build standalone, with no GPL or LanPlus libs.
-   --enable-libsensors	 build libipmiutil with sensor modules [default=no]
-   --enable-gpl           build with some GPL code [default=no]
--  --enable-systemd       enable systemd service type=notify support and %_unitdir [default=disabled]
-+  --enable-systemd[=systemddir]      install systemd unit file.  If 'yes'
-+                probe the system for unit directory.
-+                If a path is specified, assume that
-+                is a valid install path.  [default=disabled]
- 
- Optional Packages:
-   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-@@ -12980,7 +12982,6 @@ CROSS_LFLAGS=""
- CROSS_CFLAGS=""
- LIBSENSORS=""
- SAM2OBJ="isensor2.o ievents2.o"
--SYSTEMD_DIR=/usr/share/ipmiutil
- 
- # Check whether --enable-useflags was given.
- if test "${enable_useflags+set}" = set; then
-@@ -13032,31 +13033,43 @@ if test "${enable_gpl+set}" = set; then
-     fi
- 
- fi
--
-+#
-+# Check for systemd unit files direectory exists if unit file installation
-+# is requested
-+#
- 
- # Check whether --enable-systemd was given.
--if test "${enable_systemd+set}" = set; then
--  enableval=$enable_systemd;
--fi
--
--if test "x$enable_systemd" = "xyes"; then
--   GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
--   # if systemd enabled, install service scripts in unitdir
--   SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
--else
--   # otherwise install the systemd service scripts in the data dir
--  if test  "x$sysname" = "xDarwin" ; then
--    # MacOS 'which' command returns 0 always
--    SYSTEMD_DIR=/usr/share/ipmiutil
--  else
-+if test "${enable_systemd+set}" = set; then :
-+  withval=$enable_systemd; if test "$withval" = yes; then
-+  GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
-+  if test -z "$systemddir"; then
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5
-+$as_echo_n "checking location of the systemd unit files directory... " >&6; }
-+    _rpmdir = ""
-     which rpm >/dev/null 2>&1
-     if test  $? -eq 0 ; then
--       datad=`rpm --eval "%{_datadir}"`
--       SYSTEMD_DIR=${datad}/ipmiutil
--    else
--       SYSTEMD_DIR=/usr/share/ipmiutil
-+      _rpmdir = `rpm --eval "%{_unitdir}"`
-     fi
-+    for systemd_d in ${datadir}/usr/share/ipmiutil ${_rpmdir} /usr/share/ipmiutil; do
-+      if test -z "$systemddir"; then
-+        if test -d "$systemd_d"; then
-+          systemddir="$systemd_d"
-+        fi
-+      fi
-+    done
-   fi
-+  if test -n "$systemddir"; then
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $systemddir" >&5
-+$as_echo "$systemddir" >&6; }
-+  else
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-+$as_echo "not found" >&6; }
-+ fi
-+else
-+ if test "$withval" != no; then
-+  systemddir=$withval
-+ fi
-+fi
- fi
- 
- case "$archm" in
-Index: ipmiutil-2.9.6/configure.ac
-===================================================================
---- ipmiutil-2.9.6.orig/configure.ac
-+++ ipmiutil-2.9.6/configure.ac
-@@ -140,7 +140,6 @@ CROSS_LFLAGS=""
+--- ipmiutil-3.0.5.orig/configure.ac
++++ ipmiutil-3.0.5/configure.ac
+@@ -149,7 +149,6 @@ CROSS_LFLAGS=""
  CROSS_CFLAGS=""
  LIBSENSORS=""
  SAM2OBJ="isensor2.o ievents2.o"
@@ -122,7 +18,7 @@ Index: ipmiutil-2.9.6/configure.ac
  
  AC_ARG_ENABLE([useflags],
      [  --enable-useflags    include environment CFLAGS and LDFLAGS.],
-@@ -191,25 +190,42 @@ AC_ARG_ENABLE([gpl],
+@@ -200,29 +199,42 @@ AC_ARG_ENABLE([gpl],
  
  dnl Does this Linux have systemd enabled?  Otherwise use sysv init.
  AC_ARG_ENABLE([systemd],
@@ -130,7 +26,12 @@ Index: ipmiutil-2.9.6/configure.ac
 -if test "x$enable_systemd" = "xyes"; then
 -   GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD"
 -   # if systemd enabled, install service scripts in unitdir
--   SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
+-   which rpm >/dev/null 2>&1
+-   if test  $? -eq 0 ; then
+-	SYSTEMD_DIR=`rpm --eval "%{_unitdir}"`
+-   else
+-    SYSTEMD_DIR=/usr/share/ipmiutil
+-   fi
 +    [  --enable-systemd[=systemddir]      install systemd unit file.  If 'yes'
 +        probe the system for unit directory.
 +        If a path is specified, assume that
@@ -164,16 +65,15 @@ Index: ipmiutil-2.9.6/configure.ac
 +	fi
  else
 -   # otherwise install the systemd service scripts in the data dir
--  if test  "x$sysname" = "xDarwin" ; then
--    # MacOS 'which' command returns 0 always
--    SYSTEMD_DIR=/usr/share/ipmiutil
--  else
--    which rpm >/dev/null 2>&1
--    if test  $? -eq 0 ; then
--       datad=`rpm --eval "%{_datadir}"`
--       SYSTEMD_DIR=${datad}/ipmiutil
--    else
--       SYSTEMD_DIR=/usr/share/ipmiutil
+-  SYSTEMD_DIR=/usr/share/ipmiutil
+-  if test "x$sysname" != "xDarwin" ; then
+-    if test  "x$os" != "xhpux" ; then
+-      # MacOS and HP-UX: 'which' command returns 0 always
+-      which rpm >/dev/null 2>&1
+-      if test  $? -eq 0 ; then
+-         datad=`rpm --eval "%{_datadir}"`
+-         SYSTEMD_DIR=${datad}/ipmiutil
+-      fi
 -    fi
 -  fi
 +	if test "$withval" != no; then
@@ -183,7 +83,7 @@ Index: ipmiutil-2.9.6/configure.ac
  fi
  
  dnl start main logic
-@@ -481,7 +497,7 @@ AC_SUBST(INS_LIB)
+@@ -528,7 +540,7 @@ AC_SUBST(INS_LIB)
  AC_SUBST(SUBDIR_S)
  AC_SUBST(CROSS_CFLAGS)
  AC_SUBST(CROSS_LFLAGS)
@@ -192,74 +92,10 @@ Index: ipmiutil-2.9.6/configure.ac
  AC_SUBST(SHR_LINK)
  AC_SUBST(pkgconfigdir)
  
-Index: ipmiutil-2.9.6/Makefile.in
-===================================================================
---- ipmiutil-2.9.6.orig/Makefile.in
-+++ ipmiutil-2.9.6/Makefile.in
-@@ -182,7 +182,7 @@ SHELL = @SHELL@
- SHR_LINK = @SHR_LINK@
- STRIP = @STRIP@
- SUBDIR_S = @SUBDIR_S@
--SYSTEMD_DIR = @SYSTEMD_DIR@
-+SYSTEMD_DIR = @systemddir@
- VERSION = @VERSION@
- abs_builddir = @abs_builddir@
- abs_srcdir = @abs_srcdir@
-@@ -233,6 +233,7 @@ sbindir = @sbindir@
- sharedstatedir = @sharedstatedir@
- srcdir = @srcdir@
- sysconfdir = @sysconfdir@
-+systemddir = @systemddir@
- target_alias = @target_alias@
- top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
-Index: ipmiutil-2.9.6/scripts/Makefile.in
-===================================================================
---- ipmiutil-2.9.6.orig/scripts/Makefile.in
-+++ ipmiutil-2.9.6/scripts/Makefile.in
-@@ -126,7 +126,7 @@ SHELL = @SHELL@
- SHR_LINK = @SHR_LINK@
- STRIP = @STRIP@
- SUBDIR_S = @SUBDIR_S@
--SYSTEMD_DIR = @SYSTEMD_DIR@
-+SYSTEMD_DIR = @systemddir@
- VERSION = @VERSION@
- abs_builddir = @abs_builddir@
- abs_srcdir = @abs_srcdir@
-@@ -195,7 +195,8 @@ cronto = ${DESTDIR}${etcdir}/cron.daily
- sbinto = ${DESTDIR}${sbindir}
- varto = ${DESTDIR}/var/lib/ipmiutil
- initto = ${DESTDIR}@INIT_DIR@
--sysdto = ${DESTDIR}@SYSTEMD_DIR@
-+sysdto = ${DESTDIR}@systemddir@
-+systemddir = @systemddir@
- sysvinit = ${datato}
- sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm
- all: all-am
-@@ -398,11 +399,14 @@ install:
- 	${INSTALL_SCRIPT_SH} evt.sh       ${datato}
- 	if [ -f /etc/debian_version ]; then \
- 	   sysvinit=${initto}; fi
--	${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt
--	${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy
--	${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt
--	${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port
--	${INSTALL_SCRIPT_SH} ipmi_info    ${sysvinit}/ipmi_info
-+	if [ ! -z "${systemddir}" ]; then \
-+		$(MKDIR) ${sysdto}; \
-+		${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt; \
-+		${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy; \
-+		${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt; \
-+		${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port; \
-+		${INSTALL_SCRIPT_SH} ipmi_info    ${sysvinit}/ipmi_info; \
-+	fi
- 	${INSTALL_SCRIPT_SH} checksel     ${datato}
- 	${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto}
- 	${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto}
-Index: ipmiutil-2.9.6/scripts/Makefile.am
+Index: ipmiutil-3.0.5/scripts/Makefile.am
 ===================================================================
---- ipmiutil-2.9.6.orig/scripts/Makefile.am
-+++ ipmiutil-2.9.6/scripts/Makefile.am
+--- ipmiutil-3.0.5.orig/scripts/Makefile.am
++++ ipmiutil-3.0.5/scripts/Makefile.am
 @@ -17,7 +17,8 @@ cronto = ${DESTDIR}${etcdir}/cron.daily
  sbinto = ${DESTDIR}${sbindir}
  varto  = ${DESTDIR}/var/lib/ipmiutil
@@ -268,7 +104,7 @@ Index: ipmiutil-2.9.6/scripts/Makefile.am
 +sysdto = ${DESTDIR}@systemddir@
 +systemddir = @systemddir@
  sysvinit = ${datato}
- sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm
+ sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm iuser
  
 @@ -47,10 +48,14 @@ install:
  	${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port
@@ -289,30 +125,3 @@ Index: ipmiutil-2.9.6/scripts/Makefile.am
  	${INSTALL_SCRIPT_SH} ipmiutil.env     ${datato}
  	${INSTALL_SCRIPT_SH} ipmiutil.pre     ${datato}
  	${INSTALL_SCRIPT_SH} ipmiutil.setup   ${datato}
-Index: ipmiutil-2.9.6/lib/Makefile.in
-===================================================================
---- ipmiutil-2.9.6.orig/lib/Makefile.in
-+++ ipmiutil-2.9.6/lib/Makefile.in
-@@ -128,7 +128,7 @@ SHELL = @SHELL@
- SHR_LINK = @SHR_LINK@
- STRIP = @STRIP@
- SUBDIR_S = @SUBDIR_S@
--SYSTEMD_DIR = @SYSTEMD_DIR@
-+SYSTEMD_DIR = @systemddir@
- VERSION = @VERSION@
- abs_builddir = @abs_builddir@
- abs_srcdir = @abs_srcdir@
-Index: ipmiutil-2.9.6/lib/lanplus/Makefile.in
-===================================================================
---- ipmiutil-2.9.6.orig/lib/lanplus/Makefile.in
-+++ ipmiutil-2.9.6/lib/lanplus/Makefile.in
-@@ -177,7 +177,8 @@ SHELL = @SHELL@
- SHR_LINK = @SHR_LINK@
- STRIP = @STRIP@
- SUBDIR_S = @SUBDIR_S@
--SYSTEMD_DIR = @SYSTEMD_DIR@
-+SYSTEMD_DIR = @systemddir@
-+systemddir = @systemddir@
- VERSION = @VERSION@
- abs_builddir = @abs_builddir@
- abs_srcdir = @abs_srcdir@
meta-oe/recipes-support/ipmiutil/ipmiutil_3.0.5.bb renamed from meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb +5 -21
similarity index 76%
rename from meta-oe/recipes-support/ipmiutil/ipmiutil_2.9.6.bb
rename to meta-oe/recipes-support/ipmiutil/ipmiutil_3.0.5.bb
index ee0766ea7..338cafd53 100644
@@ -13,17 +13,17 @@ is detected."
 
 HOMEPAGE = "http://ipmiutil.sourceforge.net"
 LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://COPYING;md5=5f9372493401f309e6149dd2ce0a044b"
+LIC_FILES_CHKSUM = "file://COPYING;md5=626a5970304daa1fcb87f757fb42b795"
 
 DEPENDS += "openssl"
 
 PARALLEL_MAKE = ""
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/ipmiutil/ipmiutil-${PV}.tar.gz \
-    file://fix_systemd_path.patch "
-
-SRC_URI[md5sum] = "462087995f05fa9e692ed7f55c840f71"
-SRC_URI[sha256sum] = "884c1f3d8bfb0b33c303973d286c3166f5a537976451a0312e3524af54771519"
+           file://fix_systemd_path.patch \
+          "
+SRC_URI[md5sum] = "5feaf6a827205792e057bb4ff5c4e842"
+SRC_URI[sha256sum] = "b2d7f72535131c7832ba4be13dc33c81513fc3ee43fe797b4b52014600ecee5e"
 
 inherit autotools-brokensep pkgconfig systemd
 
@@ -43,20 +43,4 @@ PACKAGECONFIG[standalone] = "--enable-standalone, --enable-standalone=no"
 CFLAGS += "-I${STAGING_INCDIR}"
 LDFLAGS += "-L${STAGING_LIBDIR}"
 
-do_configure () {
-    aclocal
-    libtoolize --automake --copy --force
-    autoheader
-    automake --foreign --add-missing --copy
-
-    aclocal
-    autoconf
-    automake --foreign
-    ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
-}
-
-do_install () {
-    oe_runmake install DESTDIR=${D}
-}
-
 COMPATIBLE_HOST = '(x86_64|i.86).*-linux'
Signature · 1 line
2.13.2