From patchwork Tue Sep 26 17:24:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 23158 Received: (qmail 3253 invoked by alias); 26 Sep 2017 17:24:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3235 invoked by uid 89); 26 Sep 2017 17:24:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pg0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cVqlc5OVB4guCd48X71Gj8dp2SrsRBl4b4mWpEcC+1A=; b=ptAyn43CWcbp5bY/ILhKQ5kAONDHx8M1Zuq95XPgir9BJsA7nlTZY/sYYaOmfl13fW 5trWqNdqfn4GFRYb7NIIl9VQuDzZ2cLaoKdeZc3ebZ90Y1mbSmMEAimfNQqya2GBYmvO oYYdfkclM4nc1p/YkpBLeffMfO3TPZIuleIFJE0iPW7T5CmIXblXVVF0QL81Ss4i6FsB JdcKxMRRgDEKDwZRBtW1JjKswJ/hXlkAB/lnklL6Q9zod6mSheBvCzhIiBsLvedwtkqL /2DVlDLc/B7QTxq/MyfANLWCmT0yvniCw1qGM93WBXknMjB//HEle7vNekyOXhn0KJuN zXOw== X-Gm-Message-State: AHPjjUjaiPyLkhYmVKz1FyaH17d0M4w9LsHlEWKH2oXG1azoXR2zZ7a2 2NOedNmltiDcLhe94hnhrvhydnWJ+V4= X-Google-Smtp-Source: AOwi7QCltElPUQP/U42K6x7JQENw1Kwoh45nUpyTbGPwqM3LPNVkaA5UvTw8lqPbZ8L66hfQ7jHmQg== X-Received: by 10.98.189.26 with SMTP id a26mr11755157pff.260.1506446673513; Tue, 26 Sep 2017 10:24:33 -0700 (PDT) Subject: Re: [PATCH v2 1/2] posix: Add compat glob symbol to not follow dangling symbols To: Andreas Schwab Cc: Paul Eggert , Gnulib bugs , libc-alpha@sourceware.org References: <1505745774-29303-1-git-send-email-adhemerval.zanella@linaro.org> <40122a83-2f5f-3d3c-9665-d680e5141cf9@cs.ucla.edu> <834f27ab-310d-c976-207e-683509a5eac1@linaro.org> <93fa2661-dcc1-860d-2f91-d5f528786620@linaro.org> <85e6792f-756b-0077-afb6-96f42c8840a0@cs.ucla.edu> <70a013de-f280-1f28-a11d-24edaa69c0d1@linaro.org> From: Adhemerval Zanella Message-ID: <5670d897-2b84-6a7d-5aa8-cb0045195f05@linaro.org> Date: Tue, 26 Sep 2017 10:24:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: On 26/09/2017 08:29, Andreas Schwab wrote: > Current version of make won't build against this (undefined reference to > __alloca from included glob sources). > > Andreas. > I am not very familiar of the process to incorporate gnulib code in external projects, but I see other possible issues that would need to be fixed as well: * FLEXIBLE_ARRAY_MEMBER definition for !__LIBC. * __glob_pattern_type duplicated prototype. * __set_errno and mempcpy definition. I could build gnumake with forced internal glob implementation (make_cv_sys_gnu_glob=no) with the patch following patch. Looking gnulib I am not sure if the correct way to use mempcpy for !_LIBC. diff --git a/posix/glob.c b/posix/glob.c index 98122dac88..31e3aba4dd 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -65,11 +65,15 @@ # define __stat64(fname, buf) stat (fname, buf) # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag) # define struct_stat64 struct stat -# ifndef __MVS__ -# define __alloca alloca -# endif +# define __alloca alloca # define __readdir readdir +# define FLEXIBLE_ARRAY_MEMBER 0 # define COMPILE_GLOB64 +static inline void * +mempcpy (void *dest, const void *src, size_t n) +{ + return memcpy (dest, src, n) + n; +} #endif /* _LIBC */ #include @@ -230,8 +234,6 @@ glob_use_alloca (size_t alloca_used, size_t len) static int glob_in_dir (const char *pattern, const char *directory, int flags, int (*errfunc) (const char *, int), glob_t *pglob, size_t alloca_used); -extern int __glob_pattern_type (const char *pattern, int quote) - attribute_hidden; static int prefix_array (const char *prefix, char **array, size_t n) __THROWNL; static int collated_compare (const void *, const void *) __THROWNL;