All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files
@ 2020-04-22  7:28 Chen Qi
  2020-04-22  7:28 ` [OE-core][PATCH 2/2] linux-yocto: add more support for SDK Chen Qi
  2020-04-22 23:19 ` [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Richard Purdie
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Qi @ 2020-04-22  7:28 UTC (permalink / raw)
  To: openembedded-core

We want to make sure `make scripts prepare` succeed inside SDK. However,
the legacy .o files under scripts/kconfig will introduce build error
on some hosts, thus removing them.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/files/toolchain-shar-extract.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 04527f891f..61911e72c9 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -286,6 +286,9 @@ if [ -e "$post_relocate" ]; then
 	$SUDO_EXEC rm -f $post_relocate
 fi
 
+# Remove legacy .o files to avoid kernel build failure
+rm -f $target_sdk_dir/sysroots/*/usr/src/kernel/scripts/kconfig/*.o
+
 echo "SDK has been successfully set up and is ready to be used."
 echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g."
 for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [OE-core][PATCH 2/2] linux-yocto: add more support for SDK
  2020-04-22  7:28 [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Chen Qi
@ 2020-04-22  7:28 ` Chen Qi
  2020-04-22 12:46   ` Bruce Ashfield
  2020-04-22 23:19 ` [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Chen Qi @ 2020-04-22  7:28 UTC (permalink / raw)
  To: openembedded-core

We need to `make scripts prepare` inside SDK. So add patch
to defect if we are insdie SDK environment, and if so change some
PKG_CONFIG_xxx settings so that we will use things from SDK's host
part.

The problem for `make scripts prepare` inside SDK is that the
hosts' environments are different. On some hosts, it happens to
succeed, and on some hosts, it fails. This is because the build mixes
host's part and SDK's host part.

We do such change to make sure only SDK's host part is involed in build.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...port-make-scripts-prepare-inside-SDK.patch | 46 +++++++++++++++++++
 meta/recipes-kernel/linux/linux-yocto.inc     |  3 ++
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch

diff --git a/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch b/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch
new file mode 100644
index 0000000000..5e15d9c732
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch
@@ -0,0 +1,46 @@
+From e7b37cbdbd0f7dbd3ba99e7db6916c2dc3acecc9 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 16 Apr 2020 10:06:24 +0000
+Subject: [PATCH] Makefile: support make scripts prepare inside SDK
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ Makefile | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 2f140aa..af41dca 100644
+--- a/Makefile
++++ b/Makefile
+@@ -277,6 +277,17 @@ ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
+ 	endif
+ endif
+ 
++ifneq ($(SDKTARGETSYSROOT),)
++        ifneq ($(filter scripts prepare, $(MAKECMDGOALS)),)
++		PKG_CONFIG_SYSROOT_DIR = 
++		PKG_CONFIG_PATH = $(OECORE_NATIVE_SYSROOT)/usr/lib/pkgconfig:$(OECORE_NATIVE_SYSROOT)/usr/share/pkgconfig
++		export PKG_CONFIG_SYSROOT_DIR
++		export PKG_CONFIG_PATH
++$(info Changed PKG_CONFIG_SYSROOT_DIR to '$(PKG_CONFIG_SYSROOT_DIR)')
++$(info Changed PKG_CONFIG_PATH to '$(PKG_CONFIG_PATH)')
++        endif
++endif
++
+ ifneq ($(KBUILD_EXTMOD),)
+ 	may-sync-config :=
+ endif
+@@ -994,7 +1005,7 @@ mod_sign_cmd = true
+ endif
+ export mod_sign_cmd
+ 
+-HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
++HOST_LIBELF_LIBS = $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH); export PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR); pkg-config libelf --libs 2>/dev/null || echo -lelf)
+ 
+ ifdef CONFIG_STACK_VALIDATION
+   has_libelf := $(call try-run,\
+-- 
+2.24.1
+
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
index 91df9c1cd5..551aa3def6 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -55,3 +55,6 @@ do_install_append(){
 
 # enable kernel-sample for oeqa/runtime/cases's ksample.py test
 KERNEL_FEATURES_append_qemuall=" features/kernel-sample/kernel-sample.scc"
+
+# Ensure `make scripts prepare` succeed inside SDK
+EXTRA_KERNEL_SRC_URI += "file://0001-Makefile-support-make-scripts-prepare-inside-SDK.patch"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH 2/2] linux-yocto: add more support for SDK
  2020-04-22  7:28 ` [OE-core][PATCH 2/2] linux-yocto: add more support for SDK Chen Qi
@ 2020-04-22 12:46   ` Bruce Ashfield
  0 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2020-04-22 12:46 UTC (permalink / raw)
  To: Chen Qi; +Cc: Patches and discussions about the oe-core layer

On Wed, Apr 22, 2020 at 3:29 AM Chen Qi <Qi.Chen@windriver.com> wrote:
>
> We need to `make scripts prepare` inside SDK. So add patch
> to defect if we are insdie SDK environment, and if so change some
> PKG_CONFIG_xxx settings so that we will use things from SDK's host
> part.

This needs to be submitted to the linux-yocto mailing list.

We don't carry patches to linux-yocto outside of the tree.

Cheers,

Bruce

>
> The problem for `make scripts prepare` inside SDK is that the
> hosts' environments are different. On some hosts, it happens to
> succeed, and on some hosts, it fails. This is because the build mixes
> host's part and SDK's host part.
>
> We do such change to make sure only SDK's host part is involed in build.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  ...port-make-scripts-prepare-inside-SDK.patch | 46 +++++++++++++++++++
>  meta/recipes-kernel/linux/linux-yocto.inc     |  3 ++
>  2 files changed, 49 insertions(+)
>  create mode 100644 meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch
>
> diff --git a/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch b/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch
> new file mode 100644
> index 0000000000..5e15d9c732
> --- /dev/null
> +++ b/meta/recipes-kernel/linux/files/0001-Makefile-support-make-scripts-prepare-inside-SDK.patch
> @@ -0,0 +1,46 @@
> +From e7b37cbdbd0f7dbd3ba99e7db6916c2dc3acecc9 Mon Sep 17 00:00:00 2001
> +From: Chen Qi <Qi.Chen@windriver.com>
> +Date: Thu, 16 Apr 2020 10:06:24 +0000
> +Subject: [PATCH] Makefile: support make scripts prepare inside SDK
> +
> +Upstream-Status: Inappropriate [OE Specific]
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +---
> + Makefile | 13 ++++++++++++-
> + 1 file changed, 12 insertions(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 2f140aa..af41dca 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -277,6 +277,17 @@ ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
> +       endif
> + endif
> +
> ++ifneq ($(SDKTARGETSYSROOT),)
> ++        ifneq ($(filter scripts prepare, $(MAKECMDGOALS)),)
> ++              PKG_CONFIG_SYSROOT_DIR =
> ++              PKG_CONFIG_PATH = $(OECORE_NATIVE_SYSROOT)/usr/lib/pkgconfig:$(OECORE_NATIVE_SYSROOT)/usr/share/pkgconfig
> ++              export PKG_CONFIG_SYSROOT_DIR
> ++              export PKG_CONFIG_PATH
> ++$(info Changed PKG_CONFIG_SYSROOT_DIR to '$(PKG_CONFIG_SYSROOT_DIR)')
> ++$(info Changed PKG_CONFIG_PATH to '$(PKG_CONFIG_PATH)')
> ++        endif
> ++endif
> ++
> + ifneq ($(KBUILD_EXTMOD),)
> +       may-sync-config :=
> + endif
> +@@ -994,7 +1005,7 @@ mod_sign_cmd = true
> + endif
> + export mod_sign_cmd
> +
> +-HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
> ++HOST_LIBELF_LIBS = $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH); export PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR); pkg-config libelf --libs 2>/dev/null || echo -lelf)
> +
> + ifdef CONFIG_STACK_VALIDATION
> +   has_libelf := $(call try-run,\
> +--
> +2.24.1
> +
> diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
> index 91df9c1cd5..551aa3def6 100644
> --- a/meta/recipes-kernel/linux/linux-yocto.inc
> +++ b/meta/recipes-kernel/linux/linux-yocto.inc
> @@ -55,3 +55,6 @@ do_install_append(){
>
>  # enable kernel-sample for oeqa/runtime/cases's ksample.py test
>  KERNEL_FEATURES_append_qemuall=" features/kernel-sample/kernel-sample.scc"
> +
> +# Ensure `make scripts prepare` succeed inside SDK
> +EXTRA_KERNEL_SRC_URI += "file://0001-Makefile-support-make-scripts-prepare-inside-SDK.patch"
> --
> 2.17.1
>
> 



-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files
  2020-04-22  7:28 [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Chen Qi
  2020-04-22  7:28 ` [OE-core][PATCH 2/2] linux-yocto: add more support for SDK Chen Qi
@ 2020-04-22 23:19 ` Richard Purdie
  2020-04-23  1:53   ` Chen Qi
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2020-04-22 23:19 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

On Wed, 2020-04-22 at 15:28 +0800, Chen Qi wrote:
> We want to make sure `make scripts prepare` succeed inside SDK. However,
> the legacy .o files under scripts/kconfig will introduce build error
> on some hosts, thus removing them.
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/files/toolchain-shar-extract.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
> index 04527f891f..61911e72c9 100644
> --- a/meta/files/toolchain-shar-extract.sh
> +++ b/meta/files/toolchain-shar-extract.sh
> @@ -286,6 +286,9 @@ if [ -e "$post_relocate" ]; then
>  	$SUDO_EXEC rm -f $post_relocate
>  fi
>  
> +# Remove legacy .o files to avoid kernel build failure
> +rm -f $target_sdk_dir/sysroots/*/usr/src/kernel/scripts/kconfig/*.o
> +

We should be removing these at SDK construction time, not at extraction
time, then the SDK is smaller and we don't have special cases in this
extraction script...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files
  2020-04-22 23:19 ` [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Richard Purdie
@ 2020-04-23  1:53   ` Chen Qi
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Qi @ 2020-04-23  1:53 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Thanks for the suggestion. I'll send out V2.

Regards,
Chen Qi
________________________________
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Sent: Thursday, April 23, 2020 7:19
To: Chen, Qi <Qi.Chen@windriver.com>; openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files

On Wed, 2020-04-22 at 15:28 +0800, Chen Qi wrote:
> We want to make sure `make scripts prepare` succeed inside SDK. However,
> the legacy .o files under scripts/kconfig will introduce build error
> on some hosts, thus removing them.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/files/toolchain-shar-extract.sh | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
> index 04527f891f..61911e72c9 100644
> --- a/meta/files/toolchain-shar-extract.sh
> +++ b/meta/files/toolchain-shar-extract.sh
> @@ -286,6 +286,9 @@ if [ -e "$post_relocate" ]; then
>        $SUDO_EXEC rm -f $post_relocate
>  fi
>
> +# Remove legacy .o files to avoid kernel build failure
> +rm -f $target_sdk_dir/sysroots/*/usr/src/kernel/scripts/kconfig/*.o
> +

We should be removing these at SDK construction time, not at extraction
time, then the SDK is smaller and we don't have special cases in this
extraction script...

Cheers,

Richard


[-- Attachment #2: Type: text/html, Size: 2811 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-23  1:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22  7:28 [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Chen Qi
2020-04-22  7:28 ` [OE-core][PATCH 2/2] linux-yocto: add more support for SDK Chen Qi
2020-04-22 12:46   ` Bruce Ashfield
2020-04-22 23:19 ` [OE-core][PATCH 1/2] toolchain-shar-extract.sh: remove legacy .o files Richard Purdie
2020-04-23  1:53   ` Chen Qi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.