On 2021-10-18, Bram Moolenaar wrote:
> Gary Johnson wrote:
> 
> > > > On 2021-10-17, Dominique Pell=C3=A9 wrote:
> > > > > Gary Johnson <[email protected]> wrote:
> > > > > 
> > > > > > I have an older Ubuntu 10.04.4 system that I cannot upgrade for
> > > > > > various reasons.  It's what I can run on that hardware.  A recent
> > > > > > update of Vim failed to build.  A git bisect narrowed it down to the
> > > > > > 8.2.3510 commit.  Here is the gcc command that failed.
> > > > > >
> > > > > >
> > > > > > gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  
> > > > > > -pthread -D_REENTRANT -I/usr/include/gtk-2.0 
> > > > > > -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
> > > > > > -I/usr/include/cairo -I/usr/include/pango-1.0 
> > > > > > -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 
> > > > > > -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 
> > > > > > -I/usr/include/freetype2 -I/usr/include/directfb 
> > > > > > -I/usr/include/libpng12     -g3 -Wno-deprecated-declarations 
> > > > > > -DFEAT_BROWSE -DFEAT_CONCEAL -DFEAT_MOUSE_SGR -DFEAT_VARTABS 
> > > > > > -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o 
> > > > > > objects/fileio.o fileio.c
> > > > > > In file included from vim.h:151,
> > > > > >                  from fileio.c:14:
> > > > > > feature.h:656:1: warning: "FEAT_BROWSE" redefined
> > > > > > <command-line>: warning: this is the location of the previous 
> > > > > > definition
> > > > > > fileio.c: In function ‘time_differs’:
> > > > > > fileio.c:3130: error: ‘stat_T’ has no member named ‘st_mtim’
> > > > > > fileio.c: In function ‘buf_store_time’:
> > > > > > fileio.c:4483: error: ‘stat_T’ has no member named ‘st_mtim’
> > > > > > fileio.c: In function ‘vim_opentempdir’:
> > > > > > fileio.c:5033: warning: implicit declaration of function ‘dirfd’
> > > > > > make[2]: *** [objects/fileio.o] Error 1
> > > > > > make[2]: Leaving directory 
> > > > > > `/mnt/home-common/gary/src/vim-new/vim/src'
> > > > > > make[1]: *** [reconfig] Error 2
> > > > > > make[1]: Leaving directory 
> > > > > > `/mnt/home-common/gary/src/vim-new/vim/src'
> > > > > > make: *** [first] Error 2
> > > > > >
> > > > > >
> > > > > > gcc is (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3.
> > > > > 
> > > > > That compilation error (st_mtim -> st_mtime) is meant to be fixed
> > > > > by Vim 8.2.215. Consider posting the compilation error (if any) with
> > > > > the latest vim 8.2.3531.
> > > > 
> > > > That's when I first noticed it, is when I updated today to 8.2.3531.
> > > > Here's the error message from that build.
> > > > 
> > > > 
> > > > gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread 
> > > > -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include 
> > > > -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 
> > > > -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 
> > > > -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 
> > > > -I/usr/include/freetype2 -I/usr/include/directfb 
> > > > -I/usr/include/libpng12     -g3 -Wno-deprecated-declarations 
> > > > -DFEAT_BROWSE -DFEAT_CONCEAL -DFEAT_MOUSE_SGR -DFEAT_VARTABS 
> > > > -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o 
> > > > objects/getchar.o getchar.c
> > > > In file included from vim.h:151,
> > > >                  from getchar.c:19:
> > > > feature.h:656:1: warning: "FEAT_BROWSE" redefined
> > > > <command-line>: warning: this is the location of the previous definition
> > > > fileio.c: In function ‘time_differs’:
> > > > fileio.c:3126: error: ‘stat_T’ has no member named ‘st_mtim’
> > > > fileio.c: In function ‘buf_store_time’:
> > > > fileio.c:4484: error: ‘stat_T’ has no member named ‘st_mtim’
> > > > fileio.c: In function ‘vim_opentempdir’:
> > > > fileio.c:5034: warning: implicit declaration of function ‘dirfd’
> > > > make[2]: *** [objects/fileio.o] Error 1
> > > > make[2]: *** Waiting for unfinished jobs....
> > > > make[2]: Leaving directory `/mnt/home-common/gary/src/vim-new/vim/src'
> > > > make[1]: *** [reconfig] Error 2
> > > > make[1]: Leaving directory `/mnt/home-common/gary/src/vim-new/vim/src'
> > > > make: *** [first] Error 2
> > > 
> > > This looks like configure defined ST_MTIM_NSEC to st_mtim.tv_nsec even
> > > though it does not work.  Please check the output of configure, should
> > > be in src/auto/config.log
> > 
> > I assume that this is the part of config.log you're interested in.
> > 
> > 
> > configure:13152: checking for nanoseconds field of struct stat
> > configure:13180: gcc -std=gnu99 -c -g3 -Wno-deprecated-declarations 
> > -DFEAT_BROWSE -DFEAT_CONCEAL -DFEAT_MOUSE_SGR -DFEAT_VARTABS  
> > -DST_MTIM_NSEC=st_mtim.tv_nsec conftest.c >&5
> > configure:13180: $? = 0
> > configure:13188: result: st_mtim.tv_nsec
> > 
> > 
> > I can work around the problem by commenting-out this #define in
> > vim/src/auto/config.h:
> > 
> >     /* Define to nanoseconds field of struct stat */
> >     #define ST_MTIM_NSEC st_mtim.tv_nsec
> > 
> > but I haven't worked with configure recently and don't know
> > immediately how to fix the root problem.
> 
> Find this line in auto/configure:
> 
>  for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec 
> st_mtime_n st_mtimespec.tv_nsec; do
> 
> Try changing the order of the entries.  I guess it might work better if
> st_mtimespec.tv_nsec comes first.
> 
> Still, it is weird that the configure test would find st_mtim.tv_nsec
> but it is not found when compiling.  Perhaps the order of include files
> matters.

I read auto/configure more carefully to understand it better.  Then
I copied conftest.c for that test to another directory and
successfully compiled it there with

    #define ST_MTIM_NSEC st_mtim.tv_nsec

So I should be able to build fileio.c with ST_MTIM_NSEC defined.
I'm thinking now that the problem is in fileio.c or vim.h or in some
other configure test.

I'm out of time this morning, but I'll look at fileio.c, vim.h and
auto/configure later and try to find what stat_T really is.

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211018154033.GA20277%40phoenix.

Raspunde prin e-mail lui