From patchwork Sun Dec 11 15:30:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Bedarkar X-Patchwork-Id: 704844 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 3tc91B3Tvcz9t0J for ; Mon, 12 Dec 2016 02:31:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C32CA8495E; Sun, 11 Dec 2016 15:31:22 +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 jyP7wRhoZcgA; Sun, 11 Dec 2016 15:31:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id CA98C84979; Sun, 11 Dec 2016 15:31:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 909061BFB1F for ; Sun, 11 Dec 2016 15:31:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8D51187036 for ; Sun, 11 Dec 2016 15:31:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IPmiuYaqRNdC for ; Sun, 11 Dec 2016 15:31:16 +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 hemlock.osuosl.org (Postfix) with ESMTP id 1241A87034 for ; Sun, 11 Dec 2016 15:31:16 +0000 (UTC) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Forcepoint Email with ESMTPS id E1765B82BAACC for ; Sun, 11 Dec 2016 15:31:08 +0000 (GMT) Received: from PUMAIL01.pu.imgtec.org (192.168.91.250) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.294.0; Sun, 11 Dec 2016 15:31:12 +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; Sun, 11 Dec 2016 21:01:10 +0530 From: Rahul Bedarkar To: Date: Sun, 11 Dec 2016 21:00:43 +0530 Message-ID: <1481470243-8813-1-git-send-email-rahul.bedarkar@imgtec.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 X-Originating-IP: [192.168.91.23] Cc: Rahul Bedarkar Subject: [Buildroot] [PATCH] acl: backport upstream patch to fix static build 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 building tar package with acl in static build configuration, we get definition clash error for 'quote' function. ../gnu/libgnu.a(quotearg.o): In function 'quote': quotearg.c:(.text+0x12fc): multiple definition of 'quote' ../sysroot/usr/lib/libacl.a(quote.o):/home/test/autobuild/run/instance-1/output/build/acl-2.2.52/libmisc/quote.c:27: first defined here In acl upstream, this is already fixed by renaming quote and unquote internal functions. This commit backports upstream patch. Fixes: http://autobuild.buildroot.net/results/d64/d64d13745c980d322d3b80c3b324d03eb7f17262 Signed-off-by: Rahul Bedarkar --- ...2-add-__acl_-prefixes-to-internal-symbols.patch | 292 +++++++++++++++++++++ 1 file changed, 292 insertions(+) create mode 100644 package/acl/0002-add-__acl_-prefixes-to-internal-symbols.patch diff --git a/package/acl/0002-add-__acl_-prefixes-to-internal-symbols.patch b/package/acl/0002-add-__acl_-prefixes-to-internal-symbols.patch new file mode 100644 index 0000000..f9a5d9b --- /dev/null +++ b/package/acl/0002-add-__acl_-prefixes-to-internal-symbols.patch @@ -0,0 +1,292 @@ +From debbe4f7b591b3f35d0ed65c17fa81b196b2eb2d Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Tue, 12 Aug 2014 08:37:25 -0400 +Subject: [PATCH] add __acl_ prefixes to internal symbols + +When static linking libacl, people sometimes run into symbol collisions +because their own code defines symbols like "quote". So for acl internal +symbols, use an __acl_ prefix. + +[Rahul Bedarkar: backported from upstream + http://git.savannah.gnu.org/cgit/acl.git/commit/?id=a2c4d71c2e84419a49db503ed59de4d3d1dca7dd ] +Signed-off-by: Rahul Bedarkar +--- + exports | 12 ++---------- + getfacl/getfacl.c | 4 ++-- + include/misc.h | 8 ++++---- + libacl/__acl_to_any_text.c | 4 ++-- + libacl/acl_from_text.c | 4 ++-- + libmisc/high_water_alloc.c | 2 +- + libmisc/next_line.c | 6 +++--- + libmisc/quote.c | 4 ++-- + libmisc/unquote.c | 2 +- + setfacl/parse.c | 10 +++++----- + setfacl/setfacl.c | 4 ++-- + 11 files changed, 26 insertions(+), 34 deletions(-) + +diff --git a/exports b/exports +index 7d8e69e..bf15d84 100644 +--- a/exports ++++ b/exports +@@ -59,22 +59,14 @@ ACL_1.0 { + acl_to_any_text; + + local: +- # Library internal stuff ++ # Library internal stuff + __new_var_obj_p; + __new_obj_p_here; + __free_obj_p; + __check_obj_p; + __ext2int_and_check; +- __acl_reorder_entry_obj_p; +- __acl_reorder_obj_p; +- __acl_init_obj; +- __acl_create_entry_obj; +- __acl_free_acl_obj; +- __acl_to_any_text; ++ __acl_*; + __apply_mask_to_mode; +- +- quote; +- unquote; + }; + + ACL_1.1 { +diff --git a/getfacl/getfacl.c b/getfacl/getfacl.c +index f8eaf25..af9e225 100644 +--- a/getfacl/getfacl.c ++++ b/getfacl/getfacl.c +@@ -90,7 +90,7 @@ int opt_numeric; /* don't convert id's to symbolic names */ + + static const char *xquote(const char *str, const char *quote_chars) + { +- const char *q = quote(str, quote_chars); ++ const char *q = __acl_quote(str, quote_chars); + if (q == NULL) { + fprintf(stderr, "%s: %s\n", progname, strerror(errno)); + exit(1); +@@ -718,7 +718,7 @@ int main(int argc, char *argv[]) + do { + if (optind == argc || + strcmp(argv[optind], "-") == 0) { +- while ((line = next_line(stdin)) != NULL) { ++ while ((line = __acl_next_line(stdin)) != NULL) { + if (*line == '\0') + continue; + +diff --git a/include/misc.h b/include/misc.h +index 0c5fdcc..c25accf 100644 +--- a/include/misc.h ++++ b/include/misc.h +@@ -15,9 +15,9 @@ + along with this program. If not, see . + */ + +-extern int high_water_alloc(void **buf, size_t *bufsize, size_t newsize); ++extern int __acl_high_water_alloc(void **buf, size_t *bufsize, size_t newsize); + +-extern const char *quote(const char *str, const char *quote_chars); +-extern char *unquote(char *str); ++extern const char *__acl_quote(const char *str, const char *quote_chars); ++extern char *__acl_unquote(char *str); + +-extern char *next_line(FILE *file); ++extern char *__acl_next_line(FILE *file); +diff --git a/libacl/__acl_to_any_text.c b/libacl/__acl_to_any_text.c +index a4f9c34..19f1ccc 100644 +--- a/libacl/__acl_to_any_text.c ++++ b/libacl/__acl_to_any_text.c +@@ -159,7 +159,7 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char *text_p, ssize_t size, + if (options & TEXT_NUMERIC_IDS) + str = NULL; + else +- str = quote(user_name( ++ str = __acl_quote(user_name( + entry_obj_p->eid.qid), ":, \t\n\r"); + if (str != NULL) { + strncpy(text_p, str, size); +@@ -182,7 +182,7 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char *text_p, ssize_t size, + if (options & TEXT_NUMERIC_IDS) + str = NULL; + else +- str = quote(group_name( ++ str = __acl_quote(group_name( + entry_obj_p->eid.qid), ":, \t\n\r"); + if (str != NULL) { + strncpy(text_p, str, size); +diff --git a/libacl/acl_from_text.c b/libacl/acl_from_text.c +index 1e05322..f6165be 100644 +--- a/libacl/acl_from_text.c ++++ b/libacl/acl_from_text.c +@@ -206,7 +206,7 @@ parse_acl_entry(const char **text_p, acl_t *acl_p) + str = get_token(text_p); + if (str) { + entry_obj.etag = ACL_USER; +- error = get_uid(unquote(str), ++ error = get_uid(__acl_unquote(str), + &entry_obj.eid.qid); + free(str); + if (error) { +@@ -225,7 +225,7 @@ parse_acl_entry(const char **text_p, acl_t *acl_p) + str = get_token(text_p); + if (str) { + entry_obj.etag = ACL_GROUP; +- error = get_gid(unquote(str), ++ error = get_gid(__acl_unquote(str), + &entry_obj.eid.qid); + free(str); + if (error) { +diff --git a/libmisc/high_water_alloc.c b/libmisc/high_water_alloc.c +index c127dc1..951f4bb 100644 +--- a/libmisc/high_water_alloc.c ++++ b/libmisc/high_water_alloc.c +@@ -21,7 +21,7 @@ + #include + #include "misc.h" + +-int high_water_alloc(void **buf, size_t *bufsize, size_t newsize) ++int __acl_high_water_alloc(void **buf, size_t *bufsize, size_t newsize) + { + #define CHUNK_SIZE 256 + /* +diff --git a/libmisc/next_line.c b/libmisc/next_line.c +index 0566d7a..126a364 100644 +--- a/libmisc/next_line.c ++++ b/libmisc/next_line.c +@@ -23,7 +23,7 @@ + + #define LINE_SIZE getpagesize() + +-char *next_line(FILE *file) ++char *__acl_next_line(FILE *file) + { + static char *line; + static size_t line_size; +@@ -31,7 +31,7 @@ char *next_line(FILE *file) + int eol = 0; + + if (!line) { +- if (high_water_alloc((void **)&line, &line_size, LINE_SIZE)) ++ if (__acl_high_water_alloc((void **)&line, &line_size, LINE_SIZE)) + return NULL; + } + c = line; +@@ -47,7 +47,7 @@ char *next_line(FILE *file) + if (feof(file)) + break; + if (!eol) { +- if (high_water_alloc((void **)&line, &line_size, ++ if (__acl_high_water_alloc((void **)&line, &line_size, + 2 * line_size)) + return NULL; + c = strrchr(line, '\0'); +diff --git a/libmisc/quote.c b/libmisc/quote.c +index bf8f9eb..a28800c 100644 +--- a/libmisc/quote.c ++++ b/libmisc/quote.c +@@ -23,7 +23,7 @@ + #include + #include "misc.h" + +-const char *quote(const char *str, const char *quote_chars) ++const char *__acl_quote(const char *str, const char *quote_chars) + { + static char *quoted_str; + static size_t quoted_str_len; +@@ -40,7 +40,7 @@ const char *quote(const char *str, const char *quote_chars) + if (nonpr == 0) + return str; + +- if (high_water_alloc((void **)"ed_str, "ed_str_len, ++ if (__acl_high_water_alloc((void **)"ed_str, "ed_str_len, + (s - (unsigned char *)str) + nonpr * 3 + 1)) + return NULL; + for (s = (unsigned char *)str, q = quoted_str; *s != '\0'; s++) { +diff --git a/libmisc/unquote.c b/libmisc/unquote.c +index bffebf9..4f4ce7c 100644 +--- a/libmisc/unquote.c ++++ b/libmisc/unquote.c +@@ -22,7 +22,7 @@ + #include + #include "misc.h" + +-char *unquote(char *str) ++char *__acl_unquote(char *str) + { + unsigned char *s, *t; + +diff --git a/setfacl/parse.c b/setfacl/parse.c +index e7e6add..7433459 100644 +--- a/setfacl/parse.c ++++ b/setfacl/parse.c +@@ -226,7 +226,7 @@ user_entry: + str = get_token(text_p); + if (str) { + cmd->c_tag = ACL_USER; +- error = get_uid(unquote(str), &cmd->c_id); ++ error = get_uid(__acl_unquote(str), &cmd->c_id); + free(str); + if (error) { + *text_p = backup; +@@ -245,7 +245,7 @@ user_entry: + str = get_token(text_p); + if (str) { + cmd->c_tag = ACL_GROUP; +- error = get_gid(unquote(str), &cmd->c_id); ++ error = get_gid(__acl_unquote(str), &cmd->c_id); + free(str); + if (error) { + *text_p = backup; +@@ -466,7 +466,7 @@ read_acl_comments( + if (strncmp(cp, "file:", 5) == 0) { + cp += 5; + SKIP_WS(cp); +- cp = unquote(cp); ++ cp = __acl_unquote(cp); + + if (path_p) { + if (*path_p) +@@ -483,7 +483,7 @@ read_acl_comments( + if (uid_p) { + if (*uid_p != ACL_UNDEFINED_ID) + goto fail; +- if (get_uid(unquote(cp), uid_p) != 0) ++ if (get_uid(__acl_unquote(cp), uid_p) != 0) + continue; + } + } else if (strncmp(cp, "group:", 6) == 0) { +@@ -493,7 +493,7 @@ read_acl_comments( + if (gid_p) { + if (*gid_p != ACL_UNDEFINED_ID) + goto fail; +- if (get_gid(unquote(cp), gid_p) != 0) ++ if (get_gid(__acl_unquote(cp), gid_p) != 0) + continue; + } + } else if (strncmp(cp, "flags:", 6) == 0) { +diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c +index 81062a6..fb2d172 100644 +--- a/setfacl/setfacl.c ++++ b/setfacl/setfacl.c +@@ -92,7 +92,7 @@ int promote_warning; + + static const char *xquote(const char *str, const char *quote_chars) + { +- const char *q = quote(str, quote_chars); ++ const char *q = __acl_quote(str, quote_chars); + if (q == NULL) { + fprintf(stderr, "%s: %s\n", progname, strerror(errno)); + exit(1); +@@ -311,7 +311,7 @@ int next_file(const char *arg, seq_t seq) + args.seq = seq; + + if (strcmp(arg, "-") == 0) { +- while ((line = next_line(stdin))) ++ while ((line = __acl_next_line(stdin))) + errors = walk_tree(line, walk_flags, 0, do_set, &args); + if (!feof(stdin)) { + fprintf(stderr, _("%s: Standard input: %s\n"), +-- +2.6.2 +