[vim/vim] Build fails unless preceded by `make distclean` (Issue #10799)

28 views
Skip to first unread message

chdiza

unread,
Jul 26, 2022, 2:41:56 PM7/26/22
to vim/vim, Subscribed

Steps to reproduce

  1. Have a git clone of the vim repo.
  2. Build vim locally.
  3. Observe the error message pasted in the "logs and stack traces" section.
  4. Do a make distclean.
  5. Try to build again and it succeeds.
  6. Do a make clean.
  7. Try to build again and it fails with the same error message.

Expected behaviour

I expected Vim to build normally, and for make clean to be sufficient.

This problem started sometime within the last couple of days. Because it takes two separate build attempts to verify the presence of the issue, I don't have time to bisect right now.

My guess is that some piece of detritus is wrongly being left behind by make clean, but is correctly swept away by make distclean.

Version of Vim

9.0.0084

Environment

OS: Ubuntu 20.04
terminal: kitty
$TERM: xterm-kitty
shell: bash

Logs and stack traces

gcc  -L/lib/x86_64-linux-gnu   -L/usr/local/lib -Wl,--as-needed 	-o vim objects/alloc.o objects/arabic.o objects/arglist.o objects/autocmd.o objects/beval.o objects/buffer.o objects/change.o objects/blob.o objects/blowfish.o objects/cindent.o objects/clientserver.o objects/clipboard.o objects/cmdexpand.o objects/cmdhist.o objects/crypt.o objects/crypt_zip.o objects/debugger.o objects/dict.o objects/diff.o objects/digraph.o objects/drawline.o objects/drawscreen.o objects/edit.o objects/eval.o objects/evalbuffer.o objects/evalfunc.o objects/evalvars.o objects/evalwindow.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/filepath.o objects/findfile.o objects/float.o objects/fold.o objects/getchar.o objects/gui_xim.o objects/hardcopy.o objects/hashtab.o objects/help.o objects/highlight.o objects/if_cscope.o objects/if_xcmdsrv.o objects/indent.o objects/insexpand.o objects/list.o objects/locale.o objects/map.o objects/mark.o objects/match.o objects/mbyte.o objects/memline.o objects/menu.o objects/misc1.o objects/misc2.o objects/mouse.o objects/move.o objects/normal.o objects/ops.o objects/option.o objects/optionstr.o objects/os_unix.o objects/pathdef.o objects/popupmenu.o objects/popupwin.o objects/profiler.o objects/pty.o objects/quickfix.o objects/regexp.o objects/register.o objects/screen.o objects/scriptfile.o objects/search.o objects/session.o objects/sha256.o objects/sign.o objects/sound.o objects/spell.o objects/spellfile.o objects/spellsuggest.o objects/strings.o objects/syntax.o objects/tag.o objects/term.o objects/terminal.o objects/testing.o objects/textformat.o objects/textobject.o objects/textprop.o objects/time.o objects/typval.o objects/ui.o objects/undo.o objects/usercmd.o objects/userfunc.o objects/version.o objects/vim9cmds.o objects/vim9compile.o objects/vim9execute.o objects/vim9expr.o objects/vim9instr.o objects/vim9script.o objects/vim9type.o objects/viminfo.o objects/window.o objects/bufwrite.o objects/gui.o objects/gui_gtk.o objects/gui_gtk_x11.o objects/gui_gtk_f.o objects/gui_beval.o objects/gui_gtk_gresources.o objects/vterm_encoding.o objects/vterm_keyboard.o objects/vterm_mouse.o objects/vterm_parser.o objects/vterm_pen.o objects/vterm_screen.o objects/vterm_state.o objects/vterm_unicode.o objects/vterm_vterm.o          objects/job.o objects/channel.o objects/xdiffi.o objects/xemit.o objects/xprepare.o objects/xutils.o objects/xhistogram.o objects/xpatience.o  objects/charset.o objects/json.o objects/main.o objects/memfile.o objects/message.o   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lselinux -ldl           
/usr/bin/ld: objects/os_unix.o: in function `stop_timeout':
/opt/bld/vim/src/os_unix.c:8278: undefined reference to `timer_settime'
/usr/bin/ld: objects/os_unix.o: in function `start_timeout':
/opt/bld/vim/src/os_unix.c:8318: undefined reference to `timer_create'
/usr/bin/ld: /opt/bld/vim/src/os_unix.c:8331: undefined reference to `timer_settime'
/usr/bin/ld: objects/os_unix.o: in function `delete_timer':
/opt/bld/vim/src/os_unix.c:8346: undefined reference to `timer_delete'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
make[1]: *** [Makefile:2112: vim] Error 1


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799@github.com>

Bram Moolenaar

unread,
Jul 26, 2022, 3:24:43 PM7/26/22
to vim/vim, Subscribed

I cannot reproduce this. When lining works, does the link command have "-lrt" ?
Any differences between the two link commands?

What changed not so long ago is cross-compiling support related to timers. I don't see why that would be a problem for you (while nobody else complains so far). You could sync back to 9.0.0064 to see if it works, then to 9.0.0065 to see if it fails.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1195888733@github.com>

Yannick Roehlly

unread,
Jul 26, 2022, 6:42:25 PM7/26/22
to vim/vim, Subscribed

Hi,

I have the same error while compiling a Debian package from the git master branch. I can confirm that reverting 509695c makes the compilation succeed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1196051495@github.com>

chdiza

unread,
Jul 26, 2022, 8:00:16 PM7/26/22
to vim/vim, Subscribed

When lining works, does the link command have "-lrt" ?

When linking works, "-lrt" is present. When linking does not work, "-lrt" is absent, and that is the sole difference between the linking commands. This is 9.0.0084.

9.0.0064 is fine and I can't reproduce. I'll try 9.0.0065.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1196110655@github.com>

chdiza

unread,
Jul 26, 2022, 8:07:16 PM7/26/22
to vim/vim, Subscribed

9.0.0065 is bad, 9.0.0064 is not.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1196114298@github.com>

Bram Moolenaar

unread,
Jul 27, 2022, 6:03:36 AM7/27/22
to vim/vim, Subscribed

OK, so the missing "-lrt" in $LIBS is the problem. However, normally this is set in src/auto/config.mk and it does not change when doing "make clean". My copy has this line:
LIBS = -lm -ltinfo -lselinux -lcanberra -lsodium -lrt -lgpm

If you override $LIBS then it would fail before and after "make clean". I can't guess what the problem is.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1196525854@github.com>

chdiza

unread,
Jul 27, 2022, 10:49:31 AM7/27/22
to vim/vim, Subscribed

If it helps, I always use ./configure -C when building.

Also, here are the flags I use:

--with-x
--enable-gui=gtk2
--x-includes=/usr/include/x86_64-linux-gnu
--x-libraries=/lib/x86_64-linux-gnu
--disable-netbeans
--disable-nls
--with-compiledby=me
--prefix=$HOME/sw


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1196860076@github.com>

chdiza

unread,
Jul 28, 2022, 8:28:27 AM7/28/22
to vim/vim, Subscribed

FYI, 9.0.98 does not solve this problem.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1198074907@github.com>

chdiza

unread,
Jul 28, 2022, 8:31:07 AM7/28/22
to vim/vim, Subscribed

From the other thread:

Can you check the LIBS line in src/auto/config.mk ?  It probably should
include "-lrt".  If not, then try adding it (and run "make", not
"configure").

That worked.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1198077587@github.com>

Bram Moolenaar

unread,
Jul 28, 2022, 9:57:13 AM7/28/22
to vim/vim, Subscribed


> From the [other thread](#10805):
> ```

> Can you check the LIBS line in src/auto/config.mk ? It probably should
> include "-lrt". If not, then try adding it (and run "make", not
> "configure").
> ```
> That worked.

Strange. So when running configure/make after "make distclean" then
LIBS includes "-lrt", but after "make clean" it does not?
Can you double check that? And can you see where the "LIBS" line is
changed?

--
"Hit any key to continue" is very confusing when you have two keyboards.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1198178693@github.com>

chdiza

unread,
Jul 28, 2022, 4:51:24 PM7/28/22
to vim/vim, Subscribed

Strange. So when running configure/make after "make distclean" then LIBS includes "-lrt", but after "make clean" it does not?

That's right. Triple checked.

And can you see where the "LIBS" line is changed?

I'm not sure what you're asking, but I'll describe how the LIBS line changed through the process, starting from a clean git clone.

  1. After configure -C [args] and make steps, LIBS contains -lrt.
  2. Now do make clean. I see that LIBS still contains -lrt.
  3. Now do configure -C [args] again, but DO NOT make: I see that LIBS has lost the -lrt.

At this point if I try to make, linking will fail. But a make distclean will temporarily cure things since it cleans up config.mk into some kind of stub.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1198619170@github.com>

Bram Moolenaar

unread,
Jul 28, 2022, 5:28:57 PM7/28/22
to vim/vim, Subscribed


> > Strange. So when running configure/make after "make distclean" then LIBS includes "-lrt", but after "make clean" it does not?
>
> That's right. Triple checked.
>
> > And can you see where the "LIBS" line is changed?
>
> I'm not sure what you're asking, but I'll describe how the LIBS line changed through the process, starting from a clean git clone.
> 1. After `configure -C [args]` and `make` steps, LIBS contains -lrt.
> 2. Now do `make clean`. I see that LIBS still contains -lrt.
> 3. Now do `configure -C [args]` again, but DO NOT make: I see that LIBS has lost the -lrt.

>
> At this point if I try to make, linking will fail. But a `make distclean` will temporarily cure things since it cleans up config.mk into some kind of stub.

Aha, after "make clean" you run configure again. That's what I
expected. It will pick up the cache entry, but that only defines the
macro, it does not change LIBS.

I'll try to fix this. At the same time, the order should be reversed:
First check without "-lrt", that works on my system. Only when it
fails try adding "-lrt". And to fix the reported issue use a different
cache entry.

--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/10799/1198650767@github.com>

Bram Moolenaar

unread,
Jul 28, 2022, 5:40:43 PM7/28/22
to vim/vim, Subscribed

Closed #10799 as completed via efffa53.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/10799/issue_event/7085214581@github.com>

Bram Moolenaar

unread,
Jul 28, 2022, 8:44:28 PM7/28/22
to vim...@googlegroups.com, Bram Moolenaar

I wrote:

> > At this point if I try to make, linking will fail. But a `make distclean` will temporarily cure things since it cleans up config.mk into some kind of stub.
>
> Aha, after "make clean" you run configure again. That's what I
> expected. It will pick up the cache entry, but that only defines the
> macro, it does not change LIBS.

I meant: "that's NOT what expected".

--
hundred-and-one symptoms of being an internet addict:
181. You still remember the "happy tune" your modem made
while dialing your ISP.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
Reply all
Reply to author
Forward
0 new messages