Skip to contentSkip to conversation

lvm2/libdevmapper: Make it build for native

PATCH In review Peter Kjellerstedt 2 participants 3 messages Sep 11, 2019 – Feb 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lvm2/libdevmapper: Make it build for native

Backport a patch from upstream master that corrects the passing of link flags through configure.

---
 ...gure-Fix-setting-of-CLDFLAGS-default.patch | 78 +++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2.inc         |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of-CLDFLAGS-default.patch
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of-CLDFLAGS-default.patch new file +78 -0
new file mode 100644
index 000000000..07cb88ffb
@@ -0,0 +1,78 @@
+From 4a3e707402032788e09282e0f54fdf82c8a0f8fc Mon Sep 17 00:00:00 2001
+From: Marian Csontos <[email protected]>
+Date: Mon, 19 Aug 2019 14:54:43 +0200
+Subject: [PATCH] configure: Fix setting of CLDFLAGS default
+
+---
+ configure    | 6 +++---
+ configure.ac | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=lvm2.git;a=commit;h=4a3e707402032788e09282e0f54fdf82c8a0f8fc]
+Signed-off-by: Peter Kjellerstedt <[email protected]>
+
+diff --git a/configure b/configure
+index ff3a59b6b..4c8476502 100755
+--- a/configure
++++ b/configure
+@@ -3077,7 +3077,7 @@ if test -z "$CFLAGS"; then :
+ fi
+ case "$host_os" in
+ 	linux*)
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
+ 		# equivalent to -rdynamic
+ 		ELDFLAGS="-Wl,--export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -3098,7 +3098,7 @@ case "$host_os" in
+ 		;;
+ 	darwin*)
+ 		CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+ 		ELDFLAGS=
+ 		CLDWHOLEARCHIVE="-all_load"
+ 		CLDNOWHOLEARCHIVE=
+@@ -3111,7 +3111,7 @@ case "$host_os" in
+ 		BLKDEACTIVATE=no
+ 		;;
+ 	*)
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+ 		;;
+ esac
+ 
+diff --git a/configure.ac b/configure.ac
+index 5da694631..830edb8da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,7 +30,7 @@ AC_CANONICAL_TARGET([])
+ AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"])
+ case "$host_os" in
+ 	linux*)
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
+ 		# equivalent to -rdynamic
+ 		ELDFLAGS="-Wl,--export-dynamic"
+ 		# FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -51,7 +51,7 @@ case "$host_os" in
+ 		;;
+ 	darwin*)
+ 		CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+ 		ELDFLAGS=
+ 		CLDWHOLEARCHIVE="-all_load"
+ 		CLDNOWHOLEARCHIVE=
+@@ -64,7 +64,7 @@ case "$host_os" in
+ 		BLKDEACTIVATE=no
+ 		;;
+ 	*)
+-		CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++		CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+ 		;;
+ esac
+ 
+-- 
+2.21.0
+
meta-oe/recipes-support/lvm2/lvm2.inc +1 -0
index f358663b0..6c95bfd02 100644
@@ -15,6 +15,7 @@ SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \
            file://0001-Avoid-bashisms-in-init-scripts.patch \
            file://0005-do-not-build-manual.patch \
            file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \
+           file://0001-configure-Fix-setting-of-CLDFLAGS-default.patch \
            "
 SRC_URI[md5sum] = "5fc07da5461a3794a751dcfc355827d5"
 SRC_URI[sha256sum] = "550ba750239fd75b7e52c9877565cabffef506bbf6d7f6f17b9700dee56c720f"
Signature · 1 line
2.21.0
#1 lore raw

Hello all,

I've just faced the problem with building lvm2 of the [zeus] and it looks like this patch causes issues with similar symptoms that has been reported for bash CVE [1].

This patch also touches the configure part, and in case if -c cleanall is used - the build succeeds.

