Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

Aharon Robbins
Hi.

Thanks for the report.

This is an issue in the Autoconf AC_FUNC_MKTIME macro which gawk uses.
I am forwarding this to the bug-autocof list, in the hope that they
can help.

I will try to add a README file in the gawk distribution about this
issue until there's a new Autoconf release that fixes it...

Thanks,

Arnold
-------------------
Eric Pruitt <[hidden email]> wrote:

> When running ./configure for GAWK 4.1.4, the mktime(3) function is not
> detected on FreeBSD 11 when using -static with CFLAGS and LDFLAGS. This
> causes the build to fail:
>
>     /usr/lib/libc.a(localtime.o): In function `mktime':
>     /usr/src/lib/libc/../../contrib/tzcode/stdtime/localtime.c:(.text+0x910): multiple definition of `mktime'
>
> If I add "#define HAVE_MKTIME 1" to config.h, the build succeeds, and it
> also succeeds if I remove "-static" from CFLAGS and LDFLAGS. I'm using
> the default compiler on FreeBSD, "FreeBSD clang version 3.8.0". I have
> attached config.log to this message. Is there an additional flag I
> should pass to the configure script to make static linking work without
> modifying the configuration header?
>
> Thanks,
> Eric
>

config.log (137K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

Paul Eggert
>> Is there an additional flag I
>> should pass to the configure script to make static linking work without
>> modifying the configuration header?

Yes, 'ac_cv_func_working_mktime=yes'.

This will cause Gawk to use the FreeBSD mktime even though it is buggy. Quite
possibly you won't notice the bugs.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

Eric Pruitt
On Tue, Jul 25, 2017 at 08:44:30PM -0700, Paul Eggert wrote:
> > > Is there an additional flag I
> > > should pass to the configure script to make static linking work without
> > > modifying the configuration header?
>
> Yes, 'ac_cv_func_working_mktime=yes'.
>
> This will cause Gawk to use the FreeBSD mktime [...]

Thanks, that worked.

Eric

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

Václav Haisman-2
In reply to this post by Paul Eggert
On 26 July 2017 at 05:44, Paul Eggert <[hidden email]> wrote:

>>> Is there an additional flag I
>>> should pass to the configure script to make static linking work without
>>> modifying the configuration header?
>
>
> Yes, 'ac_cv_func_working_mktime=yes'.
>
> This will cause Gawk to use the FreeBSD mktime even though it is buggy.
> Quite possibly you won't notice the bugs.
>

How buggy is FreeBSD's `mktime()`? Links, bugs?

--
VH

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug-gawk] mktime(3) not detected on FreeBSD with -static

Paul Eggert
Václav Haisman wrote:
> How buggy is FreeBSD's `mktime()`? Links, bugs?

See the mktime test program in gawk's 'configure' script. It probably comes from:

http://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/mktime.m4

Some mktime implementations are quite bad: they can go into infinite or
seemingly-infinite loops and/or dump core in addition to returning incorrect
answers. I don't know which of the problems FreeBSD mktime has. You should be OK
if you use glibc mktime, Gnulib mktime, or the reference mktime in tzcode.

Loading...