Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250907 - dev-lang/tendra: sys-libs/glibc-2.9_p20081201 compatibility (in particular bits/resource.h with no __USE_GNU defined)
Summary: dev-lang/tendra: sys-libs/glibc-2.9_p20081201 compatibility (in particular bi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal
Assignee: Maintainers for Miscelleneous Language Packages [OBSOLETE]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-14 10:18 UTC by Nikolay Orlyuk
Modified: 2008-12-14 21:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Orlyuk 2008-12-14 10:18:36 UTC
During tries to compile tendra under amd64, found:

# Compiling building/posix.api/wait.c
/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/tools/tcc/tcc
-yTENDRA_BASEDIR="/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src"
-Y/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/lib/env/build
-Y64bit
-I/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/apis/posix/../../../../src/lib/machines/linux/amd64/include
-I/usr/include
-f/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/machines/linux/amd64/startup/posix.h
-o building/posix.api/wait.j building/posix.api/wait.c -Ymakelib
-D__BUILDING_LIBS
"/usr/include/bits/resource.h", line 171: Error:
  [Syntax]: Extra comma at end of list.
*** Error code 1

In /usr/include/bits/resource.h:
enum __rusage_who
{
  /* The calling process.  */
  RUSAGE_SELF = 0,
#define RUSAGE_SELF RUSAGE_SELF

  /* All of its terminated child processes.  */
  RUSAGE_CHILDREN = -1,
#define RUSAGE_CHILDREN RUSAGE_CHILDREN

#ifdef __USE_GNU
  /* The calling thread.  */
  RUSAGE_THREAD = 1
# define RUSAGE_THREAD RUSAGE_THREAD
  /* Name for the same functionality on Solaris.  */
# define RUSAGE_LWP RUSAGE_THREAD
#endif
}; // <-- line 171

this produces: enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1, };
when no __USE_GNU defined. that comma doesn't compatible with ISO/IEC 14882:1998(E), section "7.2 Enumeration declarations", as I can see.

Also about anonymous union/struct (like in bits/pthreadtypes.h for pthread_mutex_t). I don't sure it is allowed in C standard. If it doesn't than glibc should be made more compatible with other C compilers which is more strict about standards.
I have also problem:

# Compiling building/ansi.api/fail.c
/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/tools/tcc/tcc -yTENDRA_BASEDIR="/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src" -Y/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/bootstrap/src/lib/env/build -Y64bit -I/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/apis/ansi/../../../../src/lib/machines/linux/amd64/include -I/usr/include -f/var/tmp/paludis/dev-lang-tendra-5.0_pre20070510-r2/work/trunk/src/lib/machines/linux/amd64/startup/ansi.h -o building/ansi.api/fail.j building/ansi.api/fail.c -Ymakelib -D__BUILDING_LIBS
"/usr/include/bits/pthreadtypes.h", line 99: Error:
  [ISO 6.5.2.1]: Anonymous unions are not allowed.
*** Error code 1

Where source:
#if __WORDSIZE == 64
    int __spins;
    __pthread_list_t __list;
# define __PTHREAD_MUTEX_HAVE_PREV  1
#else
    unsigned int __nusers;
    __extension__ union
    {
      int __spins;
      __pthread_slist_t __list;
    }; // <-- line 99
#endif


Reproducible: Always
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2008-12-14 11:15:08 UTC
Thanks for the report.

> this produces: enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1, };
> when no __USE_GNU defined. that comma doesn't compatible with ISO/IEC
> 14882:1998(E), section "7.2 Enumeration declarations", as I can see.

ISO/IEC 14882:1998 describes C++. tendra follows 9899:1990 (C90), which doesn't allow this either, but intends so some day follow 9899:1999 (C99) which does.

I'll see if this is also a problem on x86, and if so, make sure tendra accepts the trailing comma.

> Also about anonymous union/struct (like in bits/pthreadtypes.h for
> pthread_mutex_t). I don't sure it is allowed in C standard.

This is not allowed in C, but accepted by tendra provided the environment file says to allow this. You won't have this problem on x86, and you won't have this problem on amd64 if you make the same changes to amd64 as I have to x86. Please see tendra-patches/tendra-linux.patch, in particular the changes to src/lib/machines/linux/80x86/startup/{ansi,system}.h.

> If it doesn't than
> glibc should be made more compatible with other C compilers which is more
> strict about standards.

In a perfect world, yes, but I don't think it's possible to change this union without breaking compatibility, and glibc upstream tends to be less than enthusiastic about patches in general... Feel free to contact them, but don't expect anything out of it. :)
Comment 2 Harald van Dijk (RETIRED) gentoo-dev 2008-12-14 21:02:19 UTC
This is fixed for x86 in -r2. tendra already had an option to accept the trailing comma, so all that was needed was adding it to the linux/80x86 configuration.