Skip to contentSkip to conversation

package/systemd: add upstream build fix

PATCH New Yann E. MORIN 3 participants 4 messages Mar 26, 2018 – Apr 7, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 package/systemd: add upstream build fix

Stefan, All,

On 2018-03-26 12:54 +0300, Stefan Becker spake thusly:

Quoted 1 line

See https://github.com/systemd/systemd/issues/8507

This is *not* an upstream fix. This is just a proposal for a fix. It has not been comitted upstream!

The real upstream fix has been applied mere hours ago now, and it is different:

    https://github.com/systemd/systemd/pull/8580

So, NAK from me.

Please, update to use the upstream commit. When you do so, please also include the pointer to this upstream commit in the patch description, see below...

Quoted 17 lines
---
 .../0004-fix-linux-fs-and-mount-collisions.patch   | 97 ++++++++++++++++++++++
 1 file changed, 97 insertions(+)
 create mode 100644 package/systemd/0004-fix-linux-fs-and-mount-collisions.patch
package/systemd/0004-fix-linux-fs-and-mount-collisions.patch new file +5 -0
new file mode 100644
index 0000000000..3356c36c13
@@ -0,0 +1,97 @@
+From eb50b6d936c474f5bc2974c059f6432222af4de4 Mon Sep 17 00:00:00 2001
+From: Karel Zak <[email protected]>
+Date: Thu, 22 Mar 2018 12:50:45 +0100
+Subject: [PATCH] Fix linux/fs.h and sys/mount.h collisions
+

package/systemd/0004-fix-linux-fs-and-mount-collisions.patch line 15

Quoted 10 lines
package/systemd/0004-fix-linux-fs-and-mount-collisions.patch new file +10 -0
+* (kernel-headers) linux/fs.h and (glibc) sys/mount.h contains MS_* constants
+  and because it's without #ifdefs you cannot include the both files together
+  in the same code
+
+* (systemd) src/basic/missing.h contains another copy of MS_* constants
+
+The patch removes local systemd MS_* fallbacks, cleanup fs.h and
+mount.h include.
+
+Signed-off-by: Karel Zak <[email protected]>

Here you would add something like:

Upstream: https://github.com/systemd/systemd/pull/8580
Signed-off-by: Your name <yourmail>

Regards,
Yann E. MORIN.

