From patchwork Fri Sep 6 11:01:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793948 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94F7F1CC15B; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; cv=none; b=mdW+yuZYS8UB/31nDo1ymx+TPQcTQ2o0LAQoGffiHskOJkFJwYlravpindeGnfkvfqmxCN0lStj06I6U+0hwpQG7pkTbAuyah4T/t6ZDC4rVtudlfgZXykdRnQ7ueH0URE96o+flZa1ib6nTa4McnC8SqJtgZ0Y8ia/QiZsB4E0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; c=relaxed/simple; bh=CZ4Sd6zgDNuwEmkc90VthiZDpWCvWQy9Kc+RHCEsgOQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p2lDrMZPSWG426CoGjW1qh6IlNTa598IYlx3snDKVDTU+GzyO+HFaKsDfU8Of6F2PplkrkAMKkl+c7mJy5vEsLAiZ0GxsJa0TTw3k/uY51n2qFJZMf/dQEhimvU+CLXK/0fFDUGaem8SZX/DIUZPc+v+DWL0EgA5bZoyfOdvycs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oglDOhcp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oglDOhcp" Received: by smtp.kernel.org (Postfix) with ESMTPS id 1084BC4CED2; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=CZ4Sd6zgDNuwEmkc90VthiZDpWCvWQy9Kc+RHCEsgOQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=oglDOhcpmxg9zNKmWK35loqmfWrq7174vQW7yOghE6cQoKUenmq2yyJv/Cjvv5Gfa B7APbxvqjPtzat5d7GEz4LRj1BlDqJho81gJ2VlPC5WU/fRJceZ2YQqAQUDQPwabz6 ZIcseOPSymTnnag5e4VDOr2Vhu/o9BxQZvZqF0WaiLcxtyYFqqusWSf4ZLepaUcVoP EwHPTxoArQy2AZfFl356S5M96+SaSjnLjq94zELtCpg6wn2K0dxXbk443nAvcG64sF 9WhIAely/i3QNyL1X69KfQkdT1FMFa+jWJWSGvK4NWw5INPEJr0HAuQ8OvgxV98y2e E556rhbiZVAlQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 045F7CE7AFB; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:28 +0200 Subject: [PATCH v2 1/8] scripts: subarch.include: fix SUBARCH on macOS hosts Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-1-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez , Nick Desaulniers X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=1281; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=ijKRG+KyDGNZNJsR1osTMsvKgO5/NVSV4G6aYDCZyuU=; b=bCEWBORAMhzM3X1JpnkGQsiKqWPlOJG9GDKEFa1LXCWwoKrNbvWue+SUs1Xdr1tCLoWm1yKtz vPqgnpTHecbDCQLGjD2lGrqM/d5qSwRAFEBNf23yetInPepO8yTVkDi X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Nick Desaulniers When building the Linux kernel on an aarch64 macOS based host, if we don't specify a value for ARCH when invoking make, we default to arm and thus multi_v7_defconfig rather than the expected arm64 and arm64's defconfig. This is because subarch.include invokes `uname -m` which on MacOS hosts evaluates to `arm64` but on Linux hosts evaluates to `aarch64`, This allows us to build ARCH=arm64 natively on macOS (as in ARCH need not be specified on an aarch64-based system). Avoid matching arm64 by excluding it from the arm.* sed expression. Signed-off-by: Nick Desaulniers Signed-off-by: Daniel Gomez --- scripts/subarch.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/subarch.include b/scripts/subarch.include index 4bd327d0ae42..c4592d59d69b 100644 --- a/scripts/subarch.include +++ b/scripts/subarch.include @@ -6,7 +6,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ -e s/sun4u/sparc64/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e /^arm64$$/!s/arm.*/arm/ -e s/sa110/arm/ \ -e s/s390x/s390/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ From patchwork Fri Sep 6 11:01:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793947 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94EFD1CC155; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; cv=none; b=ilbG0Yv5RzFAz/2VV6mYHN1HFJRnxCKz8T9EbTWo/p6+Z1ZCIIDE5AlrGW4UwT1nSkowyew5niz4cugwrdNpIcUwX2p3RisbD1d0Bc13neu/whJBT8agwqQYltHguOceJO0SrO+Z4azbLGl4IrWbHwgOI0ElKDFGy+uRB1Vl3Jc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; c=relaxed/simple; bh=VRY9hw7zC+rmwJqhBTSG/76DJOwQSDt2QqR1xiCym/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YyJFiFOkg1iL600XSW+V+QoCYGklvMdi1iGxzvtCSPs612SlGFJ/KWljBgm0ohmdrG30Zjw8Bhm0y5vwMHXIfORsu3zE6BCI4rMX76MnyzMjJaCi1QjIqr+iBo9JARkfSrCh+93JoU5KWQ6F2gxNJ1Sza1wlxCLJqTRp2JnrBKw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uWD382OF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uWD382OF" Received: by smtp.kernel.org (Postfix) with ESMTPS id 30E7AC4CECF; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=VRY9hw7zC+rmwJqhBTSG/76DJOwQSDt2QqR1xiCym/8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uWD382OFT6kbeZILBvct3+ps3vQOuIMXE7IGd+9h7l1pcSoKqakHneRZJYMkb5WG8 xVUiflkH01b28wXkhRcrqywH+dhdfFP/kvNfAXHOioyAVObECBr5IjCIphE3gWtm3Q scDo8Fm+iuaXAsgV58cl9gMCnIy/fOyTx7tnDu+Tvt+TCbbhvEVZ7TQs5lJXKTKLII dePIxiy6dV28S1dct4tih+mvjanUybrGhFzZt4eHWST6GFxt3qeNLeEFakS72s7ieX VXfuoQmRSmPRX5coOL9FODTJ92D5kvrh70oi7+wElaUotlw4DnZzAJN5OrQufRGieT J1cAKibRl2zdA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D794CE7B00; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:29 +0200 Subject: [PATCH v2 2/8] file2alias: fix uuid_t definitions for macos Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-2-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=10491; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=kEoEyvruU1xrPTnRzMVPNv/DX5W819KO2SPMHt88X9k=; b=zvtijQv+MlRcQEW1UxGj5ftHZV4daT/doF2R2i3mC2QdO36IpAm4k54Mo9R6dylpW1kAX3wl8 V9KDI1IPuv8BNr7uRX/2M7DXWnZ8WXLYzBkClN04ARgNGx++SwQYVZp X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Daniel Gomez The uuid_t struct defined in sys/types.h on macOS hosts conflicts with the one defined in file2alias, resulting in the typedef redefinition error below. To resolve this conflict, define the _UUID_T and __GETHOSTUUID_ in file2alias HOSTCFLAGS. Error: HOSTCC scripts/mod/file2alias.o scripts/mod/file2alias.c:45:3: error: typedef redefinition with different types ('struct uuid_t' vs '__darwin_uuid_t' (aka 'unsigned char[16]')) 45 | } uuid_t; | ^ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ sys/_types/_uuid_t.h:31:25: note: previous definition is here 31 | typedef __darwin_uuid_t uuid_t; | ^ scripts/mod/file2alias.c:1354:7: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1354 | uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1354:19: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1354 | uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1354:31: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1354 | uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1354:43: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1354 | uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1354:55: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1354 | uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1355:7: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1355 | uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1355:19: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1355 | uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1355:31: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1355 | uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1355:43: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1355 | uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1355:55: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1355 | uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1356:7: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1356 | uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1356:20: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1356 | uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1356:33: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1356 | uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1356:46: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1356 | uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1356:59: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1356 | uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ scripts/mod/file2alias.c:1357:7: error: member reference base type 'typeof (((struct tee_client_device_id *)0)->uuid)' (aka 'unsigned char[16]') is not a structure or union 1357 | uuid->b[15]); | ~~~~^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/ secure/_stdio.h:47:56: note: expanded from macro 'sprintf' 47 | __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) | ^~~~~~~~~~~ 17 errors generated. Suggested-by: Nicolas Schier Signed-off-by: Daniel Gomez --- scripts/mod/Makefile | 2 ++ scripts/mod/file2alias.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index c729bc936bae..75c12c045f21 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -8,6 +8,8 @@ modpost-objs := modpost.o file2alias.o sumversion.o symsearch.o devicetable-offsets-file := devicetable-offsets.h +HOSTCFLAGS_file2alias.o += -D_UUID_T -D__GETHOSTUUID_H + $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE $(call filechk,offsets,__DEVICETABLE_OFFSETS_H__) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 99dce93a4188..ab743f6d60ef 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -11,6 +11,9 @@ */ #include "modpost.h" +#ifdef __APPLE__ +#define uuid_t sys_uuid_t +#endif #include "devicetable-offsets.h" /* We use the ELF typedefs for kernel_ulong_t but bite the bullet and From patchwork Fri Sep 6 11:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793949 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9A311CBE83; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; cv=none; b=INnRUU5XIr9yXyU4bxz04xFaZ67nhN8XeOvmn7Okw5PaTaI5tmJ0SW9XSKkO53d2IIvDsypdIpbT59O/+8MmSPVYLBWRatKa7fPeJadAjJF1TqlAcFrZxvTzgsXZVlIBNmSd6Wqcfsb+ZbplJA7zwXP0Ffplh9Hx8gwiP3Pv524= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; c=relaxed/simple; bh=c3x0bnHapZyCsRyRYyC+LIZeB+J3ImlDAXTdLaX80xs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tj+DNr+dJoezLT0glcqvtW5rqHppOnNLYiDWnOz7pngLnb5ehxP+2zbxvFZ11buqMuOvYHDMrrYB4tb3t702ySFQCO3Gdfkm3d27Z/0tfjT14sNekc2QnIlqXT6Tuo7B1/a0As9OvRbve3lWx9IqKrN2q9vj7UrrQMTM+1k3PoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=btJcAfy2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="btJcAfy2" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3DFD2C4CED7; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=c3x0bnHapZyCsRyRYyC+LIZeB+J3ImlDAXTdLaX80xs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=btJcAfy2qgqbbzAjf01oYt2H2oCyEH+vlSb9AqgkhlNPrxpmns232Sx4cuPfLwwjM hHbkAWRN13hCR7wXpO++PMYCsV5cAmp2hKrfplof8dSKh7FoKXzAG6WWDLti13Vfcz rmWqzNmPtFb7k3trfzp+b4JT4aoeWBJOSQ3Z5fM1b6PgHfTOLg5kT+IyYSup1Z4UgI uqKbdZwzV7o66NMqvBqHKW0NBqoXm1QoY7dHM4kzkuhX1aPkGPoSjT6F7dHGu+wOUT 87PrKn1vC+Hq2JXEgbfPHChyYNK3Z19nJuPDZVUGAo4mBzIo6ScQ+HRTPA3L0AkgNQ N6bYnBjieudmQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35CA2CE7AFB; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:30 +0200 Subject: [PATCH v2 3/8] drm/xe: xe_gen_wa_oob: fix program_invocation_short_name for macos Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-3-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=1428; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=x6LVlKYatdZUIjJiYp2s+9CbUoAxRcL8dRJGWqQIBj4=; b=BH4HpeG8hB04KMzAeLGkcCFK3N10hMq/U4+Vzh7fajdBsdql7CZEFfKmy7OI6MFwP2a4PKqq6 h6W1X3yzs24B7Hn3G4bxlap2pj1Vdv/+pm0/KH5H8aSiskiYjxDyb27 X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Daniel Gomez Use getprogname() [1] instead of program_invocation_short_name() [2] for macOS hosts. [1]: https://www.gnu.org/software/gnulib/manual/html_node/ program_005finvocation_005fshort_005fname.html [2]: https://developer.apple.com/library/archive/documentation/System/ Conceptual/ManPages_iPhoneOS/man3/getprogname.3.html Fixes build error for macOS hosts: drivers/gpu/drm/xe/xe_gen_wa_oob.c:34:3: error: use of undeclared identifier 'program_invocation_short_name' 34 | program_invocation_short_name); | ^ 1 error generated. Signed-off-by: Daniel Gomez Reviewed-by: Lucas De Marchi --- drivers/gpu/drm/xe/xe_gen_wa_oob.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_gen_wa_oob.c b/drivers/gpu/drm/xe/xe_gen_wa_oob.c index 904cf47925aa..0d933644d8a0 100644 --- a/drivers/gpu/drm/xe/xe_gen_wa_oob.c +++ b/drivers/gpu/drm/xe/xe_gen_wa_oob.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #define HEADER \ @@ -30,6 +31,9 @@ static void print_usage(FILE *f) { +#ifdef __APPLE__ + const char *program_invocation_short_name = getprogname(); +#endif fprintf(f, "usage: %s \n", program_invocation_short_name); } From patchwork Fri Sep 6 11:01:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793950 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9AA51CC161; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; cv=none; b=qIwAi/HvNQCCm/VEH1xZeWcm0udZngfioo8NOq9alH76h5uQ5OMXXevPA92kLfRVK8BawMPyGDXFO3txkE6Tx729xvaAsFiLiOs2zN69by2QFauwqQ/PCaJF6WdWjdgIrh39d6R9D8Td0BgCQZ2q/sMtW+PA2GPY3lKvNgye31M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620500; c=relaxed/simple; bh=vOiGFucJK70rIWW7jwgBqnvMavVEpTpGsxAOe6Ix7ug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E+6Nr8IZYk+0eyz5XKlDNlcRoK5JogDcYX0/B9hB1myVplfkQpcgpvmeF/VzNjSSHeKwxT9/rtEWeRj80YM5tDAjJ6GkxNp+B0V/BEZ0VUiS86zA5uBxVIqlHaUBLoSb8pny7II13VBBxaTRoLQ+V0v3Cznw7yB1JHw07rS3ZlU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AeYQsJSD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AeYQsJSD" Received: by smtp.kernel.org (Postfix) with ESMTPS id 56DCCC4CEDA; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=vOiGFucJK70rIWW7jwgBqnvMavVEpTpGsxAOe6Ix7ug=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AeYQsJSDslgwwy0twNQXWpDjaGTpp6dSXTbqc4PSS8oEMXhZUwyuU5P1thrfALpvg /gpHxMFRIydlOV0a/Id9XRuKtStDguG0qznRiF88vdEwec+Dov+06urJWJCvRoLPgJ fAqJzNr4oAnCc5ytHPPn5/V15Wetmoj5KGiolSoOULFG54ENSuFKFu6Cxxj76EYp3N 1x0kiMwA0Ueq3kFBZBdtaqGc25x5gJq7JyEn7apsLh8fSF+5hhl94NYfBwTFMtYKZw 7dWo4ZHNTYJQ++Xhd9em8x9RczO5wetumMBvHu+fv6opHE0Rlk/ZYuRn9QL/qZ7/EK nwonYs6t8SPFw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 478A0CD5BDD; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:31 +0200 Subject: [PATCH v2 4/8] arm64: nvhe: add bee-headers support Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-4-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=2402; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=GBZv2DjLBaUWb0PDIN6CGSbBXyjcjj4bMncdBaf72Bg=; b=yNvjUITe4cvXufxVrbYIve+SAb1jzGrq0iUGR/YAun7lLTKIwhk8EC7uDEMgN45dqdtRk38Jy pDk3TLY/uhoBnN1Zcnbu2S82L1cVlw0uRFYjv554A/iIpET4qlSs/in X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Daniel Gomez endian.h header is not provided by default in macOS. Use pkg-config with the new development package 'bee-headers' [1] to find the path where the headers are installed. [1] Bee Headers Project links: https://github.com/bee-headers/headers https://github.com/bee-headers/homebrew-bee-headers It requires to install bee-headers Homebrew Tap: brew tap bee-headers/bee-headers brew install bee-headers/bee-headers/bee-headers Signed-off-by: Daniel Gomez --- arch/arm64/kernel/pi/Makefile | 1 + arch/arm64/kernel/vdso32/Makefile | 1 + arch/arm64/kvm/hyp/nvhe/Makefile | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile index 4d11a8c29181..259c9a45fba0 100644 --- a/arch/arm64/kernel/pi/Makefile +++ b/arch/arm64/kernel/pi/Makefile @@ -20,6 +20,7 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS)) KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS)) hostprogs := relacheck +HOSTCFLAGS_relacheck.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) quiet_cmd_piobjcopy = $(quiet_cmd_objcopy) cmd_piobjcopy = $(cmd_objcopy) && $(obj)/relacheck $(@) $(<) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 25a2cb6317f3..6cb8a04bd829 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -107,6 +107,7 @@ VDSO_LDFLAGS += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL) # $(hostprogs) with $(obj) munge := ../../../arm/vdso/vdsomunge hostprogs := $(munge) +HOSTCFLAGS_$(munge).o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) c-obj-vdso := note.o c-obj-vdso-gettimeofday := vgettimeofday.o diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index b43426a493df..d20a440b6964 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -15,7 +15,8 @@ ccflags-y += -fno-stack-protector \ $(DISABLE_STACKLEAK_PLUGIN) hostprogs := gen-hyprel -HOST_EXTRACFLAGS += -I$(objtree)/include +HOST_EXTRACFLAGS += -I$(objtree)/include \ + $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) lib-objs := clear_page.o copy_page.o memcpy.o memset.o lib-objs := $(addprefix ../../../lib/, $(lib-objs)) From patchwork Fri Sep 6 11:01:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793951 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E32531CC8B7; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; cv=none; b=BOQ5TRJRZxGG+Q1guW2J1c/uUaytfH4lJJFereYq1eRCW6O/b0O/HSUm0PqV2jZM7JceXlOX3aHWN/AKhIrUBc2s125gs4WOyjmOWuGt65Nhole52qQ/wfOCsYmRDaSOYS+HvsCo+ObA2xLVfRokqdMV+ZivprJoLJvktpDhhZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; c=relaxed/simple; bh=j5NLnKfLikKaiGUo55GPDDGSIhsaNwRaLqF2L4zGDA4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MYw06OrS9uXW6ehxLFW4qHdT+kEEfuSFe9shsR2pFJp8ykek1ns9IxzdgWZ3CIiKrrbT1bIj/aPhL8P15wwT+v/2hkjK6waJA52bLL1Es1x8JO0yTEB9CmYMtt9lbaU/DdNjAI1b8X+7qET1gLxPXdsKCZ76EbYBrBkNQaINf0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ofC2lUFC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ofC2lUFC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 77582C4CEC9; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=j5NLnKfLikKaiGUo55GPDDGSIhsaNwRaLqF2L4zGDA4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ofC2lUFCD8SQtLyfB7aJIjTwQ6ja5bwved9nuqgSpT79j5V0G6XUrEwhu9truM66F nqsbT/i3hFYZhqoMi3e/ySHl7QjU4/8urc4JGoihR/NDAnDCAr2mnW3AlcSONXITaT +SOHHjXgj29mc5xaoOWm7MH2yyFX1yl/xKfduJHln0pDPsCu7Gd4o+dAq/WJlRLKC3 b2I4DBReFYcqVAbG/EmPRM/SPLKpS5cBcUQx5L3KbnNuj/PQbLcsMFtT/ZBdKGbH5M L60B/guW873cfc6OHQU9pheA9ancfcDt6wu5AOju/SSMVxX64YAe2lOdrKvNvKcLSX UQSmNNUI50XPw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CDF6CE7AFB; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:32 +0200 Subject: [PATCH v2 5/8] scripts: add bee-headers support Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-5-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=2346; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=rO0S7maRhdJSc9tMl+lVEiGJtiOKRJnj+HrU4cPgHCc=; b=al9Ec0NojpTaSaRwAcb8OIVZLwyagRzcfEeZfqwPN8DMD52+Ne1gNpwPCnObnF9pgxs9wkUwP NXqHeNxIaZfBHXqgwlwsU3AuElhprb0HUA+oNzt4mxAdkffpup52ZyT X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Daniel Gomez endian.h header is not provided by default in macOS. Use pkg-config with the new development package 'bee-headers' [1] to find the path where the headers are installed. [1] Bee Headers Project links: https://github.com/bee-headers/headers https://github.com/bee-headers/homebrew-bee-headers It requires to install bee-headers Homebrew Tap: brew tap bee-headers/bee-headers brew install bee-headers/bee-headers/bee-headers Signed-off-by: Daniel Gomez --- scripts/Makefile | 4 +++- scripts/mod/Makefile | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile b/scripts/Makefile index 6bcda4b9d054..40f6a9159f8c 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -25,8 +25,10 @@ generate_rust_target-rust := y rustdoc_test_builder-rust := y rustdoc_test_gen-rust := y -HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include +HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include \ + $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) HOSTLDLIBS_sorttable = -lpthread +HOSTCFLAGS_insert-sys-cert.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include HOSTCFLAGS_sign-file.o = $(shell $(HOSTPKG_CONFIG) --cflags libcrypto 2> /dev/null) HOSTLDLIBS_sign-file = $(shell $(HOSTPKG_CONFIG) --libs libcrypto 2> /dev/null || echo -lcrypto) diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 75c12c045f21..33bb032039ba 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -9,6 +9,11 @@ modpost-objs := modpost.o file2alias.o sumversion.o symsearch.o devicetable-offsets-file := devicetable-offsets.h HOSTCFLAGS_file2alias.o += -D_UUID_T -D__GETHOSTUUID_H +HOSTCFLAGS_modpost.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) +HOSTCFLAGS_file2alias.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) +HOSTCFLAGS_sumversion.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) +HOSTCFLAGS_symsearch.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) +HOSTCFLAGS_mk_elfconfig.o = $(shell $(HOSTPKG_CONFIG) --cflags bee-headers 2> /dev/null) $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE $(call filechk,offsets,__DEVICETABLE_OFFSETS_H__) From patchwork Fri Sep 6 11:01:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793953 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02C7A1CCB31; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; cv=none; b=FFv8KGpFSvRBiyqrP7GmlZ6TszjUJY/YqdHiECQoqAc10/+i/MQsFB6cMneeQOa3baimiBz1pS3iYnvS09I2ZgXaOrjgIreRxgOsKTNm94sqfAhcJWL0lZWP29S6JrsTdAxD4RDwK+j4iBzezCUZ6ZhOiKtF8n0Cp/qKauHQKco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; c=relaxed/simple; bh=mcmfV+bue318YAhiGr6TbJ/6kZY45+peznS5vEAxkuQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kvdl0W4HVZ7FAZacox67wIlRlsyTizrZ2ysvyPotAV7cRl9mK3f9IggR1QmpC3RpogPBFEw4KXPfAqqnkvBILLQZjHnaXplowdWvM0f1TddrjQ1/mL1ncCehniqv8P5ChI9Nogl2y6Pfy65Pxz7eFN7Fma4Rz2g4Gu/lSorHXxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tLKc8QZC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tLKc8QZC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 96CEDC4CEDC; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=mcmfV+bue318YAhiGr6TbJ/6kZY45+peznS5vEAxkuQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tLKc8QZCwoRCRAxn0U00JbT9WGc4rsZhsU2wHJjf8Im+v1UsyPUMHV2QI5dSIqqNI uNKPKwscEE20/d4SR6zWSXCqoiP/2hdLCpU1dHNqrDfzvzACA6OVN/xRHeX6L2E8cl hPZeIOK/y4MBKiN9/pn7OjhJCFVYCF4f5hbXWmO4TFvhktiSsaKYPqt7YfSg0Udryu IlD+FbLRQYsn3OQkd/tY8jX8DflyA70A3m84GgWlib8dX1MGRC1B0a/yQfZjUGP8Vz YFt308FmGM9q8ZSUSELAwKOhncrz1T5ruyEZ0nO4HyAllZdlDgOm6Z3bEV1J/tIDVT Tlh3JZ5MaDa0g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86008CE7B00; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:33 +0200 Subject: [PATCH v2 6/8] selinux: do not include headers from host programs Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-6-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=5564; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=RWFmHaQGmYDEzsOarge6k0aJ15scCJOPQC2IOBiil4U=; b=VoY8M4eX15rBfo1jaRrsV1vsZSumMCAVAjs+tpXO/29zqWL0w803725aHyGd0/FesBCmsyQkE pTyc4ai3R+lASS2ZgiReZQMsynGmm/16kMoFWRNqKgAjGUDOpOqYQPK X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Masahiro Yamada Commit bfc5e3a6af39 ("selinux: use the kernel headers when building scripts/selinux") is not the right thing to do. It is clear from the warning in include/uapi/linux/types.h: #ifndef __EXPORTED_HEADERS__ #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" #endif /* __EXPORTED_HEADERS__ */ If you are inclined to define __EXPORTED_HEADERS__, you are likely doing wrong. Adding the comment: /* NOTE: we really do want to use the kernel headers here */ does not justify the hack in any way. Currently, headers are included for the following purposes: - is included to check CAP_LAST_CAP - in included to check PF_MAX We can skip these checks when building host programs, as they will be eventually tested when building the kernel space. I got rid of from initial_sid_to_string.h because it is likely that NULL is already defined. If you insist on making it self-contained, you can add the following: #ifdef __KERNEL__ #include #else #include #endif scripts/selinux/mdp/mdp.c still includes , which is also discouraged and should be fixed by a follow-up refactoring. Signed-off-by: Masahiro Yamada --- scripts/selinux/genheaders/Makefile | 4 +--- scripts/selinux/genheaders/genheaders.c | 3 --- scripts/selinux/mdp/Makefile | 2 +- scripts/selinux/mdp/mdp.c | 4 ---- security/selinux/include/classmap.h | 19 ++++++++++++------- security/selinux/include/initial_sid_to_string.h | 2 -- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile index 1faf7f07e8db..866f60e78882 100644 --- a/scripts/selinux/genheaders/Makefile +++ b/scripts/selinux/genheaders/Makefile @@ -1,5 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 hostprogs-always-y += genheaders -HOST_EXTRACFLAGS += \ - -I$(srctree)/include/uapi -I$(srctree)/include \ - -I$(srctree)/security/selinux/include +HOST_EXTRACFLAGS += -I$(srctree)/security/selinux/include diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c index 15520806889e..3834d7eb0af6 100644 --- a/scripts/selinux/genheaders/genheaders.c +++ b/scripts/selinux/genheaders/genheaders.c @@ -1,8 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* NOTE: we really do want to use the kernel headers here */ -#define __EXPORTED_HEADERS__ - #include #include #include diff --git a/scripts/selinux/mdp/Makefile b/scripts/selinux/mdp/Makefile index d61058ddd15c..673782e3212f 100644 --- a/scripts/selinux/mdp/Makefile +++ b/scripts/selinux/mdp/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 hostprogs-always-y += mdp HOST_EXTRACFLAGS += \ - -I$(srctree)/include/uapi -I$(srctree)/include \ + -I$(srctree)/include \ -I$(srctree)/security/selinux/include -I$(objtree)/include clean-files := policy.* file_contexts diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c index 1415604c3d24..52365921c043 100644 --- a/scripts/selinux/mdp/mdp.c +++ b/scripts/selinux/mdp/mdp.c @@ -11,10 +11,6 @@ * Authors: Serge E. Hallyn */ - -/* NOTE: we really do want to use the kernel headers here */ -#define __EXPORTED_HEADERS__ - #include #include #include diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h index 7229c9bf6c27..518209e1beb0 100644 --- a/security/selinux/include/classmap.h +++ b/security/selinux/include/classmap.h @@ -1,8 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#include -#include - #define COMMON_FILE_SOCK_PERMS \ "ioctl", "read", "write", "create", "getattr", "setattr", "lock", \ "relabelfrom", "relabelto", "append", "map" @@ -36,10 +33,6 @@ "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend", \ "audit_read", "perfmon", "bpf", "checkpoint_restore" -#if CAP_LAST_CAP > CAP_CHECKPOINT_RESTORE -#error New capability defined, please update COMMON_CAP2_PERMS. -#endif - /* * Note: The name for any socket class should be suffixed by "socket", * and doesn't contain more than one substr of "socket". @@ -181,6 +174,18 @@ const struct security_class_mapping secclass_map[] = { { NULL } }; +#ifdef __KERNEL__ /* avoid this check when building host programs */ + +#include + +#if CAP_LAST_CAP > CAP_CHECKPOINT_RESTORE +#error New capability defined, please update COMMON_CAP2_PERMS. +#endif + +#include + #if PF_MAX > 46 #error New address family defined, please update secclass_map. #endif + +#endif /* __KERNEL__ */ diff --git a/security/selinux/include/initial_sid_to_string.h b/security/selinux/include/initial_sid_to_string.h index 99b353b2abb4..f683a78b21fd 100644 --- a/security/selinux/include/initial_sid_to_string.h +++ b/security/selinux/include/initial_sid_to_string.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#include - static const char *const initial_sid_to_string[] = { NULL, /* zero placeholder, not used */ "kernel", /* kernel / SECINITSID_KERNEL */ From patchwork Fri Sep 6 11:01:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793952 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0179A1CCB2E; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; cv=none; b=e0GDT4ei/pPsaSQlwlslkDNDKXs7vIEdivM35f1GHqLqHtNoUkG+njiJe2vsp2cNSpM1jN3J3qxuY410JjHbLipKQSC661iquZ0m1ihQb3rSEKkPCk9sUjPfuzNkBe0pGPtIo9l4Unbpa08EQy7m5b3M8QA3Lhe1jPRyVgZ7d7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; c=relaxed/simple; bh=k/ostPjBb2RaOLOfrnDMYA2N54/QZE16AA/TWFsbio4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c8z6SmNKVWF9Met1DQA6vn9lvSaBZd1MTug1m3Lf6j/Whe8VYHBMJ4VYVHoUkPszZqhzF1r6mqTbfwpY4pCQD9sDpt9jINk1jX6FOT7CU3AsQ7jUtl9VUxo9Hw6B3ZsD0XIzG9OJVU9fJb4GmsSXXtSYlI6CCXNfcLfua32JdFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nxG8/z3/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nxG8/z3/" Received: by smtp.kernel.org (Postfix) with ESMTPS id AA70EC4CEC8; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=k/ostPjBb2RaOLOfrnDMYA2N54/QZE16AA/TWFsbio4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nxG8/z3/5I8z1C8Wzy1qACh38gwMf7IXF0thhrk3iBgh4ZrzM5KoJdkhMSSGQf4sM sgzlS6SuCOXT6CbUjOsUFBZPj3eTZGa5+wicqdlK1tUL8tV2HocJp52aVK2EkcoUls f2fvs65iKksdw3TIzhU5gep70ltRpsrh8QPcpEV+/qvuQebqtdBGAATk+YjIKYlPHh aYA8G0yNEGNBzYWhzc2/Q2y0EdRLNJQ/KVT3XJ+SC8TsteShmp2v6ywigmXAoBYStb KoFz2eLqNaN9jpjt9RrlVNMniNwNPjikbq3nRLYwhpOeg6mthscmFySsV8B4YJCnwE cQYFf4ywkOduA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1A76CD5BDD; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:34 +0200 Subject: [PATCH v2 7/8] selinux: move genheaders to security/selinux/ Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-7-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=3373; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=g4JOSV4HqHDizgdp1dK7R63MzB9RpJwV09N6flHpMq4=; b=oOIBFyDWmIhzLNfk0f2h+dEpxGUEWkknDwR03lHNhX0SplfqCIavTEk26syHTsKXggxUTu0MI IQEl+ez/e6oBBpwWqLDY6C6/4Av2j0+dPziED7wGl02bPV2Os+pMbRe X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Masahiro Yamada This tool is only used in security/selinux/Makefile. There is no reason to keep it under scripts/. Signed-off-by: Masahiro Yamada --- scripts/remove-stale-files | 3 +++ scripts/selinux/Makefile | 2 +- scripts/selinux/genheaders/.gitignore | 2 -- scripts/selinux/genheaders/Makefile | 3 --- security/selinux/.gitignore | 1 + security/selinux/Makefile | 7 +++++-- {scripts/selinux/genheaders => security/selinux}/genheaders.c | 0 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files index 8fc55a749ccc..6e39fa8540df 100755 --- a/scripts/remove-stale-files +++ b/scripts/remove-stale-files @@ -20,6 +20,9 @@ set -e # yard. Stale files stay in this file for a while (for some release cycles?), # then will be really dead and removed from the code base entirely. +# moved to security/selinux/genheaders +rm -f scripts/selinux/genheaders/genheaders + rm -f *.spec rm -f lib/test_fortify.log diff --git a/scripts/selinux/Makefile b/scripts/selinux/Makefile index 59494e14989b..4b1308fa5732 100644 --- a/scripts/selinux/Makefile +++ b/scripts/selinux/Makefile @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -subdir-y := mdp genheaders +subdir-y := mdp diff --git a/scripts/selinux/genheaders/.gitignore b/scripts/selinux/genheaders/.gitignore deleted file mode 100644 index 5fcadd307908..000000000000 --- a/scripts/selinux/genheaders/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -genheaders diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile deleted file mode 100644 index 866f60e78882..000000000000 --- a/scripts/selinux/genheaders/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -hostprogs-always-y += genheaders -HOST_EXTRACFLAGS += -I$(srctree)/security/selinux/include diff --git a/security/selinux/.gitignore b/security/selinux/.gitignore index 168fae13ca5a..01c0df8ab009 100644 --- a/security/selinux/.gitignore +++ b/security/selinux/.gitignore @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only av_permissions.h flask.h +/genheaders diff --git a/security/selinux/Makefile b/security/selinux/Makefile index c47519ed8156..86f0575f670d 100644 --- a/security/selinux/Makefile +++ b/security/selinux/Makefile @@ -36,7 +36,10 @@ quiet_cmd_genhdrs = GEN $(addprefix $(obj)/,$(genhdrs)) # see the note above, replace the $targets and 'flask.h' rule with the lines # below: # targets += $(genhdrs) -# $(addprefix $(obj)/,$(genhdrs)) &: scripts/selinux/... +# $(addprefix $(obj)/,$(genhdrs)) &: $(obj)/genheaders FORCE targets += flask.h -$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE +$(obj)/flask.h: $(obj)/genheaders FORCE $(call if_changed,genhdrs) + +hostprogs := genheaders +HOST_EXTRACFLAGS += -I$(srctree)/security/selinux/include diff --git a/scripts/selinux/genheaders/genheaders.c b/security/selinux/genheaders.c similarity index 100% rename from scripts/selinux/genheaders/genheaders.c rename to security/selinux/genheaders.c From patchwork Fri Sep 6 11:01:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez via B4 Relay X-Patchwork-Id: 13793954 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B09A1CCB5E; Fri, 6 Sep 2024 11:01:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; cv=none; b=AnThNKbmY2MJcrgrqoPlB7CHWAHy9ONry6PKc1HJZ/4FNAfD5n8gVICXniScFINfz61EWQQDWApoIO8O7qTGGP9sWA5ia8OfdYjx5JjbnUdE8eiI8aX7TRWu7zhJaCsGRmLy0QuGKiAQVDxJ57i1iTPmG5jLkfhK1KpcSb9aJcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725620501; c=relaxed/simple; bh=XLEFleBi1dpezrCN0L236rCr8UnL4qKgiVJMT/gVdZo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eMhrQSaTB0jFeYYTuSy+gyqaabeStpcSeXhmnegQ/YWr2nKks6E+p+FqzaqBl42a8MbQTvhbZBybomsva5mwuS/An55tN26gmprseN2+bCu5zxllR9qkslIILGCYQJfnI6ssP33ca+gWtTN3KHEVqgv1ixRSKXyYlheCLSsKVSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MRCQHnm7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MRCQHnm7" Received: by smtp.kernel.org (Postfix) with ESMTPS id C72E0C4AF55; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725620500; bh=XLEFleBi1dpezrCN0L236rCr8UnL4qKgiVJMT/gVdZo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MRCQHnm7DALEbPuviJjS6zZwzYuQkJA9x6div0Fqn6MZQ06mWVihWBozJsiUvGcAc bJR6fiu5HZGRuaPcnQFN1Genvd4fYchjFtcLVcT23784VO+uuEQRHSxBO8fDEBnhHa RtINq3H7JdCCsRq12zSOhLMcz03TSXWgNcf/eqBmlmVUYzaKGBFIks6ZbLh2hADNAK cs6fBUh/DRTcvIwpUpNC0qgp0hKNjsyVf276mku+BTTSmdHMdImMz5MqqH2VlWkXWF KN9Rw33I1rINwOweAvT5vZKBA1rJiD1bAr2c5/O7k5JHtpE474mXigAC3KJkRU30W8 ouI72lr0Is0kw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBCBDCE7B00; Fri, 6 Sep 2024 11:01:40 +0000 (UTC) From: Daniel Gomez via B4 Relay Date: Fri, 06 Sep 2024 13:01:35 +0200 Subject: [PATCH v2 8/8] Documentation: add howto build in macos Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240906-macos-build-support-v2-8-06beff418848@samsung.com> References: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> In-Reply-To: <20240906-macos-build-support-v2-0-06beff418848@samsung.com> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6?= =?utf-8?q?m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , Paul Moore , Stephen Smalley , Ondrej Mosnacek , Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Greg Kroah-Hartman , Jiri Slaby , Nick Desaulniers , Bill Wendling , Justin Stitt , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, speakup@linux-speakup.org, selinux@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-serial@vger.kernel.org, llvm@lists.linux.dev, Finn Behrens , "Daniel Gomez (Samsung)" , gost.dev@samsung.com, Daniel Gomez X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725620498; l=3295; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=d0Jf83ehBVzZd/6sDJAXa3klyzghUuKXMDUak+RyqVk=; b=HHVXUAKYpwg0oAq4Llj7Qicr7YTY8yOi8z/Ymdnnl/W0ykKZJbrrJ5EOU8LrjlVkcwlA+JR2O 50rFNWri/6gCAgythyvckdtJX73zV3YaMq3ZWFUY7eZPAc4+9wznTjX X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-Endpoint-Received: by B4 Relay for da.gomez@samsung.com/20240621 with auth_id=175 X-Original-From: Daniel Gomez Reply-To: da.gomez@samsung.com From: Daniel Gomez Add documentation under kbuild/llvm to inform about the experimental support for building the Linux kernel in macOS hosts environments. Signed-off-by: Daniel Gomez --- Documentation/kbuild/llvm.rst | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst index 6dc66b4f31a7..de3bde925793 100644 --- a/Documentation/kbuild/llvm.rst +++ b/Documentation/kbuild/llvm.rst @@ -186,6 +186,84 @@ yet. Bug reports are always welcome at the issue tracker below! - Supported - ``LLVM=1`` +Experimental Build in macOS +--------------------------- + +Building on macOS with LLVM is experimental. This section provides steps to +install dependencies via Homebrew, set up the environment, and start the build +process. + +1. **Create a Case-Sensitive Volume** + + For fetching and building the project, you need a case-sensitive volume. Use the following + command to create one: + + .. code-block:: shell + + diskutil apfs addVolume /dev/disk "Case-sensitive APFS" linux + + Replace `/dev/disk` with the appropriate disk identifier. + +2. **Install Build Dependencies** + +Use Homebrew to install the required build dependencies. + +- **Core Utilities**: `coreutils`, `findutils`, `gnu-sed`, `gnu-tar`, `grep`, + `llvm`, `make`, and `pkg-config`. + + .. code-block:: shell + + brew install coreutils findutils gnu-sed gnu-tar grep llvm make pkg-config + +- **Bee Headers**: Install byteswap, elf and endian headers using the + `Bee Headers Project `_. + + .. code-block:: shell + + brew tap bee-headers/bee-headers + brew install bee-headers/bee-headers/bee-headers + + After installation, verify the `CFLAGS` with `pkg-config`: + + .. code-block:: shell + + pkg-config --cflags bee-headers + -I/opt/homebrew/Cellar/bee-headers/0.1/include + +3. **Configure the PATH** + + Include all the required GNU tools and LLVM in your `PATH`. This ensures that + the necessary tools are available during the build process. + + .. code-block:: shell + + PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" + PATH="/opt/homebrew/opt/llvm/bin:$PATH" + +Building the Project +-------------------- + +Once the environment is set up, you can start the build process using LLVM. Run +the following commands to initiate the build: + +.. code-block:: shell + + make LLVM=1 allyesconfig + make LLVM=1 -j$(nproc) + +Supported in macOS +~~~~~~~~~~~~~~~~~~ + +At the moment, only arm64 is supported and tested with `allyesconfig` Makefile +configuration target. Other Kconfig options not included in `allyesconfig` +target and architectures may be supported as well as support in macOS is based +on LLVM effort and maintenance. + Getting Help ------------