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: 13793965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D224ECE7B00 for ; Fri, 6 Sep 2024 11:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=boZyOru5SQh2PbzgwYIayw2gzZZ0HPoBLSuDkzVIXJQ=; b=e++2BllFVKLTEwT1INuqVH9CfR giOSZK5LKyuEJGPkSVk7yEP9EwoXuYvtcVTLmfqcOma1TxEmhN6/IMNmwF57+xFoe4QJ8XJuoMCb8 pxWTNzZn+l7YnfrMortT2/bsDw6ZAH2v2p4qQRrSr5mKlnQcmHMAQhDFvtVYSd2oIvMERg4rCtszq wIsxFEjyxhJvCXM6HZBLR81cY3+0O92Fsixuv30nz6jE4YJU0TMlQtTFjuJ4xqhRHeH3b7YSmm4/Z O1CKh2JApksL/KgZ/zODW3eiaGU2p6Oy9vAUx/T56ym+UwD3O5wF9S3mFEnzStVcnA7RgVIfU99jO DzIJravA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWnY-0000000BtZK-3SuD; Fri, 06 Sep 2024 11:06:40 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWik-0000000BsKc-1lxX for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9E2FDA44EAF; Fri, 6 Sep 2024 11:01:33 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040142_804057_14721BA8 X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D241ACD5BDD for ; Fri, 6 Sep 2024 11:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RghH+q17mPc+tqFBYpm1Up82FACfMTKNgiSazK4QHxI=; b=D/JSbFDtjQrnRHZ5m/zDW8RwgU hq8yrkX0wi0RpiyIuC/87VWW/QWPYYOsqWXC6VYdQgB1hyJBhbBXZrEVcJA6708ErjqeIZ2Nl4zrr 1LfZzvQMxs1S2oK/81EE/eo2We9OyLKkQoNjJTNSDmxBPRjNmyYinLqPsNGJvNE6LHgXlCy8DGEjX nsYjpw+4YNwsQYQ+TCv0RErQgmzNU4mp5oTlEDJF9OfPpeQ5n26Fmpp45GJfSsT/dSBRh8E0bn9bB Cnl0VxzmyK9x3M8AjKl0ZJ3sMRtKNRmZJkuKJPIhCYct/4hRCgyRk2B0+Ax8FI1Ns/jVwIYKtVEog 3TqNX/JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWoU-0000000Bth7-41Gp; Fri, 06 Sep 2024 11:07:38 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWik-0000000BsKQ-1xD2 for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:45 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 757185C5AC8; Fri, 6 Sep 2024 11:01:37 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040142_724558_3219CEA3 X-CRM114-Status: UNSURE ( 9.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E229CD5BDD for ; Fri, 6 Sep 2024 11:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t6Q07kVWRT9p6T2oJqDpdvSAbCV57vJ+s026+RqZa3A=; b=AuccWzcN3c55/zq//sR5u/+3dw NH7GlK3hOlBJATH6SufAeOwxqvcNf+ECnZKgfo9h7ugUpqIp6QJvYXzTRwFTsm2ZfDHrt7e80pgiS b+BN0tiKBeefjsL1eHvTXN7SYVWwJ3IeMNkpmgS7O+CD44haDbNBBZT2LY0me5q3yexxUbg+Ut6a+ dCYp8H7ml6syIlD0q5geNa2zJRiKgFRQLP0x9wGDIj/RX0FSoNQzrSxvgho5GRQAcvLX+IGbWPQE+ RIRb1KUMWEI1xrLrE4Sh7187z5/h9LZmLqBY7Xno7s6pe1VDf121S0wRMTDL5SVI/KbjVkTQrxz43 TRv+e90Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWsN-0000000BuZB-2za0; Fri, 06 Sep 2024 11:11:39 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsKZ-2U1b for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 924465C5A48; Fri, 6 Sep 2024 11:01:37 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_816145_D0DDB757 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6A8ACD5BDD for ; Fri, 6 Sep 2024 11:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A7ttT1Cd1XDmP1bJzjYa0sHr8J3anQVnOcPo3CintkE=; b=BUstLbIVcy6KEggC9g14OM2uai iWhZKsCPKLilFQ1ydLXcJZFt6HzZsn9oPGluMVYj+EgieGNOt6W6YfpYBA70pZMLnuvDlL2HImwre F8T6M2uJPnr/GLQoLlrLBDyGREqliBjW7vCx/iAulZOJFZso4UOEB7UUCnaN8oefSE8fxmp3MpXki JeVvveMjLn81flbAgEkG8rOHRcboqr7OH9RisvT+unEiUx7srYGMg0iQ560p9RGuzm8o0+1YR+gTt sWlXtpX9DDHuYgs7Bq6yFrrykPgFGwMrMJC6mmhUoyFeVhksB9rnPoS+uxjhukuLArvwA7E76mCgb eD+YQA5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWpV-0000000BtzG-0B9A; Fri, 06 Sep 2024 11:08:41 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWik-0000000BsKd-3P2H for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A59E15C5AE9; Fri, 6 Sep 2024 11:01:37 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_533100_AAAE444F X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18F02CE7B02 for ; Fri, 6 Sep 2024 11:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kex0mguCLAGeGLrrvxQLEK/t58GXBqZ4eyzRp2dRbQk=; b=bZQALeDC1dxj+y+RXwU6rkGjcJ G5D1b2rioTxVqjPZNzviovBik76NSU6OOzhFO/4zrpfh4pFWXrqLOQYnU/Ch6MWxuDIB7RmNrgu0b BYfoV8XF+Y8vVjl2ebtTkLFmkxVHC8/lmqp/F7b5nsktllIJ21n5fF/7ZloK8KEyGebT7v3Ny8W/f ckW1+jmiUJqrGnPBBom5vNYYxS0gbW9UdA3kbPjR+gDwdsv0ZDCZpQ5tDRyx8OMg2z0ZNb5Ue8l43 km1LgsOxt3k28/d2Nfg/19wcRQ2osiLRPcxu7FgCV7TPm5XZy1J8r4/6eMVn0B31+CxXYtPZ0k03m 3kH5fmgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWuG-0000000BuuT-2azY; Fri, 06 Sep 2024 11:13:36 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsLC-11zD for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DCE8E5C5B2C; Fri, 6 Sep 2024 11:01:37 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_549142_D17E732A X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14888CD5BDD for ; Fri, 6 Sep 2024 11:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Iu70miSASxKnrQLREY0Ie6bjs9ClkKuQaDxrbC/gDss=; b=azuYgvwZsQcoggHbnEUkTRQFNf xfsJqASGa6T1sHjTSROXvqGCcOqYoi/7yvKEwDaL80n1vYqPBG03xGB7qKiGhnA24hpr51sxIbycy +IRRpwmecgybRYExZccbOPzQxrJnvK4uDo15bCY9TvyQJoPEKfuGrIRrnIvWhPGextzKfxUNA63BX OAIbN1Lk62zU2Cm2/+oLfhKeLZ6iJVbFB9xq5VqUClEpWqvFhl4oawsGKzufwvpJ5NMul26GJRZ7X NtxEGe5zx+17klJLbx9SpM4/vc/xbNlj367UicXSC9BUozEbc4iBO0nMFGGD34tOVVj3VMcLpVTvc wAGlM+eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWqS-0000000BuDo-38iI; Fri, 06 Sep 2024 11:09:40 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsLE-1bcm for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A8A87A44EB8; Fri, 6 Sep 2024 11:01:34 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_697000_231195A3 X-CRM114-Status: GOOD ( 18.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF09ACD5BDD for ; Fri, 6 Sep 2024 11:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1WLVIXbYtLx+WdThubL/3nS74RwCAW3Yf3CyR5XprcM=; b=IfOUV0AMtNtr9l+H6d1EVggx8Q VPdfVuEmjbq8g8r6xL7w8lWfEvuClsXBH4EVJBf5crMdBt7wabia+bvRO23NFkWGUayFqF70Wx1Zg 2y8H7txPgoqJkettQkzik8FtPSWvHsbpdI48HYyiLerwirXWWi3hG9kqvWVUu6hYnfEH3ZCLfugBz ZsDHkQuVQCsbXM7O0BJJRvXciEv0/E1Dy5dSgzYDUkoibeKCMWc95OlYjVZuvqNY9ul5eC6fQlPF4 YEwmi2UUS9ktdMful7NoQNnK5px+MR0tJRfQNGIxcxRZgZJApC/UF42r+08fdbyYemi79GdeulyWk 5HyGXWDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWtJ-0000000BuhO-0P8w; Fri, 06 Sep 2024 11:12:37 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsLY-3nfA for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F257EA44EBB; Fri, 6 Sep 2024 11:01:34 +0000 (UTC) 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/ 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040144_141952_1E388D04 X-CRM114-Status: GOOD ( 15.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 13793969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F2D0CE7B00 for ; Fri, 6 Sep 2024 11:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JSK1vc159ouMx8jma7FTOywyxuNG3lX2Mt5zNw9qUH0=; b=GRJgPLKyGhqJOF5d4zPlTGgCcV xO/ZIzvuWUDwWe/455mTUcmNYgowmRNOM8AgLgTgjKjdnEje3FSc5wjsyAY2kWky8+mDIJG0bUlx8 lCXthpZcfq1C3kndbFA9upMPuDjrBGUE8MrucXUZtOLJshdLUiGzVgoGhoQMEcmTVjUrUFMcF72+p V8y3NU1MuWY+Dr4uU6Lhq/9G1cgzELCfmWenD0Zp1VDsYCLv9TLjq4uzx4Y3aLe6avST1N2OhNCmx b8EUmtCgLoA7a5JGDgrHrOm4A6rVzM1AODCr0SaiMlm+zhRz8N2QYFaIjor8FLZJ0MMv0ALn1OaA7 /0a5mbLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWrQ-0000000BuRA-0WOk; Fri, 06 Sep 2024 11:10:40 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWil-0000000BsLV-2npY for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:01:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 107BA5C5AA5; Fri, 6 Sep 2024 11:01:38 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_040143_897337_4369A5DB X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: da.gomez@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 ------------