[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re:



Hi Stephanie,

Stephanie Glass writes:
> I looked at vsxconfig.h and there is no mention of timespec.  I did a grep
> for "timespec" and got nothing.  Then I grep for
> "time" and only got lines from times.h listing extern int for timer
> functions, none of which say timespec.  I since gotten a
> note from Andrew which asked me to look at SYSINC which I did also.
> "timespec" is in aio.h listed as
>    'extern int aio_suspend64 __P ((  ... __const struct timespec
> *__restrict __timeout));
> 
> But I don't know what that means.  The one thing everyone should remember I
> copied the same tar file to the other distros and ran the install.sh and
> setup.sh and didn't have this problem.  Only on Debian 2.2.

I think the compile errors are due to either a problem in the header
files with the version of glibc on Debian 2.2 or the version of gcc
when used as c89 (its just a wrapper script).  I had a closer look at
the problem and the immediate cause of the compiler error is due to
the timespec struct not being declared before it is used above. Using
gcc instead of c89 as the compiler this compilation error does not
occur (but I don't think we're meant to do this).

Adding the following to SRC/vsxconfig.h after config.sh is run, but
before the compilation as root:

#if !defined __timespec_defined
#define __timespec_defined 1
struct timespec
{
    long int tv_sec;            /* Seconds.  */
    long int tv_nsec;           /* Nanoseconds.  */
};
#endif

(it should be added in the section for time.h)

fixes most of the compile problems. I noticed also that libvsrt does
not build due to the same problem above. Adding the fix above fixes
most of the compile problems with the exception of:

/usr/bin/c89  -I/home/tet/test_sets/SRC/../../inc/tet3 -I../../INC -I../../SYSINC -DTET_POSIX_THREADS -D_XOPEN_SOURCE=500    -c -o signals.o signals.c
signals.c: In function `vsrt_rt_signal':
signals.c:111: structure has no member named `sa_sigaction'
make[1]: *** [signals.o] Error 1

Having a look at the header files for both problems:

from time.h:

#if !defined __timespec_defined && \
    ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timespec)
# define __timespec_defined	1

/* POSIX.1b structure for a time value.  This is like a `struct timeval' but
   has nanoseconds instead of microseconds.  */
struct timespec
  {
    long int tv_sec;		/* Seconds.  */
    long int tv_nsec;		/* Nanoseconds.  */
  };

#endif /* timespec not defined and <time.h> or need timespec.  */
#undef	__need_timespec

from bits/sigaction.h:

/* Structure describing the action to be taken when a signal arrives.  */
struct sigaction
  {
    /* Signal handler.  */
#ifdef __USE_POSIX199309
    union
      {
	/* Used if SA_SIGINFO is not set.  */
	__sighandler_t sa_handler;
	/* Used if SA_SIGINFO is set.  */
	void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;
# define sa_handler	__sigaction_handler.sa_handler
# define sa_sigaction	__sigaction_handler.sa_sigaction
#else
    __sighandler_t sa_handler;
#endif

I don't think the second compile problem can be fixed by sticking
something in vsxconfig.h. Unless someone else has a better suggestion,
then the only way to get it to compile may be to, um, edit the header
file in question.

It appears the common problem is __USE_POSIX199309 not being defined.
The header files on more recent versions of glibc which work appear to
be the same so I'm guessing __USE_POSIX199309 should be defined when
using c89 (which admittedly looks a bit strange).

One thing to note is that Debian 2.2 uses glibc2.1 which is not LSB
compliant for many other reasons, so you might want to consider
looking at a more recent version (say unstable or testing) which
use glibc2.2.

Regards,

Chris.
-- 
yeohc@au1.ibm.com
IBM OzLabs Linux Development Group
Canberra, Australia



Reply to: