All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bjam-native: don't do debug builds
@ 2020-09-29 22:16 Ross Burton
  2020-09-29 22:16 ` [PATCH 2/2] boost: move the build directory outside of S Ross Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ross Burton @ 2020-09-29 22:16 UTC (permalink / raw)
  To: openembedded-core

Previously this recipe was changed to do debug builds because otherwise insane
warns that the binary is already stripped.

However, debug builds for boost.build also pass -O0.  It turns out that given
how large Boost is (or, how bad boost.build is) doing a release build with -O3
knocks a third off the walltime for a Boost package in my test, mainly by reducing
how long it spends deciding that nothing needs to be rebuilt in do_install:

  PKG      TASK        ABSDIFF  RELDIFF  WALLTIME1 -> WALLTIME2
  boost    do_install  -330.7s   -69.2%     477.6s -> 146.9s
  boost    do_compile    -7.1s    -2.7%     269.3s -> 262.2s

Replace debug mode with INSANE_SKIP=already-stripped.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../boost/bjam-native_1.74.0.bb               | 10 ++---
 .../0001-Build-debug-version-of-bjam.patch    | 38 -------------------
 ....sh-use-DNDEBUG-also-in-debug-builds.patch | 27 -------------
 3 files changed, 4 insertions(+), 71 deletions(-)
 delete mode 100644 meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
 delete mode 100644 meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch

diff --git a/meta/recipes-support/boost/bjam-native_1.74.0.bb b/meta/recipes-support/boost/bjam-native_1.74.0.bb
index d843eb038c..c0eeed60b0 100644
--- a/meta/recipes-support/boost/bjam-native_1.74.0.bb
+++ b/meta/recipes-support/boost/bjam-native_1.74.0.bb
@@ -5,16 +5,14 @@ SECTION = "devel"
 
 inherit native
 
-SRC_URI += "file://0001-Build-debug-version-of-bjam.patch \
-            file://0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch \
-           "
-
 do_compile() {
     ./bootstrap.sh --with-toolset=gcc
 }
 
 do_install() {
     install -d ${D}${bindir}/
-    # install unstripped version for bjam
-    install -c -m 755 b2 ${D}${bindir}/bjam
+    install b2 ${D}${bindir}/bjam
 }
+
+# The build is either release mode (pre-stripped) or debug (-O0).
+INSANE_SKIP_${PN} = "already-stripped"
diff --git a/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch b/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
deleted file mode 100644
index c6dcee915e..0000000000
--- a/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 19c117c3d1388654da484e26afb3fb6c3e4181a9 Mon Sep 17 00:00:00 2001
-From: Daniel Klauer <daniel.klauer@gin.de>
-Date: Tue, 30 Jul 2019 11:39:09 +0200
-Subject: [PATCH] Build debug version of bjam
-
-bjam is stripped by default, this causes QA warning while stripping it
-from do_populate_sysroot():
-
-  WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \
-    from bjam-native was already stripped, \
-    this will prevent future debugging!
-
-The JAM scripts allow to build unstripped version with '--debug'. Just
-build and install the bjam.debug to stop bjam from being stripped in
-compile step.
-
-Upstream-Status: Inappropriate [configuration]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- bootstrap.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/bootstrap.sh b/bootstrap.sh
-index ca0b08d58..87f38dcf2 100755
---- a/bootstrap.sh
-+++ b/bootstrap.sh
-@@ -223,7 +223,7 @@ rm -f config.log
- if test "x$BJAM" = x; then
-   $ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
-   pwd=`pwd`
--  (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
-+  (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET" --debug) > bootstrap.log 2>&1
-   if [ $? -ne 0 ]; then
-       echo
-       echo "Failed to build Boost.Build build engine" 
--- 
-2.17.1
-
diff --git a/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch b/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch
deleted file mode 100644
index 4c6ef2ed84..0000000000
--- a/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 2afd025997a57794ce24e07e914b461dfea6ba5f Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 26 Aug 2019 16:04:16 +0200
-Subject: [PATCH] build.sh: use -DNDEBUG also in debug builds
-
-Without it, there is a significant performance regression
-when running 'bjam install'.
-
-Upstream-Status: Inappropriate [configuration]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- tools/build/src/engine/build.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh
-index a1e4cd335..64e0a4c80 100755
---- a/tools/build/src/engine/build.sh
-+++ b/tools/build/src/engine/build.sh
-@@ -436,7 +436,7 @@ case $B2_OS in
-     ;;
- esac
- 
--if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}"
-+if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG} -DNDEBUG"
- else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG"
- fi
- echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2
-- 
2.25.1


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

* [PATCH 2/2] boost: move the build directory outside of S
  2020-09-29 22:16 [PATCH 1/2] bjam-native: don't do debug builds Ross Burton
@ 2020-09-29 22:16 ` Ross Burton
  2020-09-29 22:21 ` [OE-core] [PATCH 1/2] bjam-native: don't do debug builds Richard Purdie
  2020-10-07 23:11 ` Steve Sakoman
  2 siblings, 0 replies; 6+ messages in thread