Failed build log looks like following:
ERROR: lvm2-2.03.02-r0 do_patch: Command Error: 'quilt --quiltrc /development/projects/build-output/work/corei7-64-poky-linux/lvm2/2.03.02-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch 0001-configure-Fix-setting-of-CLDFLAGS-default.patch
patching file configure
Hunk #1 FAILED at 3077.
Hunk #2 FAILED at 3098.
Hunk #3 FAILED at 3111.
3 out of 3 hunks FAILED -- rejects in file configure
patching file configure.ac
Hunk #2 succeeded at 50 (offset -1 lines).
Hunk #3 succeeded at 63 (offset -1 lines).
Patch 0001-configure-Fix-setting-of-CLDFLAGS-default.patch does not
apply (enforce with -f)
ERROR: Logfile of failure stored in:
/development/projects/build-output/work/corei7-64-poky-linux/lvm2/2.03.02-r0/temp/log.do_patch.10047
ERROR: Task (/development/projects/yocto-build-appliance/meta-openembedded/meta-oe/recipes-support/lvm2/lvm2_2.03.02.bb:do_patch) failed with exit code '1'

Since there was no decision (yet) taken on the bash one - can we combine those two together to find a common solution for both cases?

Quoted 110 lines · Peter Kjellerstedt

Backport a patch from upstream master that corrects the passing of link flags through configure.

---
 ...gure-Fix-setting-of-CLDFLAGS-default.patch | 78 +++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2.inc         |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of-CLDFLAGS-default.patch
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of-CLDFLAGS-default.patch new file +78 -0
new file mode 100644
index 000000000..07cb88ffb
@@ -0,0 +1,78 @@
+From 4a3e707402032788e09282e0f54fdf82c8a0f8fc Mon Sep 17 00:00:00 2001
+From: Marian Csontos <[email protected]>
+Date: Mon, 19 Aug 2019 14:54:43 +0200
+Subject: [PATCH] configure: Fix setting of CLDFLAGS default
+
+---
+ configure    | 6 +++---
+ configure.ac | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=lvm2.git;a=commit;h=4a3e707402032788e09282e0f54fdf82c8a0f8fc]
+Signed-off-by: Peter Kjellerstedt <[email protected]>
+
+diff --git a/configure b/configure
+index ff3a59b6b..4c8476502 100755
+--- a/configure
++++ b/configure
+@@ -3077,7 +3077,7 @@ if test -z "$CFLAGS"; then :
+ fi
+ case "$host_os" in
+       linux*)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
+               # equivalent to -rdynamic
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -3098,7 +3098,7 @@ case "$host_os" in
+               ;;
+       darwin*)
+               CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ELDFLAGS=
+               CLDWHOLEARCHIVE="-all_load"
+               CLDNOWHOLEARCHIVE=
+@@ -3111,7 +3111,7 @@ case "$host_os" in
+               BLKDEACTIVATE=no
+               ;;
+       *)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ;;
+ esac
+
+diff --git a/configure.ac b/configure.ac
+index 5da694631..830edb8da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,7 +30,7 @@ AC_CANONICAL_TARGET([])
+ AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"])
+ case "$host_os" in
+       linux*)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-script,.export.sym"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
+               # equivalent to -rdynamic
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -51,7 +51,7 @@ case "$host_os" in
+               ;;
+       darwin*)
+               CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ELDFLAGS=
+               CLDWHOLEARCHIVE="-all_load"
+               CLDNOWHOLEARCHIVE=
+@@ -64,7 +64,7 @@ case "$host_os" in
+               BLKDEACTIVATE=no
+               ;;
+       *)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ;;
+ esac
+
+--
+2.21.0
+
meta-oe/recipes-support/lvm2/lvm2.inc +1 -1
index f358663b0..6c95bfd02 100644
@@ -15,6 +15,7 @@ SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \
            file://0001-Avoid-bashisms-in-init-scripts.patch \
            file://0005-do-not-build-manual.patch \
            file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \
+           file://0001-configure-Fix-setting-of-CLDFLAGS-default.patch \
            "
 SRC_URI[md5sum] = "5fc07da5461a3794a751dcfc355827d5"
 SRC_URI[sha256sum] = "550ba750239fd75b7e52c9877565cabffef506bbf6d7f6f17b9700dee56c720f"
