From patchwork Tue Nov 8 18:36:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Bedarkar X-Patchwork-Id: 692432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tCyj968xMz9t2b for ; Wed, 9 Nov 2016 05:37:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D70D88CB00; Tue, 8 Nov 2016 18:37:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U1NLoun7oFTh; Tue, 8 Nov 2016 18:37:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 860BE8CAAC; Tue, 8 Nov 2016 18:37:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id ED3D71CE950 for ; Tue, 8 Nov 2016 18:37:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E9F1E8CA9F for ; Tue, 8 Nov 2016 18:37:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id be3YqUJB802a for ; Tue, 8 Nov 2016 18:37:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by whitealder.osuosl.org (Postfix) with ESMTP id 311558CA96 for ; Tue, 8 Nov 2016 18:37:26 +0000 (UTC) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id D00297342493E for ; Tue, 8 Nov 2016 18:37:19 +0000 (GMT) Received: from HHMAIL-X.hh.imgtec.org (10.100.10.113) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 8 Nov 2016 18:37:23 +0000 Received: from PUMAIL01.pu.imgtec.org (192.168.91.250) by HHMAIL-X.hh.imgtec.org (10.100.10.113) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 8 Nov 2016 18:37:23 +0000 Received: from pudesk287-linux.pu.imgtec.org (192.168.91.23) by PUMAIL01.pu.imgtec.org (192.168.91.250) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 9 Nov 2016 00:07:20 +0530 From: Rahul Bedarkar To: Date: Wed, 9 Nov 2016 00:06:42 +0530 Message-ID: <1478630202-1630-2-git-send-email-rahul.bedarkar@imgtec.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1478630202-1630-1-git-send-email-rahul.bedarkar@imgtec.com> References: <1478630202-1630-1-git-send-email-rahul.bedarkar@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.91.23] Cc: Rahul Bedarkar Subject: [Buildroot] [PATCH 2/2] wget: fix static link with gnutls X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When statically linking with gnutls, we get definition clash error for base64_encode which is also defined by gnutls. This commit adds patch to rename base64_{encode,decode} defined in wget. Signed-off-by: Rahul Bedarkar --- .../0001-utils-rename-base64_-encode-decode.patch | 134 +++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 package/wget/0001-utils-rename-base64_-encode-decode.patch diff --git a/package/wget/0001-utils-rename-base64_-encode-decode.patch b/package/wget/0001-utils-rename-base64_-encode-decode.patch new file mode 100644 index 0000000..f219afa --- /dev/null +++ b/package/wget/0001-utils-rename-base64_-encode-decode.patch @@ -0,0 +1,134 @@ +From 9e68787576fec304da23af26dca963a4cdea7765 Mon Sep 17 00:00:00 2001 +From: Rahul Bedarkar +Date: Tue, 8 Nov 2016 23:42:53 +0530 +Subject: [PATCH] utils: rename base64_{encode,decode} + +When statically linking with gnutls, we get definition clash error for +base64_encode which is also defined by gnutls. + +/home/rahul.bedarkar/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libgnutls.a(base64.o): In function `base64_encode': +base64.c:(.text+0x148): multiple definition of `base64_encode' +utils.o:utils.c:(.text+0x4378): first defined here +collect2: error: ld returned 1 exit status + +To prevent definition clash, rename base64_{encode,decode} + +Signed-off-by: Rahul Bedarkar +--- + src/http-ntlm.c | 6 +++--- + src/http.c | 4 ++-- + src/utils.c | 8 ++++---- + src/utils.h | 4 ++-- + 4 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/http-ntlm.c b/src/http-ntlm.c +index 56c40ae..87f5a37 100644 +--- a/src/http-ntlm.c ++++ b/src/http-ntlm.c +@@ -122,7 +122,7 @@ ntlm_input (struct ntlmdata *ntlm, const char *header) + + DEBUGP (("Received a type-2 NTLM message.\n")); + +- size = base64_decode (header, buffer); ++ size = wget_base64_decode (header, buffer); + if (size < 0) + return false; /* malformed base64 from server */ + +@@ -411,7 +411,7 @@ ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd, + size = 32 + hostlen + domlen; + + base64 = (char *) alloca (BASE64_LENGTH (size) + 1); +- base64_encode (ntlmbuf, size, base64); ++ wget_base64_encode (ntlmbuf, size, base64); + + output = concat_strings ("NTLM ", base64, (char *) 0); + break; +@@ -584,7 +584,7 @@ ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd, + + /* convert the binary blob into base64 */ + base64 = (char *) alloca (BASE64_LENGTH (size) + 1); +- base64_encode (ntlmbuf, size, base64); ++ wget_base64_encode (ntlmbuf, size, base64); + + output = concat_strings ("NTLM ", base64, (char *) 0); + +diff --git a/src/http.c b/src/http.c +index 7e60a07..368d30d 100644 +--- a/src/http.c ++++ b/src/http.c +@@ -2818,7 +2818,7 @@ metalink_from_http (const struct response *resp, const struct http_stat *hs, + char *bin_hash = alloca (dig_hash_str_len * 3 / 4 + 1); + size_t hash_bin_len; + +- hash_bin_len = base64_decode (dig_hash, bin_hash); ++ hash_bin_len = wget_base64_decode (dig_hash, bin_hash); + + /* One slot for me, one for zero-termination. */ + mfile->checksums = +@@ -4546,7 +4546,7 @@ basic_authentication_encode (const char *user, const char *passwd) + sprintf (t1, "%s:%s", user, passwd); + + t2 = (char *)alloca (BASE64_LENGTH (len1) + 1); +- base64_encode (t1, len1, t2); ++ wget_base64_encode (t1, len1, t2); + + return concat_strings ("Basic ", t2, (char *) 0); + } +diff --git a/src/utils.c b/src/utils.c +index b07da9f..355f0ce 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -2140,7 +2140,7 @@ xsleep (double seconds) + base64 data. */ + + size_t +-base64_encode (const void *data, size_t length, char *dest) ++wget_base64_encode (const void *data, size_t length, char *dest) + { + /* Conversion table. */ + static const char tbl[64] = { +@@ -2208,7 +2208,7 @@ base64_encode (const void *data, size_t length, char *dest) + This function originates from Free Recode. */ + + ssize_t +-base64_decode (const char *base64, void *dest) ++wget_base64_decode (const char *base64, void *dest) + { + /* Table of base64 values for first 128 characters. Note that this + assumes ASCII (but so does Wget in other places). */ +@@ -2588,7 +2588,7 @@ wg_pubkey_pem_to_der (const char *pem, unsigned char **der, size_t *der_len) + + base64data = xmalloc (BASE64_LENGTH(stripped_pem_count)); + +- size = base64_decode (stripped_pem, base64data); ++ size = wget_base64_decode (stripped_pem, base64data); + + if (size < 0) { + xfree (base64data); /* malformed base64 from server */ +@@ -2651,7 +2651,7 @@ wg_pin_peer_pubkey (const char *pinnedpubkey, const char *pubkey, size_t pubkeyl + end_pos[0] = '\0'; + + /* decode base64 pinnedpubkey, 8 is length of "sha256//" */ +- decoded_hash_length = base64_decode (begin_pos + 8, expectedsha256sumdigest); ++ decoded_hash_length = wget_base64_decode (begin_pos + 8, expectedsha256sumdigest); + /* if valid base64, compare sha256 digests directly */ + if (SHA256_DIGEST_SIZE == decoded_hash_length && + !memcmp (sha256sumdigest, expectedsha256sumdigest, SHA256_DIGEST_SIZE)) { +diff --git a/src/utils.h b/src/utils.h +index f224b73..aaac730 100644 +--- a/src/utils.h ++++ b/src/utils.h +@@ -140,8 +140,8 @@ void xsleep (double); + /* How many bytes it will take to store LEN bytes in base64. */ + #define BASE64_LENGTH(len) (4 * (((len) + 2) / 3)) + +-size_t base64_encode (const void *, size_t, char *); +-ssize_t base64_decode (const char *, void *); ++size_t wget_base64_encode (const void *, size_t, char *); ++ssize_t wget_base64_decode (const char *, void *); + + #ifdef HAVE_LIBPCRE + void *compile_pcre_regex (const char *); +-- +2.6.2 +