diff --git a/fix-build-failure-with-glibc-2.28.patch b/fix-build-failure-with-glibc-2.28.patch new file mode 100644 index 0000000..89d1258 --- /dev/null +++ b/fix-build-failure-with-glibc-2.28.patch @@ -0,0 +1,36 @@ +From e6e049ca6a371528ebf39b106209c2df586500bc Mon Sep 17 00:00:00 2001 +From: Gang He +Date: Mon, 4 Mar 2019 15:20:34 +0800 +Subject: [PATCH] Fix build failure with glibc 2.28 + +Since glibc git 663e7d78 (to be 2.28), type loff_t will be only defined +when _DEFAULT_SOURCE defined. And with _XOPEN_SOURCE defined, +_DEFAULT_SOURCE will not be defined by default. + +Build failed with the error messages like, +Make[1]: Entering directory '/builddir/build/BUILD/ocfs2-tools-ocfs2-tools-1.8.5/libo2cb' +gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -pipe -fPIC -I../include -I. -DHAVE_CMAP -DHAVE_FSDLM -MD -MP -MF ./.o2cb_abi.d -o o2cb_abi.o -c o2cb_abi.c +In file included from o2cb_abi.c:52: +../include/ocfs2/ocfs2.h:222:2: error: unknown type name 'loff_t' +loff_t d_off; /* Offset of structure in the file */ +^~~~~~ +--- + Preamble.make | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Preamble.make b/Preamble.make +index b9b4af03..10adc031 100644 +--- a/Preamble.make ++++ b/Preamble.make +@@ -28,7 +28,7 @@ DIST_RULES = + INCLUDES = + DEFINES = + +-CFLAGS += -pipe ++CFLAGS += -pipe -D_DEFAULT_SOURCE=1 + # protect with configure? + CDEPFLAGS = -MD -MP -MF $(@D)/.$(basename $(@F)).d + +-- +2.19.2 + diff --git a/mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch b/mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch new file mode 100644 index 0000000..628f149 --- /dev/null +++ b/mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch @@ -0,0 +1,37 @@ +From 03be837c7d0b9be393ffb555879c49e6212fbd0f Mon Sep 17 00:00:00 2001 +From: Valentin Vidic +Date: Thu, 25 Jan 2018 13:05:27 +0100 +Subject: [PATCH] mounted.ocfs2: use include for makedev +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + + mounted.c: In function ‘build_partition_list’: + mounted.c:354:13: warning: In the GNU C Library, "makedev" is defined + by . For historical compatibility, it is + currently defined by as well, but we plan to + remove this soon. To use "makedev", include + directly. If you did not intend to use a system-defined macro + "makedev", you should undefine it after including . + makedev(major, minor), &devname); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +--- + mounted.ocfs2/mounted.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c +index 1576f902..090ab4ed 100644 +--- a/mounted.ocfs2/mounted.c ++++ b/mounted.ocfs2/mounted.c +@@ -25,7 +25,7 @@ + #define _LARGEFILE64_SOURCE + #define _GNU_SOURCE /* Because libc really doesn't want us using O_DIRECT? */ + +-#include ++#include + #include + #include + #include +-- +2.19.2 + diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index b81c6b3..6fcb445 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Mar 4 10:00:30 UTC 2019 - ghe@suse.com + +- Fix build failure with glibc-2.28 (bsc#1126968) + + mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch + + fix-build-failure-with-glibc-2.28.patch + ------------------------------------------------------------------- Thu Jan 10 10:25:30 UTC 2019 - ghe@suse.com diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 4376874..8c26fdb 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -58,6 +58,8 @@ Patch405: 0007-vendor-Add-vendor-files-for-sles12.patch Patch406: 0008-ocfs2-tools-add-systemd-support-fix.patch Patch501: bnc#96864-ocfs2console-fix-starting-failure.patch Patch502: fsck.ocfs2-fix-compile-error-when-glibc-upgrade.patch +Patch503: mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch +Patch504: fix-build-failure-with-glibc-2.28.patch BuildRequires: autoconf BuildRequires: e2fsprogs-devel @@ -169,6 +171,8 @@ OCFS2 filesystem. %patch406 -p1 %patch501 -p1 %patch502 -p1 +%patch503 -p1 +%patch504 -p1 %build export PROJECT="ocfs2-tools"