[vim/vim] Undefined symbol on Solaris 10 (Issue #19803)

4 views
Skip to first unread message

idgn23

unread,
Mar 23, 2026, 4:19:31 PM (yesterday) Mar 23
to vim/vim, Subscribed
idgn23 created an issue (vim/vim#19803)

Steps to reproduce

Unreferenced Symbol when building on Solaris 10.
Introduced with 9.2.0153. The previous version, 152, builds fine.

Expected behaviour

Should not happen

Version of Vim

9.2.0153

Environment

Solaris 10 sparc, OpenCSW build environment.

Logs and stack traces

/opt/csw/bin/gcc-5.5   -mcpu=v9 -Wa,-xarch=v8plus -L/opt/csw/lib      -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/fuzzy.o objects/getchar.o objects/gc.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/linematch.o objects/list.o objects/locale.o objects/logfile.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/tabpanel.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/tuple.o objects/typval.o objects/ui.o objects/undo.o objects/usercmd.o objects/userfunc.o objects/version.o objects/vim9class.o objects/vim9cmds.o objects/vim9compile.o objects/vim9execute.o objects/vim9expr.o objects/vim9generics.o objects/vim9instr.o objects/vim9script.o objects/vim9type.o objects/viminfo.o objects/window.o objects/bufwrite.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/if_python.o     objects/netbeans.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         -lm -lsocket   -lncurses -liconv -lsec -lintl           
Undefined                       first referenced
 symbol                             in file
gethostbyname                       objects/channel.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
inet_ntoa                           objects/channel.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
ld: fatal: symbol referencing errors. No output written to vim
collect2: error: ld returned 1 exit status
gmake[1]: *** [Makefile:2085: vim] Error 1


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

Christian Brabandt

unread,
Mar 23, 2026, 4:54:18 PM (yesterday) Mar 23
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19803)

Does this work?

make LDFLAGS="-lnsl -lsocket"

If yes, can you check, if the following patch fixes it for you?

diff --git a/src/auto/configure b/src/auto/configure
index 93ee5ea65..8e73d97b1 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -8820,6 +8820,57 @@ then :
 
   LIBS="-lsocket $LIBS"
 
+fi
+
+		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+printf %s "checking for gethostbyname in -lnsl... " >&6; }
+if test ${ac_cv_lib_nsl_gethostbyname+y}
+then :
+  printf %s "(cached) " >&6
+else case e in #(
+  e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.
+   The 'extern "C"' is for builds by C++ compilers;
+   although this is not generally supported in C code supporting it here
+   has little cost and some practical benefit (sr 110532).  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname (void);
+int
+main (void)
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_nsl_gethostbyname=yes
+else case e in #(
+  e) ac_cv_lib_nsl_gethostbyname=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes
+then :
+  printf "%s\n" "#define HAVE_LIBNSL 1" >>confdefs.h
+
+  LIBS="-lnsl $LIBS"
+
 fi
 
   fi
@@ -8891,57 +8942,6 @@ then :
 fi
 
   else
-        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-printf %s "checking for gethostbyname in -lnsl... " >&6; }
-if test ${ac_cv_lib_nsl_gethostbyname+y}
-then :
-  printf %s "(cached) " >&6
-else case e in #(
-  e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.
-   The 'extern "C"' is for builds by C++ compilers;
-   although this is not generally supported in C code supporting it here
-   has little cost and some practical benefit (sr 110532).  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname (void);
-int
-main (void)
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else case e in #(
-  e) ac_cv_lib_nsl_gethostbyname=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes
-then :
-  printf "%s\n" "#define HAVE_LIBNSL 1" >>confdefs.h
-
-  LIBS="-lnsl $LIBS"
-
-fi
-
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv4 networking is possible" >&5
 printf %s "checking whether compiling with IPv4 networking is possible... " >&6; }
 if test ${vim_cv_ipv4_networking+y}
diff --git a/src/configure.ac b/src/configure.ac
index 495c8de40..3787701e3 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2238,6 +2238,8 @@ if test "$enable_channel" = "yes"; then
 	AC_CHECK_LIB(network, socket)
   else
 	AC_CHECK_LIB(socket, socket)
+	dnl On Solaris we need the nsl library.
+	AC_CHECK_LIB(nsl, gethostbyname)
   fi
 
   AC_CACHE_CHECK([whether compiling with IPv6 networking is possible], [vim_cv_ipv6_networking],
@@ -2274,8 +2276,6 @@ if test "$enable_channel" = "yes"; then
     AC_DEFINE(FEAT_IPV6)
     AC_CHECK_FUNCS(inet_ntop)
   else
-    dnl On Solaris we need the nsl library.
-    AC_CHECK_LIB(nsl, gethostbyname)
     AC_CACHE_CHECK([whether compiling with IPv4 networking is possible], [vim_cv_ipv4_networking],
       [AC_LINK_IFELSE([AC_LANG_PROGRAM([
 #include <stdio.h>


Reply to this email directly, view it on GitHub, or unsubscribe.

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

idgn23

unread,
3:39 PM (8 hours ago) 3:39 PM
to vim/vim, Subscribed
idgn23 left a comment (vim/vim#19803)

make LDFLAGS="-lnsl -lsocket" works. I will try the patch later.


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/19803/4120881745@github.com>

Reply all
Reply to author
Forward
0 new messages