Skip to contentSkip to conversation

btrfs-tools: Pass DEBUG_MAP_PREFIX flags to Python

PATCH Superseded Joshua Watt 2 participants 3 messages May 29, 2019 – May 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-tools: Pass DEBUG_MAP_PREFIX flags to Python

The DEBUG_MAP_PREFIX flags need to be passed when building the Python library to prevent these non-reproducible paths from being encoded into the library. The patch that does this was accepted upstream and supersedes part of a previous patch that passed LDFLAGS to the Python library in favor of passing EXTRA_PYTHON_LDFLAGS, so the patch and recipe has been updated to reflect this.

---
 ...DFLAGS-when-building-libbtrfsutil.so.patch | 19 +++-----
 ...gs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch | 43 +++++++++++++++++++
 .../btrfs-tools/btrfs-tools_5.1.bb            |  3 +-
 3 files changed, 50 insertions(+), 15 deletions(-)
 create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch
meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch +5 -14
index a8fcfc0f73c..e23be32599b 100644
@@ -1,4 +1,4 @@
-From eecc48ecad359cd4fab650ce49cfe57e99d1859d Mon Sep 17 00:00:00 2001
+From c384fa875c5128009ac8b6ba11a54a6bd4de575a Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Thu, 17 May 2018 12:21:31 +0300
 Subject: [PATCH] Add LDFLAGS when building libbtrfsutil.so and python
@@ -8,14 +8,14 @@ Upstream-Status: Pending
 Signed-off-by: Alexander Kanavin <[email protected]>
 
 ---
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile b/Makefile
-index 10f0e3b0..1697794c 100644
+index e25e256f..6df00186 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -402,7 +402,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c
+@@ -424,7 +424,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c
  
  libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
  	@echo "    [LD]     $@"
@@ -24,12 +24,3 @@ index 10f0e3b0..1697794c 100644
  		-shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@
  
  libbtrfsutil.a: $(libbtrfsutil_objects)
-@@ -417,7 +417,7 @@ ifeq ($(PYTHON_BINDINGS),1)
- libbtrfsutil_python: libbtrfsutil.so.$(libbtrfsutil_major) libbtrfsutil.so libbtrfsutil/btrfsutil.h
- 	@echo "    [PY]     libbtrfsutil"
- 	$(Q)cd libbtrfsutil/python; \
--		CFLAGS= LDFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
-+		CFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
- 
- .PHONY: libbtrfsutil_python
- endif
meta/recipes-devtools/btrfs-tools/btrfs-tools/0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-devtools/btrfs-tools/btrfs-tools_5.1.bb +2 -1
index 8b4178d6dec..86a0307edf1 100644
@@ -18,6 +18,7 @@ SRCREV = "43013422dbce4bcc9ed77cfe65b294caa0985ec8"
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
            file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \
            file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \
+           file://0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch \
            "
 
 inherit autotools-brokensep pkgconfig manpages distutils3-base
@@ -27,7 +28,7 @@ CLEANBROKEN = "1"
 PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native"
 EXTRA_OECONF = " --disable-zstd"
 EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
