Skip to contentSkip to conversation

libfdt: Fix build with swig 4.3.0

PATCH In review Rudi Heitbaum 4 participants 5 messages Oct 26, 2024 – Nov 6, 2024 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfdt: Fix build with swig 4.3.0

Call SWIG_AppendOutput instead of SWIG_Python_AppendOutput so that is_void is handled within swig.

---
 scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/dtc/pylibfdt/libfdt.i_shipped +3 -3
index 56cc5d48f4..e4659489a9 100644
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
 			fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
 		buff = PyByteArray_FromStringAndSize(
 			(const char *)($1 + 1), fdt32_to_cpu($1->len));
-		resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+		resultobj = SWIG_AppendOutput(resultobj, buff);
 	}
 }
 
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;
 
 %typemap(argout) int *depth {
         PyObject *val = Py_BuildValue("i", *arg$argnum);
-        resultobj = SWIG_Python_AppendOutput(resultobj, val);
+        resultobj = SWIG_AppendOutput(resultobj, val);
 }
 
 %apply int *depth { int *depth };
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
            if (PyTuple_GET_SIZE(resultobj) == 0)
               resultobj = val;
            else
-              resultobj = SWIG_Python_AppendOutput(resultobj, val);
+              resultobj = SWIG_AppendOutput(resultobj, val);
         }
 }
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Rudi Heitbaum

Call SWIG_AppendOutput instead of SWIG_Python_AppendOutput so that is_void is handled within swig.

Dtc is a separate project at
https://git.kernel.org/pub/scm/utils/dtc/dtc.git, so the patch should be rebased against it and sent to [email protected].

Quoted 35 lines

---
 scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
index 56cc5d48f4..e4659489a9 100644
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
  			fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));

  buff = PyByteArray_FromStringAndSize(
  (const char *)($1 + 1), fdt32_to_cpu($1->len));

scripts/dtc/pylibfdt/libfdt.i_shipped +1 -1
-		resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+		resultobj = SWIG_AppendOutput(resultobj, buff);

  }
 }

scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;


 %typemap(argout) int *depth {
         PyObject *val = Py_BuildValue("i", *arg$argnum); -        resultobj = SWIG_Python_AppendOutput(resultobj, val); +        resultobj = SWIG_AppendOutput(resultobj, val); }

 %apply int *depth { int *depth };

scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
             if (PyTuple_GET_SIZE(resultobj) == 0)
                resultobj = val;

            else
-              resultobj = SWIG_Python_AppendOutput(resultobj, val); +              resultobj = SWIG_AppendOutput(resultobj, val); }
 }

Signature · 2 lines
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University
#2 lore raw
Quoted 11 lines · Xi Ruoyao
Quoted 6 lines · Rudi Heitbaum

Call SWIG_AppendOutput instead of SWIG_Python_AppendOutput so that is_void is handled within swig.

Dtc is a separate project at
https://git.kernel.org/pub/scm/utils/dtc/dtc.git, so the patch should be rebased against it and sent to [email protected].

Looks like someone independently fixed it upstream:

    https://github.com/dgibson/dtc/pull/154

I'm doing final tests now and expect to merge shortly.

Quoted 37 lines
Quoted 36 lines

---
 scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---

 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
index 56cc5d48f4..e4659489a9 100644
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
  			fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));

  buff = PyByteArray_FromStringAndSize(
  (const char *)($1 + 1), fdt32_to_cpu($1->len));

scripts/dtc/pylibfdt/libfdt.i_shipped +1 -1
-		resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+		resultobj = SWIG_AppendOutput(resultobj, buff);

  }
 }

scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;


 %typemap(argout) int *depth {
         PyObject *val = Py_BuildValue("i", *arg$argnum); -        resultobj = SWIG_Python_AppendOutput(resultobj, val); +        resultobj = SWIG_AppendOutput(resultobj, val); }

 %apply int *depth { int *depth };

scripts/dtc/pylibfdt/libfdt.i_shipped +0 -0
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
             if (PyTuple_GET_SIZE(resultobj) == 0)
                resultobj = val;

            else
-              resultobj = SWIG_Python_AppendOutput(resultobj, val); +              resultobj = SWIG_AppendOutput(resultobj, val); }
 }

Signature · 4 lines
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
maintainer
#3 lore raw
Quoted 10 lines · David Gibson
Quoted 8 lines · Xi Ruoyao
Quoted 6 lines · Rudi Heitbaum

Call SWIG_AppendOutput instead of SWIG_Python_AppendOutput so that is_void is handled within swig.

Quoted 8 lines
Quoted 3 lines

Dtc is a separate project at
https://git.kernel.org/pub/scm/utils/dtc/dtc.git, so the patch should be rebased against it and sent to [email protected].

Looks like someone independently fixed it upstream:

    https://github.com/dgibson/dtc/pull/154

I'm doing final tests now and expect to merge shortly.

Would be good to tag a release too, so that distros have something to pick up when they update swig.

Rob

#4 lore raw
Quoted 16 lines · Rob Herring
Quoted 14 lines · David Gibson
Quoted 11 lines · Xi Ruoyao
Quoted 6 lines · Rudi Heitbaum

Call SWIG_AppendOutput instead of SWIG_Python_AppendOutput so that is_void is handled within swig.

Dtc is a separate project at
https://git.kernel.org/pub/scm/utils/dtc/dtc.git, so the patch should be rebased against it and sent to [email protected].

Quoted 7 lines
Quoted 4 lines

Looks like someone independently fixed it upstream:

    https://github.com/dgibson/dtc/pull/154

I'm doing final tests now and expect to merge shortly.

Would be good to tag a release too, so that distros have something to pick up when they update swig.

Done.

Signature · 4 lines
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson