Skip to contentSkip to conversation

xfsprogs: Fix build on mips

PATCH New Khem Raj 1 participant 3 messages Aug 23, 2018

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 xfsprogs: Fix build on mips

---
 ...001-Check-for-MAP_SYNC-in-sys-mman.h.patch | 52 +++++++++++++++++++
 ...include-xfs-linux.h-after-sys-mman.h.patch | 33 ++++++++++++
 .../recipes-utils/xfsprogs/xfsprogs_4.17.0.bb |  5 +-
 3 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100644 meta-filesystems/recipes-utils/xfsprogs/files/0001-Check-for-MAP_SYNC-in-sys-mman.h.patch
 create mode 100644 meta-filesystems/recipes-utils/xfsprogs/files/0002-include-include-xfs-linux.h-after-sys-mman.h.patch
meta-filesystems/recipes-utils/xfsprogs/files/0001-Check-for-MAP_SYNC-in-sys-mman.h.patch new file +52 -0
new file mode 100644
index 0000000000..75b227ac19
@@ -0,0 +1,52 @@
+From f41ef1f06d428c81fcdef73d896dfc7ceda1809c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 23 Aug 2018 04:59:39 +0000
+Subject: [PATCH] Check for MAP_SYNC in sys/mman.h
+
+Not all arches have wired MAP_SYNC e.g. mips
+which have conflicts with definition, so checking
+a generic file is going to mis-configure xfsprogs
+for such arches.
+
+libc now has added the relevant macros to
+sys/mman.h, and returns the right values for arches
+where its implemented and nothing for others
+unlike asm-generic/mman.h which only checks
+for kernel headers and ignored arches
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/linux.h       | 3 +--
+ m4/package_libcdev.m4 | 3 +--
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/include/linux.h b/include/linux.h
+index 1998941..7e5c9ab 100644
+--- a/include/linux.h
++++ b/include/linux.h
+@@ -331,8 +331,7 @@ fsmap_advance(
+ #define MAP_SYNC 0
+ #define MAP_SHARED_VALIDATE 0
+ #else
+-#include <asm-generic/mman.h>
+-#include <asm-generic/mman-common.h>
++#include <sys/mman.h>
+ #endif /* HAVE_MAP_SYNC */
+ 
+ #endif	/* __XFS_LINUX_H__ */
+diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
+index 0a6b514..2b47d2f 100644
+--- a/m4/package_libcdev.m4
++++ b/m4/package_libcdev.m4
+@@ -335,8 +335,7 @@ AC_DEFUN([AC_HAVE_STATFS_FLAGS],
+ AC_DEFUN([AC_HAVE_MAP_SYNC],
+   [ AC_MSG_CHECKING([for MAP_SYNC])
+     AC_TRY_COMPILE([
+-#include <asm-generic/mman.h>
+-#include <asm-generic/mman-common.h>
++#include <sys/mman.h>
+     ], [
+         int flags = MAP_SYNC | MAP_SHARED_VALIDATE;
+     ], have_map_sync=yes
meta-filesystems/recipes-utils/xfsprogs/files/0002-include-include-xfs-linux.h-after-sys-mman.h.patch new file +33 -0
new file mode 100644
index 0000000000..89447fd92e
@@ -0,0 +1,33 @@
+From 18298d7c028cd5fbd2c68fa428dc2384344aeb91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 23 Aug 2018 05:33:57 +0000
+Subject: [PATCH] include include/xfs/linux.h after <sys/mman.h>
+
+This helps compiling with musl which goes ahead and undefines MAP_SYNC
+for mips and other architectures where its not wired in kernel
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ io/mmap.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/io/mmap.c b/io/mmap.c
+index 106be49..34fadf4 100644
+--- a/io/mmap.c
++++ b/io/mmap.c
+@@ -16,10 +16,11 @@
+  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  */
+ 
+-#include "command.h"
+-#include "input.h"
+ #include <sys/mman.h>
+ #include <signal.h>
++
++#include "command.h"
++#include "input.h"
+ #include "init.h"
+ #include "io.h"
+ 
meta-filesystems/recipes-utils/xfsprogs/xfsprogs_4.17.0.bb +4 -1
index 06f774d875..ee571ce863 100644
@@ -9,6 +9,8 @@ SRC_URI = "https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/${BP}.tar.xz \
            file://remove_flags_from_build_flags.patch \
            file://0001-build-Check-for-sync_file_range-libc-function.patch \
            file://disable-xfs_scrub-build.patch \
+           file://0001-Check-for-MAP_SYNC-in-sys-mman.h.patch \
+           file://0002-include-include-xfs-linux.h-after-sys-mman.h.patch \
            "
 SRC_URI[md5sum] = "b935b693dfac0264e232c3c4e52d5569"
 SRC_URI[sha256sum] = "f53f5169cb98cfca471ddea30092738c427ba284c5356e01b45dd1ae3b297e0d"
@@ -48,13 +50,14 @@ export tagname="CC"
 
 EXTRA_OEMAKE = "DIST_ROOT='${D}'"
 
-do_configure_prepend () {
+do_configure () {
     export BUILD_CC="${BUILD_CC} ${BUILD_CFLAGS}"
     # Prevent Makefile from calling configure without arguments,
     # when do_configure gets called for a second time.
     rm -f ${B}/include/builddefs ${B}/include/platform_defs.h ${B}/configure
     # Recreate configure script.
     oe_runmake configure
+    oe_runconf
 }
 
 do_install_append() {
Signature · 1 line
2.18.0
author
#1 lore raw

PATCH 2/3 espeak: Fix cp command to preserve mode

---
 meta-oe/recipes-support/espeak/espeak_1.48.04.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta-oe/recipes-support/espeak/espeak_1.48.04.bb +1 -2
index 552f40413b..57e30f0710 100644
@@ -36,6 +36,5 @@ do_install() {
         rm -f ${S}/espeak-data/phon*
     fi
 
-    cp -prf ${S}/espeak-data/* ${D}${datadir}/espeak-data
-    chown -R root:root ${D}${datadir}/espeak-data
+    cp -R --no-dereference --preserve=mode,links ${S}/espeak-data/* ${D}${datadir}/espeak-data
 }
Signature · 1 line
2.18.0
author
#2 lore raw

PATCH 3/3 espeak: Add -fPIC to CFLAGS needed on some arches with security flags on

In reply to Khem Raj

Update the narrowing fix patches from Fedora

---
 .../espeak/espeak-data_1.48.04.bb             |  2 +-
 meta-oe/recipes-support/espeak/espeak.inc     |  3 +-
 ...red-library-on-architectures-needing.patch | 31 ++++++++++
 .../espeak/files/espeak-1.48-gcc-6-fix.patch  | 12 ++++
 .../files/gcc-narrowing-warning-fix.patch     | 56 -------------------
 5 files changed, 46 insertions(+), 58 deletions(-)
 create mode 100644 meta-oe/recipes-support/espeak/files/0001-Fix-build-of-shared-library-on-architectures-needing.patch
 create mode 100644 meta-oe/recipes-support/espeak/files/espeak-1.48-gcc-6-fix.patch
 delete mode 100644 meta-oe/recipes-support/espeak/files/gcc-narrowing-warning-fix.patch
meta-oe/recipes-support/espeak/espeak-data_1.48.04.bb +1 -1
index 79b2cc1f41..a4e5d14d17 100644
@@ -14,7 +14,7 @@ do_compile() {
     sed -i '/^ *CC *=/d' Makefile
     sed -i 's/\(.*BYTE_ORDER\)/#undef BYTE_ORDER\n#define BYTE_ORDER BIG_ENDIAN\n\1/' espeak-phoneme-data.c
     oe_runmake
-    ./espeak-phoneme-data "${S}/espeak-data"
+    ./espeak-phoneme-data "${S}/espeak-data" "." "${S}/espeak-data/phondata-manifest"
     cp -f phondata phonindex phontab "${S}/espeak-data"
 }
 
meta-oe/recipes-support/espeak/espeak.inc +2 -1
index 60b3f73c81..f45455c7e1 100644
@@ -4,7 +4,8 @@ LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://License.txt;md5=cb7a20edb4c9f5f478de6523dcd7362c"
 
 SRC_URI = "http://downloads.sourceforge.net/espeak/espeak-1.48.04-source.zip \
-           file://gcc-narrowing-warning-fix.patch \
+           file://0001-Fix-build-of-shared-library-on-architectures-needing.patch \
+           file://espeak-1.48-gcc-6-fix.patch \
 "
 SRC_URI[md5sum] = "cadd7482eaafe9239546bdc09fa244c3"
 SRC_URI[sha256sum] = "bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659"
meta-oe/recipes-support/espeak/files/0001-Fix-build-of-shared-library-on-architectures-needing.patch new file +31 -0
new file mode 100644
index 0000000000..2590e15841
@@ -0,0 +1,31 @@
+From 08a464e2b6bd31bb2bf4e258ebfa9b9d65805abf Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Fri, 27 Nov 2015 15:17:02 +0100
+Subject: [PATCH] Fix build of shared library on architectures needing -fPIC
+
+Certain architectures, like Sparc and Sparc64 require objects to be
+built with -fPIC (and not just -fpic) to be usable in shared
+libraries. On other architectures, -fPIC is the same as -fpic so this
+patch doesn't affect such architectures.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 95fe549..c293611 100755
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -110,7 +110,7 @@ $(BIN2_NAME): $(OBJS3) $(LIB_NAME)
+ 
+ 
+ x_%.o: %.cpp
+-	$(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -fpic -fvisibility=hidden -pedantic \
++	$(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -fPIC -fvisibility=hidden -pedantic \
+ 	-I. -D LIBRARY -c -fno-exceptions  $<  -o x_$*.o
+ 
+ $(LIB_NAME): $(OBJS2)
+-- 
+2.6.3
+
meta-oe/recipes-support/espeak/files/espeak-1.48-gcc-6-fix.patch new file +12 -0
new file mode 100644
index 0000000000..6e59c7892f
@@ -0,0 +1,12 @@
+diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp
+--- a/src/tr_languages.cpp
++++ b/src/tr_languages.cpp
+@@ -198,7 +198,7 @@ static const unsigned short chars_ignore_zwnj_hyphen[] = {
+ 	0x200d,  1, // zero width joiner
+ 	0, 0 };
+ 
+-const char string_ordinal[] = {0xc2,0xba,0};  // masculine ordinal character, UTF-8
++const char string_ordinal[] = {'\xc2','\xba',0};  // masculine ordinal character, UTF-8
+ 
+ 
+ static Translator* NewTranslator(void)
meta-oe/recipes-support/espeak/files/gcc-narrowing-warning-fix.patch deleted +0 -56

56 lines not on this page · raw message

Signature · 1 line
2.18.0