mipsel memcpy & gcc3.4.6
Hi! Can anyone help with this issue ? I've opened a bug in the busybox tracking system: http://busybox.net/bugs/view.php?id=1894 It there any way to compile uClibc for mipsel with gcc 3.4.6 ? Some notes: - uClibc uses platform-specific memcpy (libc/string/mips/memcpy.os) Is it possible to swith to the "generic" memcpy version ? - The bug in the AS (preprocessor), not in the GCC itself -- -=AV=- ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Saturday 05 January 2008, Alexander Voropay wrote: > Can anyone help with this issue ? > > I've opened a bug in the busybox tracking system: > > http://busybox.net/bugs/view.php?id=1894 i already told you it wasnt a bug in uClibc ... > It there any way to compile uClibc for mipsel with gcc 3.4.6 ? remove the -std=gnu99 flag when building memcpy.S if you like > - uClibc uses platform-specific memcpy (libc/string/mips/memcpy.os) > Is it possible to swith to the "generic" memcpy version ? that's a configuration choice on your side ... review your uClibc configuration file > - The bug in the AS (preprocessor), not in the GCC itself incorrect ... the bug is in the gcc preprocessor. it errors out before it even gets a chance to output assembly which gas would then process. notice how the error message is prefixed with gcc there and not gas. -mike signature.asc Description: This is a digitally signed message part. ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
2008/1/5, Mike Frysinger <[EMAIL PROTECTED]>: > On Saturday 05 January 2008, Alexander Voropay wrote: > > Can anyone help with this issue ? > > > > I've opened a bug in the busybox tracking system: > > > > http://busybox.net/bugs/view.php?id=1894 > > i already told you it wasnt a bug in uClibc ... It seems, GCC 3.4.6 preprocessor supports ## concatenations incorrectly. I've took ENTRY definition from the "sysdeps.h" of the ia64/sysdeps.h It works. === --- libc/string/mips/sysdep.h.OLD 2008-01-07 18:17:44.165170520 +0300 +++ libc/string/mips/sysdep.h 2008-01-07 17:34:29.0 +0300 @@ -25,11 +25,18 @@ #include #include -#define ENTRY(name) \ - .globl name;\ - .align 2; \ - .ent name,0;\ - name##: +#ifdef __STDC__ +#define C_LABEL(name) name : +#else +#define C_LABEL(name) name/**/: +#endif + +#define ENTRY(name) \ +.text; \ +.align 2; \ +.ent name,0;\ +.globl name;\ +C_LABEL(name) #undef END #define END(function) \ === ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Mon, Jan 07, 2008 at 06:29:43PM +0300, Alexander Voropay wrote: > It seems, GCC 3.4.6 preprocessor supports ## concatenations > incorrectly. I've took ENTRY definition from the "sysdeps.h" of the > ia64/sysdeps.h It works. name##: is incorrect. ## is supposed to be used between parts of a single pp-token; ":" is a token all by itself. -- Daniel Jacobowitz CodeSourcery ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Monday 07 January 2008, Daniel Jacobowitz wrote: > On Mon, Jan 07, 2008 at 06:29:43PM +0300, Alexander Voropay wrote: > > It seems, GCC 3.4.6 preprocessor supports ## concatenations > > incorrectly. I've took ENTRY definition from the "sysdeps.h" of the > > ia64/sysdeps.h It works. > > name##: is incorrect. ## is supposed to be used between parts of a > single pp-token; ":" is a token all by itself. shouldnt gcc be uniformly barfing on this instead of sporadically ? should i open a gcc PR about gcc wrongly accepting name##: ? -mike signature.asc Description: This is a digitally signed message part. ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Mon, Jan 07, 2008 at 11:36:01AM -0500, Mike Frysinger wrote: > On Monday 07 January 2008, Daniel Jacobowitz wrote: > > On Mon, Jan 07, 2008 at 06:29:43PM +0300, Alexander Voropay wrote: > > > It seems, GCC 3.4.6 preprocessor supports ## concatenations > > > incorrectly. I've took ENTRY definition from the "sysdeps.h" of the > > > ia64/sysdeps.h It works. > > > > name##: is incorrect. ## is supposed to be used between parts of a > > single pp-token; ":" is a token all by itself. > > shouldnt gcc be uniformly barfing on this instead of sporadically ? should i > open a gcc PR about gcc wrongly accepting name##: ? The current versions of GCC do exactly what the standard say they ought to: gq.c:2:1: error: pasting "name" and ":" does not give a valid preprocessing token -- Daniel Jacobowitz CodeSourcery ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Monday 07 January 2008, Daniel Jacobowitz wrote: > On Mon, Jan 07, 2008 at 11:36:01AM -0500, Mike Frysinger wrote: > > On Monday 07 January 2008, Daniel Jacobowitz wrote: > > > On Mon, Jan 07, 2008 at 06:29:43PM +0300, Alexander Voropay wrote: > > > > It seems, GCC 3.4.6 preprocessor supports ## concatenations > > > > incorrectly. I've took ENTRY definition from the "sysdeps.h" of the > > > > ia64/sysdeps.h It works. > > > > > > name##: is incorrect. ## is supposed to be used between parts of a > > > single pp-token; ":" is a token all by itself. > > > > shouldnt gcc be uniformly barfing on this instead of sporadically ? > > should i open a gcc PR about gcc wrongly accepting name##: ? > > The current versions of GCC do exactly what the standard say they ought > to: > > gq.c:2:1: error: pasting "name" and ":" does not give a valid > preprocessing token what are you defining as "current" ? the current release (4.2.2) certainly accepts it as does a large majority of compiler versions (going by the fact that this is the first such bug report after using this code for quite a while): $ cat test.S #define foo(name) name##: foo(f) $ gcc -c test.S $ gcc --version gcc (GCC) 4.2.2 (Gentoo 4.2.2 p1.0) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -mike signature.asc Description: This is a digitally signed message part. ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
On Mon, Jan 07, 2008 at 12:00:20PM -0500, Mike Frysinger wrote: > > The current versions of GCC do exactly what the standard say they ought > > to: > > > > gq.c:2:1: error: pasting "name" and ":" does not give a valid > > preprocessing token > > what are you defining as "current" ? the current release (4.2.2) certainly > accepts it as does a large majority of compiler versions (going by the fact > that this is the first such bug report after using this code for quite a > while): > $ cat test.S > #define foo(name) name##: > foo(f) > $ gcc -c test.S > $ gcc --version > gcc (GCC) 4.2.2 (Gentoo 4.2.2 p1.0) Sorry, I forgot that it depends what language you're compiling. It's accepted for assembly, but not for C. There's special cases for # (stringify) too. I don't know why. -- Daniel Jacobowitz CodeSourcery ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc
Re: mipsel memcpy & gcc3.4.6
> what are you defining as "current" ? the current release (4.2.2) certainly > accepts it as does a large majority of compiler versions (going by the fact > that this is the first such bug report after using this code for quite a > while): As you told, GCC 3.4.6 accepts name##: w/o -std=gnu99 $ cat test.S #define foo(name) name##: foo(f) $ mipsel-linux-uclibc-gcc -c test.S $ $mipsel-linux-uclibc-gcc -c -std=gnu99 test.S test.S:3:1: pasting "f" and ":" does not give a valid preprocessing token $ $mipsel-linux-uclibc-gcc --version mipsel-linux-uclibc-gcc (GCC) 3.4.6 ___ uClibc mailing list uClibc@uclibc.org http://busybox.net/cgi-bin/mailman/listinfo/uclibc