From 207b36f01b2c528d46d1573883b95740859d8574 Mon Sep 17 00:00:00 2001 From: Alexander Kapshuna Date: Wed, 28 Oct 2020 00:15:33 +0300 Subject: [PATCH] openrc: version bump to 0.42.1 Fix build failure when using gcc:10 --- ...r.h-fix-build-failure-against-gcc-10.patch | 48 +++++++++++++++++++ ...41.2.exheres-0 => openrc-0.42.1.exheres-0} | 4 ++ 2 files changed, 52 insertions(+) create mode 100644 packages/sys-apps/openrc/files/src-rc-rc-logger.h-fix-build-failure-against-gcc-10.patch rename packages/sys-apps/openrc/{openrc-0.41.2.exheres-0 => openrc-0.42.1.exheres-0} (96%) diff --git a/packages/sys-apps/openrc/files/src-rc-rc-logger.h-fix-build-failure-against-gcc-10.patch b/packages/sys-apps/openrc/files/src-rc-rc-logger.h-fix-build-failure-against-gcc-10.patch new file mode 100644 index 0000000..7e51374 --- /dev/null +++ b/packages/sys-apps/openrc/files/src-rc-rc-logger.h-fix-build-failure-against-gcc-10.patch @@ -0,0 +1,48 @@ +From 375ef42393f3dc6edbaa2cb70c79b2366072db38 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sun, 19 Jan 2020 15:24:20 +0000 +Subject: [PATCH] src/rc/rc-logger.h: fix build failure against gcc-10 + +On gcc-10 (and gcc-9 -fno-common) build fails as: + +``` +cc -L../librc -L../libeinfo -O2 -g -std=c99 -Wall -Wextra -Wimplicit -Wshadow \ + -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn \ + -Wmissing-format-attribute -Wnested-externs -Winline -Wwrite-strings \ + -Wcast-align -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement \ + -Wsequence-point -Werror=implicit-function-declaration \ + -Wl,-rpath=/lib -o openrc rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o -lutil -lrc -leinfo -Wl,-Bdynamic -ldl +ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:16: + multiple definition of `rc_logger_pid'; rc.o:openrc/src/rc/rc-logger.h:16: first defined here +ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:17: + multiple definition of `rc_logger_tty'; rc.o:openrc/src/rc/rc-logger.h:17: first defined here +``` + +gcc-10 will change the default from -fcommon to fno-common: +https://gcc.gnu.org/PR85678. + +The error also happens if CFLAGS=-fno-common passed explicitly. + +This fixes #348. +--- + src/rc/rc-logger.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/rc/rc-logger.h b/src/rc/rc-logger.h +index bf6e3e57..1da294b0 100644 +--- a/src/rc/rc-logger.h ++++ b/src/rc/rc-logger.h +@@ -13,8 +13,8 @@ + #ifndef RC_LOGGER_H + #define RC_LOGGER_H + +-pid_t rc_logger_pid; +-int rc_logger_tty; ++extern pid_t rc_logger_pid; ++extern int rc_logger_tty; + extern bool rc_in_logger; + + void rc_logger_open(const char *runlevel); +-- +2.29.0 + diff --git a/packages/sys-apps/openrc/openrc-0.41.2.exheres-0 b/packages/sys-apps/openrc/openrc-0.42.1.exheres-0 similarity index 96% rename from packages/sys-apps/openrc/openrc-0.41.2.exheres-0 rename to packages/sys-apps/openrc/openrc-0.42.1.exheres-0 index 5933964..f1322c6 100644 --- a/packages/sys-apps/openrc/openrc-0.41.2.exheres-0 +++ b/packages/sys-apps/openrc/openrc-0.42.1.exheres-0 @@ -47,6 +47,10 @@ DEPENDENCIES=" REMOTE_IDS="github:OpenRC/${PN}" +DEFAULT_SRC_PREPARE_PATCHES=( + "${FILES}"/src-rc-rc-logger.h-fix-build-failure-against-gcc-10.patch +) + DEFAULT_SRC_COMPILE_PARAMS=( LIBNAME=lib LIBEXECDIR=/usr/$(exhost --target)/libexec/rc