Skip to contentSkip to conversation

libpjsip: fix static build failures due to name clash

PATCH New Luca Ceresoli 2 participants 3 messages Nov 11, 2017 – Nov 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libpjsip: fix static build failures due to name clash

Several packages have a similar md5.c file, and each has a function named byteReverse(). This generates link errors when building statically ("multiple definition of `byteReverse'").

Fix by applying a patch from upstream:
https://trac.pjsip.org/repos/changeset/5688

Fixes:
http://autobuild.buildroot.org/results/5d7/5d72e0f8517a555399978d5a0e9f7efd0a278189/
http://autobuild.buildroot.org/results/c47/c47ccbb9b40011cf0d79c7040bed061ddefd9629/
http://autobuild.buildroot.org/results/419/419ab2c0e034cc68991281c51caa8271b0fadbab/

---

Changes v1 -> v2:
- Add commit message and SoB line to patch file (Arnout)

---
 .../0001-Fixed-possible-function-name-clash.patch  | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/libpjsip/0001-Fixed-possible-function-name-clash.patch
package/libpjsip/0001-Fixed-possible-function-name-clash.patch new file +26 -0
new file mode 100644
index 000000000000..435b0eab548d
@@ -0,0 +1,26 @@
+Re #2059 (misc): Fixed possible function name clash with md5 due to non-static function.
+
+Backported from: https://trac.pjsip.org/repos/changeset/5688
+Signed-off-by: Luca Ceresoli <[email protected]>
+
+Index: pjlib-util/src/pjlib-util/md5.c
+===================================================================
+diff --git a/pjproject/pjlib-util/src/pjlib-util/md5.c b/pjproject/pjlib-util/src/pjlib-util/md5.c
+--- a/pjlib-util/src/pjlib-util/md5.c	(revision 5687)
++++ b/pjlib-util/src/pjlib-util/md5.c	(revision 5688)
+@@ -29,13 +29,13 @@
+ #ifndef HIGHFIRST
+ #define byteReverse(buf, len)	/* Nothing */
+ #else
+-void byteReverse(unsigned char *buf, unsigned longs);
++static void byteReverse(unsigned char *buf, unsigned longs);
+ 
+ #ifndef ASM_MD5
+ /*
+  * Note: this code is harmless on little-endian machines.
+  */
+-void byteReverse(unsigned char *buf, unsigned longs)
++static void byteReverse(unsigned char *buf, unsigned longs)
+ {
+     pj_uint32_t t;
+     do {
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 libpjsip: fix static build failures due to name clash

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

Several packages have a similar md5.c file, and each has a function named byteReverse(). This generates link errors when building statically ("multiple definition of `byteReverse'").

Fix by applying a patch from upstream:
https://trac.pjsip.org/repos/changeset/5688

Fixes:
http://autobuild.buildroot.org/results/5d7/5d72e0f8517a555399978d5a0e9f7efd0a278189/
http://autobuild.buildroot.org/results/c47/c47ccbb9b40011cf0d79c7040bed061ddefd9629/
http://autobuild.buildroot.org/results/419/419ab2c0e034cc68991281c51caa8271b0fadbab/

Quoted 7 lines

---

Changes v1 -> v2:
- Add commit message and SoB line to patch file (Arnout)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 1/1 libpjsip: fix static build failures due to name clash

In reply to Luca Ceresoli
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Luca" == Luca Ceresoli <[email protected]> writes:

Several packages have a similar md5.c file, and each has a function named byteReverse(). This generates link errors when building statically ("multiple definition of `byteReverse'").

Fix by applying a patch from upstream:
https://trac.pjsip.org/repos/changeset/5688

Fixes:
http://autobuild.buildroot.org/results/5d7/5d72e0f8517a555399978d5a0e9f7efd0a278189/
http://autobuild.buildroot.org/results/c47/c47ccbb9b40011cf0d79c7040bed061ddefd9629/
http://autobuild.buildroot.org/results/419/419ab2c0e034cc68991281c51caa8271b0fadbab/

Quoted 7 lines

---

Changes v1 -> v2:
- Add commit message and SoB line to patch file (Arnout)

Committed to 2017.02.x and 2017.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard