{"id":807314,"url":"http://patchwork.ozlabs.org/api/1.2/patches/807314/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1708292108150.23565@digraph.polyomino.org.uk/","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.2/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<alpine.DEB.2.20.1708292108150.23565@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-08-29T21:08:32","name":"Fix m68k bits/math-inline.h macro namespace (bug 22035) [committed]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d854cffecddd4faa52a2c56a908a225fd0880aa7","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/1.2/people/4349/?format=json","name":"Joseph Myers","email":"joseph@codesourcery.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/alpine.DEB.2.20.1708292108150.23565@digraph.polyomino.org.uk/mbox/","series":[{"id":478,"url":"http://patchwork.ozlabs.org/api/1.2/series/478/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/list/?series=478","date":"2017-08-29T21:08:32","name":"Fix m68k bits/math-inline.h macro namespace (bug 22035) [committed]","version":1,"mbox":"http://patchwork.ozlabs.org/series/478/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/807314/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807314/checks/","tags":{},"related":[],"headers":{"Return-Path":"<libc-alpha-return-83848-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83848-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"jpswU+zD\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhh822lzJz9ryT\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 07:08:50 +1000 (AEST)","(qmail 66258 invoked by alias); 29 Aug 2017 21:08:44 -0000","(qmail 64766 invoked by uid 89); 29 Aug 2017 21:08:43 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; q=dns; s=default; b=xAHQsq15ska6NY1HpLAc3byW3nzPX\n\tLKxr8Dxds7TStkVDgBs5MxA/8cjEFtVsJdlHyNQXBHRrgTA7/FeRUOXCFF3RMJpp\n\tZe/Tt56pDfzysTu+TbQ5WHFkaplyWxa2QzTR7B0IzpXPvYwQkY7L+jU0Ce8MBFG5\n\tOnd4xOroDJ3+28=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:subject:message-id:mime-version\n\t:content-type; s=default; bh=VKMqyM8Pc7dKJ4h5SooNt5YCBic=; b=jps\n\twU+zDKQeoBEFjac1MZ+qcfUq3KpyXQRJsBXiCSrjQCZScCTqUWHYqVWxo9d8j8SS\n\t4iuxx8O6fUK6NKLWW+lCSX4GyrQYv6Vdo0KJzQbGb6MitaibDVAFTJssJTMqTBOp\n\t5+v6k5e4c8drLpIa9LFPQI0XVCeVwafKe67jsRf4=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.5 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=","X-HELO":"relay1.mentorg.com","Date":"Tue, 29 Aug 2017 21:08:32 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"<libc-alpha@sourceware.org>","Subject":"Fix m68k bits/math-inline.h macro namespace (bug 22035) [committed]","Message-ID":"<alpine.DEB.2.20.1708292108150.23565@digraph.polyomino.org.uk>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"},"content":"As shown by build bot failures\n<https://sourceware.org/ml/libc-testresults/2017-q3/msg00349.html> the\nm68k bits/mathinline.h is not namespace-clean: it fails to compile if\nthe user has defined macros f or l before it is included, because of\nexpansions of those arguments to __inline_functions.  This patch\nchanges the __inline_functions definitions to take not the suffix but\na macro that concatenates it with the function name, to avoid the\nspurious macro expansions.\n\nTested for m68k with build-many-glibcs.py.  Committed.\n\n2017-08-29  Joseph Myers  <joseph@codesourcery.com>\n\n\t[BZ #22035]\n\t* sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__inline_functions):\n\tDefine to take a second argument that is a macro that\n\tconcatentates a suffix, not the suffix itself.\n\t(__CONCAT_d): New macro.\n\t(__CONCAT_f): Likewise.\n\t(__CONCAT_l): Likewise.","diff":"diff --git a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h\nindex 8e6bdc4..b92b1f8 100644\n--- a/sysdeps/m68k/m680x0/fpu/bits/mathinline.h\n+++ b/sysdeps/m68k/m680x0/fpu/bits/mathinline.h\n@@ -195,11 +195,11 @@ __inline_mathop(trunc, intrz)\n #endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */\n \n /* This macro contains the definition for the rest of the inline\n-   functions, using FLOAT_TYPE as the domain type and S as the suffix\n-   for the function names.  */\n+   functions, using FLOAT_TYPE as the domain type and M as a macro\n+   that adds the suffix for the function names.  */\n \n-#define __inline_functions(float_type, s)\t\t\t\t  \\\n-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))\t  \\\n+#define __inline_functions(float_type, m)\t\t\t\t  \\\n+__m81_defun (float_type, m(__floor), (float_type __x))\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   float_type __result;\t\t\t\t\t\t\t  \\\n   unsigned long int __ctrl_reg;\t\t\t\t\t\t  \\\n@@ -215,7 +215,7 @@ __m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))\t  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\t\t\t\t\t\t\t\t\t  \\\n \t\t\t\t\t\t\t\t\t  \\\n-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))\t  \t  \\\n+__m81_defun (float_type, m(__ceil), (float_type __x))\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   float_type __result;\t\t\t\t\t\t\t  \\\n   unsigned long int __ctrl_reg;\t\t\t\t\t\t  \\\n@@ -231,17 +231,20 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))\t  \t  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\n \n-__inline_functions(double,)\n+#define __CONCAT_d(arg) arg\n+#define __CONCAT_f(arg) arg ## f\n+#define __CONCAT_l(arg) arg ## l\n+__inline_functions(double, __CONCAT_d)\n #ifdef __USE_ISOC99\n-__inline_functions(float,f)\n-__inline_functions(long double,l)\n+__inline_functions(float, __CONCAT_f)\n+__inline_functions(long double, __CONCAT_l)\n #endif\n #undef __inline_functions\n \n #ifdef __USE_MISC\n \n-# define __inline_functions(float_type, s)\t\t\t\t  \\\n-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value))\t  \t  \\\n+# define __inline_functions(float_type, m)\t\t\t\t  \\\n+__m81_defun (int, m(__isinf), (float_type __value))\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   /* There is no branch-condition for infinity,\t\t\t\t  \\\n      so we must extract and examine the condition codes manually.  */\t  \\\n@@ -251,7 +254,7 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value))\t  \t  \\\n   return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0;\t  \\\n }\t\t\t\t\t\t\t\t\t  \\\n \t\t\t\t\t\t\t\t\t  \\\n-__m81_defun (int, __CONCAT(__finite,s), (float_type __value))\t  \t  \\\n+__m81_defun (int, m(__finite), (float_type __value))\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   /* There is no branch-condition for infinity, so we must extract and\t  \\\n      examine the condition codes manually.  */\t\t\t\t  \\\n@@ -261,7 +264,7 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value))\t  \t  \\\n   return (__fpsr & (3 << 24)) == 0;\t\t\t\t\t  \\\n }\t\t\t\t\t\t\t\t\t  \\\n \t\t\t\t\t\t\t\t\t  \\\n-__m81_defun (float_type, __CONCAT(__scalbn,s),\t\t\t\t  \\\n+__m81_defun (float_type, m(__scalbn),\t\t\t\t\t  \\\n \t     (float_type __x, int __n))\t\t\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   float_type __result;\t\t\t\t\t\t\t  \\\n@@ -270,17 +273,17 @@ __m81_defun (float_type, __CONCAT(__scalbn,s),\t\t\t\t  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\n \n-__inline_functions(double,)\n-__inline_functions(float,f)\n-__inline_functions(long double,l)\n+__inline_functions(double, __CONCAT_d)\n+__inline_functions(float, __CONCAT_f)\n+__inline_functions(long double, __CONCAT_l)\n # undef __inline_functions\n \n #endif /* Use misc.  */\n \n #if defined __USE_MISC || defined __USE_XOPEN\n \n-# define __inline_functions(float_type, s)\t\t\t\t  \\\n-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value))\t  \t  \\\n+# define __inline_functions(float_type, m)\t\t\t\t  \\\n+__m81_defun (int, m(__isnan), (float_type __value))\t\t  \t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   char __result;\t\t\t\t\t\t\t  \\\n   __asm (\"ftst%.x %1\\n\"\t\t\t\t\t\t\t  \\\n@@ -288,10 +291,10 @@ __m81_defun (int, __CONCAT(__isnan,s), (float_type __value))\t  \t  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\n \n-__inline_functions(double,)\n+__inline_functions(double, __CONCAT_d)\n # ifdef __USE_MISC\n-__inline_functions(float,f)\n-__inline_functions(long double,l)\n+__inline_functions(float, __CONCAT_f)\n+__inline_functions(long double, __CONCAT_l)\n # endif\n # undef __inline_functions\n \n@@ -299,14 +302,14 @@ __inline_functions(long double,l)\n \n #ifdef __USE_ISOC99\n \n-# define __inline_functions(float_type, s)\t\t\t\t  \\\n-__m81_defun (float_type, __CONCAT(__scalbln,s),\t\t\t  \\\n+# define __inline_functions(float_type, m)\t\t\t\t  \\\n+__m81_defun (float_type, m(__scalbln),\t\t\t\t\t  \\\n \t     (float_type __x, long int __n))\t\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n-  return __CONCAT(__scalbn,s) (__x, __n);\t\t\t\t  \\\n+  return m(__scalbn) (__x, __n);\t\t\t\t\t  \\\n }\t\t\t\t\t\t\t\t\t  \\\n \t\t\t\t\t\t\t\t\t  \\\n-__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))\t  \\\n+__m81_defun (float_type, m(__nearbyint), (float_type __x))\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   float_type __result;\t\t\t\t\t\t\t  \\\n   unsigned long int __ctrl_reg;\t\t\t\t\t\t  \\\n@@ -320,38 +323,42 @@ __m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))\t  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\t\t\t\t\t\t\t\t\t  \\\n \t\t\t\t\t\t\t\t\t  \\\n-__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))\t\t  \\\n+__m81_defun (long int, m(__lrint), (float_type __x))\t\t\t  \\\n {\t\t\t\t\t\t\t\t\t  \\\n   long int __result;\t\t\t\t\t\t\t  \\\n   __asm __volatile__ (\"fmove%.l %1, %0\" : \"=dm\" (__result) : \"f\" (__x));  \\\n   return __result;\t\t\t\t\t\t\t  \\\n }\n \n-__inline_functions (double,)\n-__inline_functions (float,f)\n-__inline_functions (long double,l)\n+__inline_functions (double, __CONCAT_d)\n+__inline_functions (float, __CONCAT_f)\n+__inline_functions (long double, __CONCAT_l)\n # undef __inline_functions\n \n #endif /* Use ISO C9x */\n \n #ifdef __USE_GNU\n \n-# define __inline_functions(float_type, s)\t\t\t\t\\\n+# define __inline_functions(float_type, m)\t\t\t\t\\\n __m81_inline void\t\t\t\t\t\t\t\\\n-__m81_nth (__m81_u(__CONCAT(__sincos,s))\t\t\t\t\\\n+__m81_nth (__m81_u(m(__sincos))\t\t\t\t\t\t\\\n \t   (float_type __x, float_type *__sinx, float_type *__cosx))\t\\\n {\t\t\t\t\t\t\t\t\t\\\n   __asm __volatile__ (\"fsincos%.x %2,%1:%0\"\t\t\t\t\\\n \t\t      : \"=f\" (*__sinx), \"=f\" (*__cosx) : \"f\" (__x));\t\\\n }\n \n-__inline_functions (double,)\n-__inline_functions (float,f)\n-__inline_functions (long double,l)\n+__inline_functions (double, __CONCAT_d)\n+__inline_functions (float, __CONCAT_f)\n+__inline_functions (long double, __CONCAT_l)\n # undef __inline_functions\n \n #endif\n \n+#undef __CONCAT_d\n+#undef __CONCAT_f\n+#undef __CONCAT_l\n+\n #if !defined __NO_MATH_INLINES && defined __OPTIMIZE__\n \n /* Define inline versions of the user visible functions.  */\n","prefixes":[]}