--

2.21.0

Quoted 5 lines

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

[1]: http://lists.openembedded.org/pipermail/openembedded-core/2020-February/292991.html

--
Regards,
Andrey.

#2 lore raw
Quoted 41 lines

-----Original Message-----
From: Andrey Zhizhikin <[email protected]>
Sent: den 25 februari 2020 10:46
To: Peter Kjellerstedt <[email protected]>
Cc: openembeded-devel <[email protected]>; Richard Purdie <[email protected]>
Subject: Re: [oe] [meta-oe][PATCH] lvm2/libdevmapper: Make it build for native

Hello all,

I've just faced the problem with building lvm2 of the [zeus] and it looks like this patch causes issues with similar symptoms that has been reported for bash CVE [1].

This patch also touches the configure part, and in case if -c cleanall is used - the build succeeds.

Failed build log looks like following:
ERROR: lvm2-2.03.02-r0 do_patch: Command Error: 'quilt --quiltrc /development/projects/build-output/work/corei7-64-poky-linux/lvm2/2.03.02- r0/recipe-sysroot-native/etc/quiltrc
push' exited with 0 Output:
Applying patch 0001-configure-Fix-setting-of-CLDFLAGS-default.patch patching file configure
Hunk #1 FAILED at 3077.
Hunk #2 FAILED at 3098.
Hunk #3 FAILED at 3111.
3 out of 3 hunks FAILED -- rejects in file configure
patching file configure.ac
Hunk #2 succeeded at 50 (offset -1 lines).
Hunk #3 succeeded at 63 (offset -1 lines).
Patch 0001-configure-Fix-setting-of-CLDFLAGS-default.patch does not apply (enforce with -f)
ERROR: Logfile of failure stored in:
/development/projects/build-output/work/corei7-64-poky-linux/lvm2/2.03.02- r0/temp/log.do_patch.10047
ERROR: Task (/development/projects/yocto-build-appliance/meta- openembedded/meta-oe/recipes-support/lvm2/lvm2_2.03.02.bb:do_patch) failed with exit code '1'

Quoted 2 lines

Since there was no decision (yet) taken on the bash one - can we combine those two together to find a common solution for both cases?

I don't know anything about the bash patch, but since I backported the one for lvm2/libdevmapper, I will fix it. I was actually hit by this problem just a few minutes after reading this mail when I was updating to Poky Zeus 22.0.2. Anyway, the fix is simple, as suggested by Richard in the bash thread: just remove the patching of configure.

//Peter

Quoted 139 lines
Quoted 10 lines · Peter Kjellerstedt

Backport a patch from upstream master that corrects the passing of link flags through configure.

---
 ...gure-Fix-setting-of-CLDFLAGS-default.patch | 78 +++++++++++++++++++
 meta-oe/recipes-support/lvm2/lvm2.inc         |  1 +
 2 files changed, 79 insertions(+)
 create mode 100644 meta-oe/recipes-support/lvm2/files/0001-configure-

Fix-setting-of-CLDFLAGS-default.patch

Review

Quoted 2 lines
(quoted diff) +0 -0

setting-of-CLDFLAGS-default.patch b/meta-oe/recipes- support/lvm2/files/0001-configure-Fix-setting-of-CLDFLAGS-default.patch

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of-

Quoted 4 lines

new file mode 100644
index 000000000..07cb88ffb

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +0 -0

CLDFLAGS-default.patch

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- line 11

Quoted 12 lines
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +11 -0
@@ -0,0 +1,78 @@
+From 4a3e707402032788e09282e0f54fdf82c8a0f8fc Mon Sep 17 00:00:00 2001
+From: Marian Csontos <[email protected]>
+Date: Mon, 19 Aug 2019 14:54:43 +0200
+Subject: [PATCH] configure: Fix setting of CLDFLAGS default
+
+---
+ configure    | 6 +++---
+ configure.ac | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+Upstream-Status: Backport

[https://sourceware.org/git/?p=lvm2.git;a=commit;h=4a3e707402032788e09282e
0f54fdf82c8a0f8fc]

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- line 22

