Skip to content

Commit

Permalink
Update, add --with gcc option to build with gcc for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
berolinux committed Jun 16, 2020
1 parent c491a41 commit 6406b58
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .abf.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sources:
systemd-245.20200601.tar.xz: 02e418814859bcf90e8be7e129f619758ea18428
systemd-245.20200616.tar.xz: b121e7cc98a772e0d2c3c5b7ac61c1233fbd3bd7
18 changes: 18 additions & 0 deletions systemd-245-allow-compiling-with-gcc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff -up systemd-245.20200614/src/libsystemd/disable-mempool.c.omv~ systemd-245.20200614/src/libsystemd/disable-mempool.c
--- systemd-245.20200614/src/libsystemd/disable-mempool.c.omv~ 2020-06-14 03:38:48.801773430 +0200
+++ systemd-245.20200614/src/libsystemd/disable-mempool.c 2020-06-14 03:38:55.831808656 +0200
@@ -2,4 +2,4 @@

#include "mempool.h"

-const bool mempool_use_allowed = false;
+__attribute__((used)) const bool mempool_use_allowed = false;
diff -up systemd-245.20200614/src/shared/enable-mempool.c.omv~ systemd-245.20200614/src/shared/enable-mempool.c
--- systemd-245.20200614/src/shared/enable-mempool.c.omv~ 2020-06-14 03:38:33.224693203 +0200
+++ systemd-245.20200614/src/shared/enable-mempool.c 2020-06-14 03:38:42.750742622 +0200
@@ -2,4 +2,4 @@

#include "mempool.h"

-const bool mempool_use_allowed = true;
+__attribute__((used)) const bool mempool_use_allowed = true;
12 changes: 12 additions & 0 deletions systemd-245-disable-audit-by-default.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ diff -Naur systemd-245.20200601/src/journal/journald.conf systemd-245.20200601.t
#ReadKMsg=yes
-#Audit=yes
+Audit=no
diff -up systemd-245.20200614/src/journal/journald-server.c.omv~ systemd-245.20200614/src/journal/journald-server.c
--- systemd-245.20200614/src/journal/journald-server.c.omv~ 2020-06-14 01:38:23.830881443 +0200
+++ systemd-245.20200614/src/journal/journald-server.c 2020-06-14 01:38:33.674324363 +0200
@@ -2214,7 +2214,7 @@ int server_init(Server *s, const char *n
.compress.threshold_bytes = (uint64_t) -1,
.seal = true,

- .set_audit = true,
+ .set_audit = false,

.watchdog_usec = USEC_INFINITY,

25 changes: 21 additions & 4 deletions systemd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@
%bcond_with compat32
%endif

%bcond_with gcc

# (tpg) special options for systemd to keep it fast and secure
%if %{with gcc}
%ifnarch %{ix86}
%global optflags %{optflags} -O2 -fexceptions -fstack-protector --param=ssp-buffer-size=32
%global optflags %{optflags} -fexceptions -fstack-protector --param=ssp-buffer-size=32 -fPIC
%else
%global optflags %{optflags} -fexceptions -fstack-protector --param=ssp-buffer-size=32 -fPIC -fuse-ld=bfd
%global ldflags %{ldflags} -fuse-ld=bfd -fPIC
%endif
%else
%global optflags %{optflags} -O2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -fuse-ld=bfd
%ifnarch %{ix86}
%global optflags %{optflags} -fexceptions -fstack-protector --param=ssp-buffer-size=32
%else
%global optflags %{optflags} -fexceptions -fstack-protector --param=ssp-buffer-size=32 -fuse-ld=bfd
%global ldflags %{ldflags} -fuse-ld=bfd
%endif
%endif

%bcond_with bootstrap

Expand Down Expand Up @@ -50,7 +61,7 @@
%define udev_user_rules_dir %{_sysconfdir}/udev/rules.d

%define major 245
%define stable 20200601
%define stable 20200616

Summary: A System and Session Manager
Name: systemd
Expand All @@ -64,7 +75,7 @@ Source0: systemd-%{version}.tar.xz
Version: %{major}
Source0: https://github.com/systemd/systemd/archive/v%{version}.tar.gz
%endif
Release: 4
Release: 1
License: GPLv2+
Group: System/Configuration/Boot and Init
Url: http://www.freedesktop.org/wiki/Software/systemd
Expand Down Expand Up @@ -141,6 +152,7 @@ Patch126: 0036-Notify-systemd-earlier-that-resolved-is-ready.patch

# (tpg) OMV patches
Patch1000: systemd-236-fix-build-with-LLVM.patch
Patch1001: systemd-245-allow-compiling-with-gcc.patch

# (tpg) Fedora patches
Patch1100: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
Expand Down Expand Up @@ -709,6 +721,11 @@ PATH=$PWD/bin:$PATH
%ninja_build -C build32
%endif

%if %{with gcc}
export CC=gcc
export CXX=g++
export LD=gcc
%endif
%meson \
-Drootprefix="" \
-Drootlibdir=/%{_lib} \
Expand Down

0 comments on commit 6406b58

Please sign in to comment.