From: Ross Burton @ 2020-09-29 22:16 UTC (permalink / raw)
  To: openembedded-core

Instead of manually creating and deleting build directories, follow the idioms
by setting B to WORKDIR/build, setting do_configure[cleandirs], and using ${B}
where appropriate.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-support/boost/boost.inc | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
index ca140d595f..ea1bc123b8 100644
--- a/meta/recipes-support/boost/boost.inc
+++ b/meta/recipes-support/boost/boost.inc
@@ -7,6 +7,9 @@ CVE_PRODUCT = "boost:boost"
 ARM_INSTRUCTION_SET_armv4 = "arm"
 ARM_INSTRUCTION_SET_armv5 = "arm"
 
+B = "${WORKDIR}/build"
+do_configure[cleandirs] = "${B}"
+
 BOOST_LIBS = "\
 	atomic \
 	chrono \
@@ -146,7 +149,7 @@ BOOST_PARALLEL_MAKE = "${@oe.utils.parallel_make_argument(d, '-j%d')}"
 BJAM_OPTS    = '${BOOST_PARALLEL_MAKE} -d+2 -q \
 		${BJAM_TOOLS} \
 		-sBOOST_BUILD_USER_CONFIG=${WORKDIR}/user-config.jam \
-		--build-dir=${S}/${TARGET_SYS} \
+		--build-dir=${B} \
 		--disable-icu \
 		${BJAM_EXTRA}'
 