Quoted 85 lines
package/systemd/0004-fix-linux-fs-and-mount-collisions.patch new file +82 -0
+---
+ src/basic/missing.h        | 40 ----------------------------------------
+ src/core/load-fragment.c   |  1 -
+ src/shared/bus-unit-util.c |  2 ++
+ 3 files changed, 2 insertions(+), 41 deletions(-)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 567aea8da9c..6802dd27c7b 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -524,46 +524,6 @@ struct btrfs_ioctl_quota_ctl_args {
+ #define OCFS2_SUPER_MAGIC 0x7461636f
+ #endif
+ 
+-#ifndef MS_MOVE
+-#define MS_MOVE 8192
+-#endif
+-
+-#ifndef MS_REC
+-#define MS_REC 16384
+-#endif
+-
+-#ifndef MS_PRIVATE
+-#define MS_PRIVATE      (1<<18)
+-#endif
+-
+-#ifndef MS_REC
+-#define MS_REC          (1<<19)
+-#endif
+-
+-#ifndef MS_SHARED
+-#define MS_SHARED       (1<<20)
+-#endif
+-
+-#ifndef MS_RELATIME
+-#define MS_RELATIME     (1<<21)
+-#endif
+-
+-#ifndef MS_KERNMOUNT
+-#define MS_KERNMOUNT    (1<<22)
+-#endif
+-
+-#ifndef MS_I_VERSION
+-#define MS_I_VERSION    (1<<23)
+-#endif
+-
+-#ifndef MS_STRICTATIME
+-#define MS_STRICTATIME  (1<<24)
+-#endif
+-
+-#ifndef MS_LAZYTIME
+-#define MS_LAZYTIME     (1<<25)
+-#endif
+-
+ #ifndef SCM_SECURITY
+ #define SCM_SECURITY 0x03
+ #endif
+diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
+index 94605ab0d02..49f8a8c6da1 100644
+--- a/src/core/load-fragment.c
++++ b/src/core/load-fragment.c
+@@ -21,7 +21,6 @@
+ 
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/fs.h>
+ #include <linux/oom.h>
+ #if HAVE_SECCOMP
+ #include <seccomp.h>
+diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
+index 23e05daf48c..6e7ea10e714 100644
+--- a/src/shared/bus-unit-util.c
++++ b/src/shared/bus-unit-util.c
+@@ -52,6 +52,8 @@
+ #include "utf8.h"
+ #include "util.h"
+ 
++#include <sys/mount.h>
++
+ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
+         assert(message);
+         assert(u);
Signature · 1 line
2.14.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/systemd: add upstream build fix

---
 ...-dont-include-libmount-h-in-a-header-file.patch | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 package/systemd/0004-core-dont-include-libmount-h-in-a-header-file.patch
package/systemd/0004-core-dont-include-libmount-h-in-a-header-file.patch new file +75 -0
new file mode 100644
index 0000000000..b91d09722b
@@ -0,0 +1,75 @@
+From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <[email protected]>
+Date: Mon, 26 Mar 2018 17:34:53 +0200
+Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
+
+linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
+definitions.
+
+To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
+should be included. And missing.h must be included last.
+
+Without this, building systemd may fail with:
+
+In file included from [...]/libmount/libmount.h:31:0,
+                 from ../systemd-238/src/core/manager.h:23,
+                 from ../systemd-238/src/core/emergency-action.h:37,
+                 from ../systemd-238/src/core/unit.h:34,
+                 from ../systemd-238/src/core/dbus-timer.h:25,
+                 from ../systemd-238/src/core/timer.c:26:
+[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
+
+Upstream: https://github.com/systemd/systemd/pull/8580
+Signed-off-by: Stefan Becker <[email protected]>
+---
+ src/core/dbus-execute.c | 1 +
+ src/core/manager.h      | 3 ++-
+ src/core/mount.c        | 2 ++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
+index 7344623ebf6..c342093bca4 100644
+--- a/src/core/dbus-execute.c
++++ b/src/core/dbus-execute.c
+@@ -18,6 +18,7 @@
+   along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
++#include <sys/mount.h>
+ #include <sys/prctl.h>
+ #include <stdio_ext.h>
+ 
+diff --git a/src/core/manager.h b/src/core/manager.h
+index 28c5da225b1..e09e0cdf5e9 100644
+--- a/src/core/manager.h
++++ b/src/core/manager.h
+@@ -20,7 +20,6 @@
+   along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
+-#include <libmount.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ 
+@@ -34,6 +33,8 @@
+ #include "list.h"
+ #include "ratelimit.h"
+ 
++struct libmnt_monitor;
++
+ /* Enforce upper limit how many names we allow */
+ #define MANAGER_MAX_NAMES 131072 /* 128K */
+ 
+diff --git a/src/core/mount.c b/src/core/mount.c
+index 0e755da5c02..0154ebda5d6 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -23,6 +23,8 @@
+ #include <stdio.h>
+ #include <sys/epoll.h>
+ 
++#include <libmount.h>
++
+ #include "sd-messages.h"
+ 
+ #include "alloc-util.h"
Signature · 1 line
2.14.3
#3 lore raw

PATCH 1/1 package/systemd: add upstream build fix

Stefan, All,

On 2018-03-26 20:19 +0300, Stefan Becker spake thusly:

Quoted 1 line

Thanks for the quick respin! :-)

And sorry if I sounded harsh in my previous review, that was not my intention. I do apologise.

Regards,
Yann E. MORIN.

Quoted 89 lines
---
 ...-dont-include-libmount-h-in-a-header-file.patch | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 package/systemd/0004-core-dont-include-libmount-h-in-a-header-file.patch
package/systemd/0004-core-dont-include-libmount-h-in-a-header-file.patch new file +75 -0
new file mode 100644
index 0000000000..b91d09722b
@@ -0,0 +1,75 @@
+From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <[email protected]>
+Date: Mon, 26 Mar 2018 17:34:53 +0200
+Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
+
+linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
+definitions.
+
+To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
+should be included. And missing.h must be included last.
+
+Without this, building systemd may fail with:
+
+In file included from [...]/libmount/libmount.h:31:0,
+                 from ../systemd-238/src/core/manager.h:23,
+                 from ../systemd-238/src/core/emergency-action.h:37,
+                 from ../systemd-238/src/core/unit.h:34,
+                 from ../systemd-238/src/core/dbus-timer.h:25,
+                 from ../systemd-238/src/core/timer.c:26:
+[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
+
+Upstream: https://github.com/systemd/systemd/pull/8580
+Signed-off-by: Stefan Becker <[email protected]>
+---
+ src/core/dbus-execute.c | 1 +
+ src/core/manager.h      | 3 ++-
+ src/core/mount.c        | 2 ++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
+index 7344623ebf6..c342093bca4 100644
+--- a/src/core/dbus-execute.c
++++ b/src/core/dbus-execute.c
+@@ -18,6 +18,7 @@
+   along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
++#include <sys/mount.h>
+ #include <sys/prctl.h>
+ #include <stdio_ext.h>
+ 
+diff --git a/src/core/manager.h b/src/core/manager.h
+index 28c5da225b1..e09e0cdf5e9 100644
+--- a/src/core/manager.h
++++ b/src/core/manager.h
+@@ -20,7 +20,6 @@
+   along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+ 
+-#include <libmount.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+ 
+@@ -34,6 +33,8 @@
+ #include "list.h"
+ #include "ratelimit.h"
+ 
++struct libmnt_monitor;
++
+ /* Enforce upper limit how many names we allow */
+ #define MANAGER_MAX_NAMES 131072 /* 128K */
+ 
+diff --git a/src/core/mount.c b/src/core/mount.c
+index 0e755da5c02..0154ebda5d6 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -23,6 +23,8 @@
+ #include <stdio.h>
+ #include <sys/epoll.h>
+ 
++#include <libmount.h>
++
+ #include "sd-messages.h"
+ 
+ #include "alloc-util.h"
Signature · 1 line
2.14.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'