[ntp:questions] GCC-4.2.3 Compiler Error in NTP-4.2.2p4

Thomas Laus lausts at acm.org
Sun Feb 10 22:04:15 UTC 2008

On 2008-02-10, Douglas Wells <see at signature.invalid> wrote:
> [I'm replying to the original article rather than later follow-ups
> in order to include some original error messages.]
> In article <slrnfqrnc2.1gue.lausts at laus.org>, Thomas Laus <lausts at acm.org> writes:
> timer_gettime and the associated data structure struct itimerspec
> are part of the POSIX REALTIME option, and are not supported
> in FreeBSD 6.  (I have seen some documentation that they are
> available in the imminently available FreeBSD 7 line.)
> Thus, the issue is almost certainly not with the gcc compiler but
> rather the configuration of the NTP distribution: it shouldn't
> have chosen to use timer_create but rather setitimer.  In looking
> at the NTP distribution, it's not clear to me why this should
> fail.  Are you sure that you started with a clean distribution
> tree?
> I recently compiled and installed ntp-4.2.4p4 on FreeBSD 6.3-RELEASE
> using the FreeBSD ports system (and the default gcc 3.4.6), and
> it compiled and now operates without any obvious errors.  I note,
> however, that the FreeBSD people have provided two small patch files
> -- both associated with configuring the stock NTP distribution for
> use on the various release versions of FreeBSD.
> I just tried configuring that version of ntp using the supplied
> configuration tools (i.e., w/o the FreeBSD patch files), and it
> properly detected the lack of timer_create (i.e., it wrote
> "/* #undef HAVE_TIMER_CREATE */" in the top level config.h).  It
> also compiled successfully using gcc 4.3.0 20071221.  So, I really
> would suspect stale configuration files on your system.
> I'm not sure of the level of your programming experience as this
> "compiler error" should have been relatively simple to diagnose
> given access to the NTP source, the grep command, and the FreeBSD
> man pages; yet you appear to be running a version of FreeBSD from
> the source repository (rather than a released system).  In any
> case, I would suggest strongly that you consider using the FreeBSD
> ports system as it drastically reduces the stress associated with
> maintaining third-party system software.  You could start by reading
> the FreeBSD handbook and/or the "ports" man page, both of which
> are part of the standard FreeBSD installation.

My update of NTP was via the ports system.  The compiler update to
GCC-4.2.3_20080130 also was done via the 'portupgrade' system.  One of
my other applications requires GCC 4.3 instead of the GCC-3.4.6 that is
part of the base system.  That was why I mentioned that ntp-4.2.2p4
compiled fine on another computer that was running the base system
compiler and not GCC-4.2.3xxx.  I will contact the maintainer of the NTP
port on FreeBSD and see if he has any insight into why the port
configuration was not able to detect that I was running FreeBSD 6 and
did not have the POSIX Realtime Option.

Thanks for the reply.  It gives me (and others) some insight into how
things work.


Public Keys:
PGP KeyID = 0x5F22FDC1
GnuPG KeyID = 0x620836CF

More information about the questions mailing list