@@ -161,6 +164,7 @@ BJAM_OPTS_append_arm = " abi=aapcs architecture=arm"
 BJAM_OPTS_append_aarch64 = " abi=aapcs address-model=64 architecture=arm"
 
 do_configure() {
+	cd ${S}
 	cp -f ${S}/boost/config/platform/linux.hpp ${S}/boost/config/platform/linux-gnueabi.hpp
 
 	# D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
@@ -184,8 +188,9 @@ do_configure() {
 }
 
 do_compile() {
-	rm -rf ${S}/${TARGET_SYS}
-	bjam ${BJAM_OPTS} --prefix=${prefix} \
+	cd ${S}
+	bjam ${BJAM_OPTS} \
+		--prefix=${prefix} \
 		--exec-prefix=${exec_prefix} \
 		--libdir=${libdir} \
 		--includedir=${includedir} \
@@ -193,6 +198,7 @@ do_compile() {
 }
 
 do_install() {
+	cd ${S}
 	bjam ${BJAM_OPTS} \
 		--libdir=${D}${libdir} \
 		--includedir=${D}${includedir} \
-- 
2.25.1


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

* Re: [OE-core] [PATCH 1/2] bjam-native: don't do debug builds
  2020-09-29 22:16 [PATCH 1/2] bjam-native: don't do debug builds Ross Burton
  2020-09-29 22:16 ` [PATCH 2/2] boost: move the build directory outside of S Ross Burton
@ 2020-09-29 22:21 ` Richard Purdie
  2020-09-30 12:25   ` Ross Burton
  2020-10-07 23:11 ` Steve Sakoman
  2 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2020-09-29 22:21 UTC (permalink / raw)
  To: Ross Burton, openembedded-core

On Tue, 2020-09-29 at 23:16 +0100, Ross Burton wrote:
> Previously this recipe was changed to do debug builds because
> otherwise insane
> warns that the binary is already stripped.
> 
> However, debug builds for boost.build also pass -O0.  It turns out
> that given
> how large Boost is (or, how bad boost.build is) doing a release build
> with -O3
> knocks a third off the walltime for a Boost package in my test,
> mainly by reducing
> how long it spends deciding that nothing needs to be rebuilt in
> do_install:
> 
>   PKG      TASK        ABSDIFF  RELDIFF  WALLTIME1 -> WALLTIME2
>   boost    do_install  -330.7s   -69.2%     477.6s -> 146.9s
>   boost    do_compile    -7.1s    -2.7%     269.3s -> 262.2s
> 
> Replace debug mode with INSANE_SKIP=already-stripped.

This isn't so simple unfortunately. If the binaries are stripped, we
can't do the debug symbols processing, the src packages are empty and
so on, it has knock on repercussions. 

Can we stop the -O0 in debug builds somehow?

Cheers,

Richard


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

* Re: [OE-core] [PATCH 1/2] bjam-native: don't do debug builds
  2020-09-29 22:21 ` [OE-core] [PATCH 1/2] bjam-native: don't do debug builds Richard Purdie
@ 2020-09-30 12:25   ` Ross Burton
  2020-09-30 12:26     ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Ross Burton @ 2020-09-30 12:25 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

On Tue, 29 Sep 2020 at 23:21, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> This isn't so simple unfortunately. If the binaries are stripped, we
> can't do the debug symbols processing, the src packages are empty and
> so on, it has knock on repercussions.

This is a native-specific recipe, so is that relevant?

Ross

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

* Re: [OE-core] [PATCH 1/2] bjam-native: don't do debug builds
  2020-09-30 12:25   ` Ross Burton
@ 2020-09-30 12:26     ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2020-09-30 12:26 UTC (permalink / raw)
  To: Ross Burton; +Cc: OE-core

On Wed, 2020-09-30 at 13:25 +0100, Ross Burton wrote:
> On Tue, 29 Sep 2020 at 23:21, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > This isn't so simple unfortunately. If the binaries are stripped,
> > we
> > can't do the debug symbols processing, the src packages are empty
> > and
> > so on, it has knock on repercussions.
> 
> This is a native-specific recipe, so is that relevant?

I have to admit I didn't notice that! :)

Cheers,

Richard


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

* Re: [OE-core] [PATCH 1/2] bjam-native: don't do debug builds
  2020-09-29 22:16 [PATCH 1/2] bjam-native: don't do debug builds Ross Burton
  2020-09-29 22:16 ` [PATCH 2/2] boost: move the build directory outside of S Ross Burton
  2020-09-29 22:21 ` [OE-core] [PATCH 1/2] bjam-native: don't do debug builds Richard Purdie
@ 2020-10-07 23:11 ` Steve Sakoman
  2 siblings, 0 replies; 6+ messages in thread
From: Steve Sakoman @ 2020-10-07 23:11 UTC (permalink / raw)
  To: Ross Burton; +Cc: Patches and discussions about the oe-core layer

Does this make sense for dunfell too? (adjusted to version 1.72 of course)

Steve

On Tue, Sep 29, 2020 at 12:16 PM Ross Burton <ross@burtonini.com> wrote:
>
> Previously this recipe was changed to do debug builds because otherwise insane
> warns that the binary is already stripped.
>
> However, debug builds for boost.build also pass -O0.  It turns out that given
> how large Boost is (or, how bad boost.build is) doing a release build with -O3
> knocks a third off the walltime for a Boost package in my test, mainly by reducing
> how long it spends deciding that nothing needs to be rebuilt in do_install:
>
>   PKG      TASK        ABSDIFF  RELDIFF  WALLTIME1 -> WALLTIME2
>   boost    do_install  -330.7s   -69.2%     477.6s -> 146.9s
>   boost    do_compile    -7.1s    -2.7%     269.3s -> 262.2s
>
> Replace debug mode with INSANE_SKIP=already-stripped.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  .../boost/bjam-native_1.74.0.bb               | 10 ++---
>  .../0001-Build-debug-version-of-bjam.patch    | 38 -------------------
>  ....sh-use-DNDEBUG-also-in-debug-builds.patch | 27 -------------
>  3 files changed, 4 insertions(+), 71 deletions(-)
>  delete mode 100644 meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
>  delete mode 100644 meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch
>
> diff --git a/meta/recipes-support/boost/bjam-native_1.74.0.bb b/meta/recipes-support/boost/bjam-native_1.74.0.bb
> index d843eb038c..c0eeed60b0 100644
> --- a/meta/recipes-support/boost/bjam-native_1.74.0.bb
> +++ b/meta/recipes-support/boost/bjam-native_1.74.0.bb
> @@ -5,16 +5,14 @@ SECTION = "devel"
>
>  inherit native
>
> -SRC_URI += "file://0001-Build-debug-version-of-bjam.patch \
> -            file://0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch \
> -           "
> -
>  do_compile() {
>      ./bootstrap.sh --with-toolset=gcc
>  }
>
>  do_install() {
>      install -d ${D}${bindir}/
> -    # install unstripped version for bjam
> -    install -c -m 755 b2 ${D}${bindir}/bjam
> +    install b2 ${D}${bindir}/bjam
>  }
> +
> +# The build is either release mode (pre-stripped) or debug (-O0).
> +INSANE_SKIP_${PN} = "already-stripped"
> diff --git a/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch b/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
> deleted file mode 100644
> index c6dcee915e..0000000000
> --- a/meta/recipes-support/boost/files/0001-Build-debug-version-of-bjam.patch
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -From 19c117c3d1388654da484e26afb3fb6c3e4181a9 Mon Sep 17 00:00:00 2001
> -From: Daniel Klauer <daniel.klauer@gin.de>
> -Date: Tue, 30 Jul 2019 11:39:09 +0200
> -Subject: [PATCH] Build debug version of bjam
> -
> -bjam is stripped by default, this causes QA warning while stripping it
> -from do_populate_sysroot():
> -
> -  WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \
> -    from bjam-native was already stripped, \
> -    this will prevent future debugging!
> -
> -The JAM scripts allow to build unstripped version with '--debug'. Just
> -build and install the bjam.debug to stop bjam from being stripped in
> -compile step.
> -
> -Upstream-Status: Inappropriate [configuration]
> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ----
> - bootstrap.sh | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/bootstrap.sh b/bootstrap.sh
> -index ca0b08d58..87f38dcf2 100755
> ---- a/bootstrap.sh
> -+++ b/bootstrap.sh
> -@@ -223,7 +223,7 @@ rm -f config.log
> - if test "x$BJAM" = x; then
> -   $ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
> -   pwd=`pwd`
> --  (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
> -+  (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET" --debug) > bootstrap.log 2>&1
> -   if [ $? -ne 0 ]; then
> -       echo
> -       echo "Failed to build Boost.Build build engine"
> ---
> -2.17.1
> -
> diff --git a/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch b/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch
> deleted file mode 100644
> index 4c6ef2ed84..0000000000
> --- a/meta/recipes-support/boost/files/0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -From 2afd025997a57794ce24e07e914b461dfea6ba5f Mon Sep 17 00:00:00 2001
> -From: Alexander Kanavin <alex.kanavin@gmail.com>
> -Date: Mon, 26 Aug 2019 16:04:16 +0200
> -Subject: [PATCH] build.sh: use -DNDEBUG also in debug builds
> -
> -Without it, there is a significant performance regression
> -when running 'bjam install'.
> -
> -Upstream-Status: Inappropriate [configuration]
> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ----
> - tools/build/src/engine/build.sh | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh
> -index a1e4cd335..64e0a4c80 100755
> ---- a/tools/build/src/engine/build.sh
> -+++ b/tools/build/src/engine/build.sh
> -@@ -436,7 +436,7 @@ case $B2_OS in
> -     ;;
> - esac
> -
> --if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}"
> -+if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG} -DNDEBUG"
> - else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG"
> - fi
> - echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2
> --
> 2.25.1
>
>
> 
>

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

end of thread, other threads:[~2020-10-07 23:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 22:16 [PATCH 1/2] bjam-native: don't do debug builds Ross Burton
2020-09-29 22:16 ` [PATCH 2/2] boost: move the build directory outside of S Ross Burton
2020-09-29 22:21 ` [OE-core] [PATCH 1/2] bjam-native: don't do debug builds Richard Purdie
2020-09-30 12:25   ` Ross Burton
2020-09-30 12:26     ` Richard Purdie
2020-10-07 23:11 ` Steve Sakoman

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.