-EXTRA_OEMAKE = "V=1"
+EXTRA_OEMAKE = "V=1 'EXTRA_PYTHON_CFLAGS=${DEBUG_PREFIX_MAP}' 'EXTRA_PYTHON_LDFLAGS=${LDFLAGS}'"
 
 do_configure_prepend() {
 	# Upstream doesn't ship this and autoreconf won't install it as automake isn't used.
Signature · 1 line
2.21.0
#1 lore raw
Quoted 9 lines · Joshua Watt

The DEBUG_MAP_PREFIX flags need to be passed when building the Python library to prevent these non-reproducible paths from being encoded into
the library. The patch that does this was accepted upstream and supersedes part of a previous patch that passed LDFLAGS to the Python library in favor of passing EXTRA_PYTHON_LDFLAGS, so the patch and recipe has been updated to reflect this.

This breaks btrfs-tools-native:

https://autobuilder.yoctoproject.org/typhoon/#/builders/23/builds/875/steps/7/logs/step2b

Cheers,

Richard

#2 lore raw

PATCH v2 1/1 btrfs-tools: Pass DEBUG_MAP_PREFIX flags to Python

In reply to Joshua Watt

The DEBUG_MAP_PREFIX flags need to be passed when building the Python library to prevent these non-reproducible paths from being encoded into the library. The patch that does this was accepted upstream and supersedes part of a previous patch that passed LDFLAGS to the Python library in favor of passing EXTRA_PYTHON_LDFLAGS, so the patch and recipe has been updated to reflect this.

---
 ...DFLAGS-when-building-libbtrfsutil.so.patch | 19 +++-----
 ...gs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch | 43 +++++++++++++++++++
 .../btrfs-tools/btrfs-tools_5.1.bb            |  6 ++-
 3 files changed, 53 insertions(+), 15 deletions(-)
 create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch
meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch +5 -14
index a8fcfc0f73c..e23be32599b 100644
@@ -1,4 +1,4 @@
-From eecc48ecad359cd4fab650ce49cfe57e99d1859d Mon Sep 17 00:00:00 2001
+From c384fa875c5128009ac8b6ba11a54a6bd4de575a Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Thu, 17 May 2018 12:21:31 +0300
 Subject: [PATCH] Add LDFLAGS when building libbtrfsutil.so and python
@@ -8,14 +8,14 @@ Upstream-Status: Pending
 Signed-off-by: Alexander Kanavin <[email protected]>
 
 ---
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile b/Makefile
-index 10f0e3b0..1697794c 100644
+index e25e256f..6df00186 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -402,7 +402,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c
+@@ -424,7 +424,7 @@ libbtrfsutil/%.o: libbtrfsutil/%.c
  
  libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
  	@echo "    [LD]     $@"
@@ -24,12 +24,3 @@ index 10f0e3b0..1697794c 100644
  		-shared -Wl,-soname,libbtrfsutil.so.$(libbtrfsutil_major) -o $@
  
  libbtrfsutil.a: $(libbtrfsutil_objects)
-@@ -417,7 +417,7 @@ ifeq ($(PYTHON_BINDINGS),1)
- libbtrfsutil_python: libbtrfsutil.so.$(libbtrfsutil_major) libbtrfsutil.so libbtrfsutil/btrfsutil.h
- 	@echo "    [PY]     libbtrfsutil"
- 	$(Q)cd libbtrfsutil/python; \
--		CFLAGS= LDFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
-+		CFLAGS= $(PYTHON) setup.py $(SETUP_PY_Q) build_ext -i build
- 
- .PHONY: libbtrfsutil_python
- endif
meta/recipes-devtools/btrfs-tools/btrfs-tools/0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-devtools/btrfs-tools/btrfs-tools_5.1.bb +5 -1
index 8b4178d6dec..89cc1bfe20b 100644
@@ -18,6 +18,7 @@ SRCREV = "43013422dbce4bcc9ed77cfe65b294caa0985ec8"
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
            file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \
            file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \
+           file://0003-btrfs-progs-Pass-CFLAGS-and-LDFLAGS-to-Python.patch \
            "
 
 inherit autotools-brokensep pkgconfig manpages distutils3-base
@@ -27,7 +28,10 @@ CLEANBROKEN = "1"
 PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native"
 EXTRA_OECONF = " --disable-zstd"
 EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
-EXTRA_OEMAKE = "V=1"
+EXTRA_PYTHON_CFLAGS = "${DEBUG_PREFIX_MAP}"
+EXTRA_PYTHON_CFLAGS_class-native = ""
+EXTRA_PYTHON_LDFLAGS = "${LDFLAGS}"
+EXTRA_OEMAKE = "V=1 'EXTRA_PYTHON_CFLAGS=${EXTRA_PYTHON_CFLAGS}' 'EXTRA_PYTHON_LDFLAGS=${EXTRA_PYTHON_LDFLAGS}'"
 
 do_configure_prepend() {
 	# Upstream doesn't ship this and autoreconf won't install it as automake isn't used.
Signature · 1 line
2.21.0