Quoted 11 lines
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +11 -0
+Signed-off-by: Peter Kjellerstedt <[email protected]>
+
+diff --git a/configure b/configure
+index ff3a59b6b..4c8476502 100755
+--- a/configure
++++ b/configure
+@@ -3077,7 +3077,7 @@ if test -z "$CFLAGS"; then :
+ fi
+ case "$host_os" in
+       linux*)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-

script,.export.sym"

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- line 23

Quoted 1 line
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +1 -0
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-

script,.export.sym"

Quoted 20 lines
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +20 -0
+               # equivalent to -rdynamic
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -3098,7 +3098,7 @@ case "$host_os" in
+               ;;
+       darwin*)
+               CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ELDFLAGS=
+               CLDWHOLEARCHIVE="-all_load"
+               CLDNOWHOLEARCHIVE=
+@@ -3111,7 +3111,7 @@ case "$host_os" in
+               BLKDEACTIVATE=no
+               ;;
+       *)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ;;
+ esac

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- line 53

Quoted 10 lines
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +10 -0
+
+diff --git a/configure.ac b/configure.ac
+index 5da694631..830edb8da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,7 +30,7 @@ AC_CANONICAL_TARGET([])
+ AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"])
+ case "$host_os" in
+       linux*)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"} -Wl,--version-

script,.export.sym"

meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- line 54

Quoted 1 line
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +1 -0
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-

script,.export.sym"

meta-oe/recipes-

Quoted 25 lines
meta-oe/recipes-support/lvm2/files/0001-configure-Fix-setting-of- new file +24 -0
+               # equivalent to -rdynamic
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
+@@ -51,7 +51,7 @@ case "$host_os" in
+               ;;
+       darwin*)
+               CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ELDFLAGS=
+               CLDWHOLEARCHIVE="-all_load"
+               CLDNOWHOLEARCHIVE=
+@@ -64,7 +64,7 @@ case "$host_os" in
+               BLKDEACTIVATE=no
+               ;;
+       *)
+-              CLDFLAGS="${CLDFLAGS:"$LDFLAGS"}"
++              CLDFLAGS="${CLDFLAGS-"$LDFLAGS"}"
+               ;;
+ esac
+
+--
+2.21.0
+
meta-oe/recipes- renamed from meta-oe/recipes-support/lvm2/lvm2.inc +0 -0

support/lvm2/lvm2.inc

meta-oe/recipes-support/lvm2/lvm2.inc SRC_URI =

Quoted 4 lines

index f358663b0..6c95bfd02 100644

meta-oe/recipes-support/lvm2/lvm2.inc +0 -0
@@ -15,6 +15,7 @@ SRC_URI =

"https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \

meta-oe/recipes-support/lvm2/lvm2.inc SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \

Quoted 3 lines
meta-oe/recipes-support/lvm2/lvm2.inc +0 -0
            file://0001-Avoid-bashisms-in-init-scripts.patch \
            file://0005-do-not-build-manual.patch \
            file://0006-start-lvm2-monitor.service-after-tmp.mount.patch

\

meta-oe/recipes-support/lvm2/lvm2.inc SRC_URI = · line 18

Quoted 1 line
meta-oe/recipes-support/lvm2/lvm2.inc +1 -0
+           file://0001-configure-Fix-setting-of-CLDFLAGS-default.patch

\

meta-oe/recipes-support/lvm2/lvm2.inc SRC_URI = "https://sourceware.org/pub/lvm2/LVM2.${PV}.tgz \

Quoted 3 lines
meta-oe/recipes-support/lvm2/lvm2.inc +0 -0
            "
 SRC_URI[md5sum] = "5fc07da5461a3794a751dcfc355827d5"
 SRC_URI[sha256sum] =

"550ba750239fd75b7e52c9877565cabffef506bbf6d7f6f17b9700dee56c720f"

Quoted 8 lines

--
2.21.0

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

[1]: http://lists.openembedded.org/pipermail/openembedded-core/2020-
February/292991.html

--
Regards,
Andrey.