From patchwork Sun Aug 5 02:06:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 143452 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1804049ljj; Sat, 4 Aug 2018 19:07:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfpNaO/t2LNf4lNltn1rzrTUPGGNWPLqLB2h3BffVr7qh2ObiJ9uZRF7fHA4h3y01Y9l5i4 X-Received: by 2002:a17:902:20c2:: with SMTP id v2-v6mr9077655plg.22.1533434851056; Sat, 04 Aug 2018 19:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533434851; cv=none; d=google.com; s=arc-20160816; b=oA39FTO4nDQgXmhdHJaQk7idZlBZrl4bxDSlobBL5c8U30PHzbm2IYax1UF6Jv+HQt RjkDoJt1j7lfRkDCa9Ls2qC59Zvug1V6KY0ALdfcBF47WUg0b7eZ1rwJn9nnBcslODO8 X38uLGLVw8ABRCKukIZbS2eLvRPf3xgnqt7waTa4PWi+JhYrOUr8kYRUhfb+Dkc1SVIP OzrBLkhHY2U+fBsws/gP2uFuev7svtHuZs+EY6pthMrwlONuVSB6yw2M+rIQK1mLDvLR gg3fUq0HYxrGh/HfcPH4C/r3amnYkNQAxLsS2oh/NyqypODTiPuVpR0hRxXj6ZRPFH93 DdQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=gmwpmXyZUohVoyyxI1JO33lrNItXiaK1JBGw5ZCD4Fs=; b=O6UvCKXYRtdrwQcFwp8Uud6kOnpBcpxNBV3W+rmQg+COxHQy3b1BBurogA9mK/3akU MxuPMFQimytQMstYKgfaKWEWiMX77ClxVokIwAwf+e1S4rowHig/iAvwzRBL5g4OIuXz rVYxGppT5Rwle4l47eI1WfzbP67FTzQFmBRy5cCqm8uQhNbY84cYPjVDVl8gWC6ZyVsq 27hppX8ysCQQaqzohSXrWoKXF8xHfn+mXGutbn+t9x3zSHZpqerVrSIyimn9oEp6DICI 3o9HN03yPnYcs/PZlyUFfZ7Zwt+tVThG+sEXY7mI0eKDDQSyTXimjRX4rk3uUrlzXHkk Ivcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=bwjL7xsp; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id f89-v6si7159038plf.20.2018.08.04.19.07.30; Sat, 04 Aug 2018 19:07:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=bwjL7xsp; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 7A02B78BE8; Sun, 5 Aug 2018 02:07:28 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mail.openembedded.org (Postfix) with ESMTP id C7A90783DE for ; Sun, 5 Aug 2018 02:07:10 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id x5-v6so4604322pgp.7 for ; Sat, 04 Aug 2018 19:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wr9gWUxko6uLq01v5vr8aAhpdiwKJ70Cm/0L92KVg0o=; b=bwjL7xsph64beybK2x/yJKULtgob6WSLjujaChqjkmDfuGu+wbNBBpVCeCU35PHnv9 aTSJKvkXFL3efctzYlc+am50vYR7hPKLKn5P3kHxmKD2YZzfhgoooaFCZdppefvAVgGl 9/WJj++4Sm3L4lFR7StLhmBNVPqubD6OaovtpXoCUT2zjq1Wc1akuFL6ONz2L7L0RZtl Yywx1ZfDZPGXlOY1PixBBJGFe0YPPwUhIiL5Wn+KzanLZCg2L4zckt+UWDGm1DDPeRrZ IGmcW3fXfJCeAwekSZR5JJ8/m3aP6rscJkHFAsOsRZf2/PCL5gxk+45yqvCNtJQaTXhx aY6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wr9gWUxko6uLq01v5vr8aAhpdiwKJ70Cm/0L92KVg0o=; b=dfbVd7Fuv7UEyRWW5w0PxCLJkGrTySUuon2wmrjldAoIr7uw7XPA8s3a1cUM5UOJZE pzgfcmgwOM4Aj4HpZzMAyNQGLf8Nz0oP3DSQ7nEZThOoDz8NzIwVZKUpbOL9MOiQqn29 go7VN9eouGqf2qAxjgHSvoVqtgDPB3LGPI2eD5bWnjDKx0gPo8yQQyFdqDAIHgVRIOqP PC4DPcVKsrD8VUShTg2jnm12sSLlTqHTXLUhkZ3ypCmof1/OOszKjzyyMnVd4UtgklTx 70q/gVjkSGyT0VdHJXHnfrHbT94rLDFskEW5aoJ5FliQ/ZCn+l6FqX3ItG31wVlUuBGT hIiw== X-Gm-Message-State: AOUpUlFqQQmJiNGMoivUrYAr49Ets/mRMOXg//o6lob6bUdwlFMHAXPj 3GyTxpBtg7MID+O9HIx5NBNLilXl X-Received: by 2002:a63:5350:: with SMTP id t16-v6mr9284803pgl.196.1533434831508; Sat, 04 Aug 2018 19:07:11 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::5b3b]) by smtp.gmail.com with ESMTPSA id b195-v6sm4486021pfb.2.2018.08.04.19.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 19:07:10 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sat, 4 Aug 2018 19:06:54 -0700 Message-Id: <13750489ed148df9baf77c15b2faab06683be9a2.1533434674.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [OE-core] [PATCH 02/10] systemd: Detect if statx struct is defined in sys/stat.h X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Fixed build with glibc 2.28+ Signed-off-by: Khem Raj --- ...-whether-struct-statx-is-defined-in-.patch | 109 ++++++++++++++++++ meta/recipes-core/systemd/systemd_239.bb | 1 + 2 files changed, 110 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch diff --git a/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch b/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch new file mode 100644 index 0000000000..962463f0b8 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch @@ -0,0 +1,109 @@ +From 75720bff62a84896e9a0654afc7cf9408cf89a38 Mon Sep 17 00:00:00 2001 +From: Filipe Brandenburger +Date: Sun, 15 Jul 2018 22:43:35 -0700 +Subject: [PATCH] build-sys: Detect whether struct statx is defined in + sys/stat.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a +definition for struct statx, in which case include file linux/stat.h should be +avoided, in order to prevent a duplicate definition. + + In file included from ../src/basic/missing.h:18, + from ../src/basic/util.h:28, + from ../src/basic/hashmap.h:10, + from ../src/shared/bus-util.h:12, + from ../src/libsystemd/sd-bus/bus-creds.c:11: + /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’ + struct statx { + ^~~~~ + In file included from /usr/include/sys/stat.h:446, + from ../src/basic/util.h:19, + from ../src/basic/hashmap.h:10, + from ../src/shared/bus-util.h:12, + from ../src/libsystemd/sd-bus/bus-creds.c:11: + /usr/include/bits/statx.h:36:8: note: originally defined here + struct statx + ^~~~~ + +Extend our meson.build to look for struct statx when only sys/stat.h is +included and, in that case, do not include linux/stat.h anymore. + +Tested that systemd builds correctly when using a glibc version that includes a +definition for struct statx. + +glibc Fedora RPM update: +https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae + +glibc upstream commit: +https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd +--- + +Upstream-Status: Pending +Signed-off-by: Khem Raj + + meson.build | 5 +++++ + src/basic/missing.h | 5 ++++- + src/basic/xattr-util.c | 1 - + 3 files changed, 9 insertions(+), 2 deletions(-) + +Index: git/meson.build +=================================================================== +--- git.orig/meson.build ++++ git/meson.build +@@ -432,6 +432,7 @@ decl_headers = ''' + #include + ''' + # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail ++# FIXME: these should use -D_GNU_SOURCE, since that is defined at build time + + foreach decl : ['char16_t', + 'char32_t', +@@ -446,6 +447,10 @@ foreach decl : ['char16_t', + conf.set10('HAVE_' + decl.underscorify().to_upper(), have) + endforeach + ++conf.set10('HAVE_STRUCT_STATX_IN_SYS_STAT_H', cc.sizeof('struct statx', prefix : ''' ++#include ++''', args : '-D_GNU_SOURCE') > 0) ++ + foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], + ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], + ['IFLA_VRF_TABLE', 'linux/if_link.h'], +Index: git/src/basic/missing.h +=================================================================== +--- git.orig/src/basic/missing.h ++++ git/src/basic/missing.h +@@ -15,7 +15,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -25,6 +24,10 @@ + #include + #include + ++#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H ++#include ++#endif ++ + #if HAVE_AUDIT + #include + #endif +Index: git/src/basic/xattr-util.c +=================================================================== +--- git.orig/src/basic/xattr-util.c ++++ git/src/basic/xattr-util.c +@@ -2,7 +2,6 @@ + + #include + #include +-#include + #include + #include + #include diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb index 001a363444..67f6117a2a 100644 --- a/meta/recipes-core/systemd/systemd_239.bb +++ b/meta/recipes-core/systemd/systemd_239.bb @@ -28,6 +28,7 @@ SRC_URI += "file://touchscreen.rules \ file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \ file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \ file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \ + file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \ " SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"