lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMo8BfJtpUY-FC-cwU5HXSqOSwUwn15kTYWOhx-tsgybPe8mpw@mail.gmail.com>
Date:   Thu, 12 Aug 2021 22:32:17 -0700
From:   Max Filippov <jcmvbkbc@...il.com>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Chris Zankel <chris@...kel.net>,
        "open list:TENSILICA XTENSA PORT (xtensa)" 
        <linux-xtensa@...ux-xtensa.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] xtensa: move core-y in arch/xtensa/Makefile to arch/xtensa/Kbuild

On Wed, Aug 11, 2021 at 9:38 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Use obj-y to clean up Makefile.
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
>  arch/xtensa/Kbuild             | 1 +
>  arch/xtensa/Makefile           | 3 ---
>  arch/xtensa/platforms/Makefile | 4 ++++
>  3 files changed, 5 insertions(+), 3 deletions(-)
>  create mode 100644 arch/xtensa/platforms/Makefile
>
> diff --git a/arch/xtensa/Kbuild b/arch/xtensa/Kbuild
> index a4e40e534e6a..fd12f61745ba 100644
> --- a/arch/xtensa/Kbuild
> +++ b/arch/xtensa/Kbuild
> @@ -1 +1,2 @@
>  # SPDX-License-Identifier: GPL-2.0-only
> +obj-y += kernel/ mm/ platforms/ boot/dts/
> diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
> index 093e87b889be..96714ef7c89e 100644
> --- a/arch/xtensa/Makefile
> +++ b/arch/xtensa/Makefile
> @@ -58,9 +58,6 @@ KBUILD_DEFCONFIG := iss_defconfig
>  LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
>
>  head-y         := arch/xtensa/kernel/head.o
> -core-y         += arch/xtensa/kernel/ arch/xtensa/mm/
> -core-y         += arch/xtensa/platforms/$(platform-y)/
> -core-y                 += arch/xtensa/boot/dts/
>
>  libs-y         += arch/xtensa/lib/ $(LIBGCC)
>
> diff --git a/arch/xtensa/platforms/Makefile b/arch/xtensa/platforms/Makefile
> new file mode 100644
> index 000000000000..e2e7e0726979
> --- /dev/null
> +++ b/arch/xtensa/platforms/Makefile
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +obj-$(CONFIG_XTENSA_PLATFORM_XT2000)   += xt2000/
> +obj-$(CONFIG_XTENSA_PLATFORM_ISS)      += iss/
> +obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA)   += xtfpga/

With this change platform directory names are duplicated in two
makefiles. Can we move them to Kconfig with something like the
following (on top of this change)?

---8<---
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index b843902ad9fd..fe5ae5ec71c9 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -314,6 +314,12 @@ config PLATFORM_HAVE_XIP

menu "Platform options"

+config XTENSA_PLATFORM
+       string
+       default iss if XTENSA_PLATFORM_ISS
+       default xt2000 if XTENSA_PLATFORM_XT2000
+       default xtfpga if XTENSA_PLATFORM_XTFPGA
+
choice
       prompt "Xtensa System Type"
       default XTENSA_PLATFORM_ISS
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 96714ef7c89e..6b104ecdd19e 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -26,12 +26,6 @@ ifneq ($(VARIANT),)
  endif
endif

-# Platform configuration
-
-platform-$(CONFIG_XTENSA_PLATFORM_XT2000)      := xt2000
-platform-$(CONFIG_XTENSA_PLATFORM_ISS)         := iss
-platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA)      := xtfpga
-
# temporarily until string.h is fixed
KBUILD_CFLAGS += -ffreestanding -D__linux__
KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
@@ -47,7 +41,7 @@ endif
CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)

vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
-plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
+plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(CONFIG_XTENSA_PLATFORM))

KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))

diff --git a/arch/xtensa/platforms/Makefile b/arch/xtensa/platforms/Makefile
index e2e7e0726979..08d0e9053db6 100644
--- a/arch/xtensa/platforms/Makefile
+++ b/arch/xtensa/platforms/Makefile
@@ -1,4 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_XTENSA_PLATFORM_XT2000)   += xt2000/
-obj-$(CONFIG_XTENSA_PLATFORM_ISS)      += iss/
-obj-$(CONFIG_XTENSA_PLATFORM_XTFPGA)   += xtfpga/
+obj-y += $(CONFIG_XTENSA_PLATFORM)/

---8<---

-- 
Thanks.
-- Max

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