diff options
author | Ross Burton <ross@burtonini.com> | 2020-09-29 23:16:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-06 23:14:24 +0100 |
commit | e6436043ca1fe160c09143d901e43b4d83d43d3f (patch) | |
tree | 0532532deeac87d9c029dcd48635841f19a32cb6 | |
parent | e65267d3768429a39967de3c283c981a5848913e (diff) | |
download | poky-e6436043ca1fe160c09143d901e43b4d83d43d3f.tar.gz |
bjam-native: don't do debug builds
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.
(From OE-Core rev: 66d583d1b2bc54cac278c30b5dbc9fde016eb6ee)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 4 insertions, 71 deletions
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" | |||
5 | 5 | ||
6 | inherit native | 6 | inherit native |
7 | 7 | ||
8 | SRC_URI += "file://0001-Build-debug-version-of-bjam.patch \ | ||
9 | file://0001-build.sh-use-DNDEBUG-also-in-debug-builds.patch \ | ||
10 | " | ||
11 | |||
12 | do_compile() { | 8 | do_compile() { |
13 | ./bootstrap.sh --with-toolset=gcc | 9 | ./bootstrap.sh --with-toolset=gcc |
14 | } | 10 | } |
15 | 11 | ||
16 | do_install() { | 12 | do_install() { |
17 | install -d ${D}${bindir}/ | 13 | install -d ${D}${bindir}/ |
18 | # install unstripped version for bjam | 14 | install b2 ${D}${bindir}/bjam |
19 | install -c -m 755 b2 ${D}${bindir}/bjam | ||
20 | } | 15 | } |
16 | |||
17 | # The build is either release mode (pre-stripped) or debug (-O0). | ||
18 | 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 @@ | |||
1 | From 19c117c3d1388654da484e26afb3fb6c3e4181a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Klauer <daniel.klauer@gin.de> | ||
3 | Date: Tue, 30 Jul 2019 11:39:09 +0200 | ||
4 | Subject: [PATCH] Build debug version of bjam | ||
5 | |||
6 | bjam is stripped by default, this causes QA warning while stripping it | ||
7 | from do_populate_sysroot(): | ||
8 | |||
9 | WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \ | ||
10 | from bjam-native was already stripped, \ | ||
11 | this will prevent future debugging! | ||
12 | |||
13 | The JAM scripts allow to build unstripped version with '--debug'. Just | ||
14 | build and install the bjam.debug to stop bjam from being stripped in | ||
15 | compile step. | ||
16 | |||
17 | Upstream-Status: Inappropriate [configuration] | ||
18 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
19 | --- | ||
20 | bootstrap.sh | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/bootstrap.sh b/bootstrap.sh | ||
24 | index ca0b08d58..87f38dcf2 100755 | ||
25 | --- a/bootstrap.sh | ||
26 | +++ b/bootstrap.sh | ||
27 | @@ -223,7 +223,7 @@ rm -f config.log | ||
28 | if test "x$BJAM" = x; then | ||
29 | $ECHO -n "Building Boost.Build engine with toolset $TOOLSET... " | ||
30 | pwd=`pwd` | ||
31 | - (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1 | ||
32 | + (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET" --debug) > bootstrap.log 2>&1 | ||
33 | if [ $? -ne 0 ]; then | ||
34 | echo | ||
35 | echo "Failed to build Boost.Build build engine" | ||
36 | -- | ||
37 | 2.17.1 | ||
38 | |||
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 @@ | |||
1 | From 2afd025997a57794ce24e07e914b461dfea6ba5f Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | ||
3 | Date: Mon, 26 Aug 2019 16:04:16 +0200 | ||
4 | Subject: [PATCH] build.sh: use -DNDEBUG also in debug builds | ||
5 | |||
6 | Without it, there is a significant performance regression | ||
7 | when running 'bjam install'. | ||
8 | |||
9 | Upstream-Status: Inappropriate [configuration] | ||
10 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> | ||
11 | --- | ||
12 | tools/build/src/engine/build.sh | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh | ||
16 | index a1e4cd335..64e0a4c80 100755 | ||
17 | --- a/tools/build/src/engine/build.sh | ||
18 | +++ b/tools/build/src/engine/build.sh | ||
19 | @@ -436,7 +436,7 @@ case $B2_OS in | ||
20 | ;; | ||
21 | esac | ||
22 | |||
23 | -if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}" | ||
24 | +if check_debug_build "$@" ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG} -DNDEBUG" | ||
25 | else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG" | ||
26 | fi | ||
27 | echo_run ${B2_CXX} ${CXXFLAGS} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 | ||