ANN: xterm-356

Dennis Clarke dclarke at blastwave.org
Mon May 11 17:10:27 UTC 2020


On 5/3/20 12:56 AM, Thomas Dickey wrote:
<snip>
>                              Patch #356 - 2020/05/02
> 
>       * revise  fix  for  Debian #954730, which interfered with wheel mouse
>         events (report by Gabriele Balducci).
> 

I ran into problems on FreeBSD 12.1 wherein I was surprised to see this
error during the compile stage :


.
.
.
In file included from ./svg.c:33:
In file included from ./xterm.h:307:
./ptyx.h:1766:9: warning: padding struct 'LineData' with 4 bytes to 
align 'attribs' [-Wpadded]
         IAttr *attribs;         /* video attributes */
                ^
105 warnings generated.
/bin/sh ./plink.sh /usr/bin/cc -std=iso9899:1999 -pedantic 
-pedantic-errors -Weverything -Wno-reserved-id-macro 
-Wno-missing-prototypes -m64 -g -O0 -fno-fast-math -fno-builtin 
-Qunused-arguments  -L/usr/local/lib -L/usr/local/lib  -o xterm button.o 
cachedGCs.o charproc.o charsets.o cursor.o data.o doublechr.o 
fontutils.o input.o linedata.o main.o menu.o misc.o print.o ptydata.o 
scrollback.o screen.o scrollbar.o tabs.o util.o version.o xstrings.o 
xtermcap.o VTPrsTbl.o TekPrsTbl.o Tekproc.o charclass.o precompose.o 
wcwidth.o html.o svg.o -lutil -lXaw -lXmu -lXt -lSM -lICE -lXext -lXpm 
-lXt -lX11 -lSM -lICE
testing if -lutil is needed
...yes
testing if -lXaw is needed
...yes
testing if -lXmu is needed
...yes
testing if -lXt is needed
...yes
testing if -lSM is needed
...yes
testing if -lICE is needed
...yes
testing if -lXext is needed
...yes
testing if -lXpm is needed
...yes
testing if -lXt is needed
...yes
testing if -lX11 is needed
...yes
testing if -lSM is needed
...yes
testing if -lICE is needed
...yes
ld: error: undefined symbol: tgetstr
 >>> referenced by xtermcap.c:247 (./xtermcap.c:247)
 >>>               xtermcap.o:(loadTermcapStrings)

ld: error: undefined symbol: tgetent
 >>> referenced by xtermcap.c:509 (./xtermcap.c:509)
 >>>               xtermcap.o:(get_termcap)

ld: error: undefined symbol: tgetstr
 >>> referenced by xtermcap.c:556 (./xtermcap.c:556)
 >>>               xtermcap.o:(get_tcap_erase)

ld: error: undefined symbol: tgetent
 >>> referenced by xtermcap.c:614 (./xtermcap.c:614)
 >>>               xtermcap.o:(set_termcap)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:196: xterm] Error 1
$

Of course looking into xtermcap.c I do not see an include for either
curses.h or term.h at all.

There are a few ifdef's but nothing that seems related :


#if USE_TERMINFO && defined(NCURSES_VERSION) && 
defined(HAVE_USE_EXTENDED_NAMES)
#define USE_EXTENDED_NAMES 1
#else
#define USE_EXTENDED_NAMES 0
#endif

#if USE_TERMINFO
#define TcapInit(buffer, name) (setupterm(name, fileno(stdout), 
&ignored) == OK)
#else
#define TcapInit(buffer, name) (tgetent(buffer, name) == 1)
#endif

later I see the actual error wrapped in an ifdef also :


#if OPT_TCAP_FKEYS
static Boolean
loadTermcapStrings(TScreen *screen)
{
     Boolean result = True;

     if (screen->tcap_fkeys == 0) {
         Cardinal want = XtNumber(table);
         Cardinal have;
#if !USE_TERMINFO
         char *area = screen->tcap_area;
#endif

         TRACE(("loadTermcapStrings\n"));
         if ((screen->tcap_fkeys = TypeCallocN(char *, want)) != 0) {

             for (have = 0; have < want; ++have) {
                 char name[80];
                 char *fkey;

#if USE_TERMINFO
                 fkey = tigetstr(strcpy(name, table[have].ti));
#else
                 fkey = tgetstr(strcpy(name, table[have].tc), &area);
#endif
                 if (fkey != 0 && fkey != NO_STRING) {
                     screen->tcap_fkeys[have] = x_strdup(fkey);
                 } else {
                     screen->tcap_fkeys[have] = NO_STRING;
                 }
             }
         } else {
             result = False;
         }
     }
     return result;
}
#endif


To be clear I was trying to compile with strict C99 and also with
XOPEN_SOURCE defined at '600' which should keep me safely within the
POSIX "IEEE Std 1003.1, 2004 Edition" world.  Usually works fine.

My compiler was the typical system LLVM/Clang version in FreeBSD :


vesta$ cc --version
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on 
LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin
vesta$

With some rather strict flags and verbose warnings :



CC=/usr/bin/cc
CFLAGS=-std=iso9899:1999 -pedantic -pedantic-errors -Weverything 
-Wno-reserved-id-macro -Wno-missing-prototypes -m64 -g -O0 
-fno-fast-math -fno-builtin
CPPFLAGS=-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO 
-D_XOPEN_SOURCE=600
CXX=/usr/bin/c++
CXXFLAGS=-m64 -g -O0 -fno-fast-math -fno-builtin -Wl,-rpath=/opt/bw/lib

I have also tried various gymnastics with the FreeBSD system ld linker
which appears to be the LLVM linker ld.lld.

Configure always runs clean and outputs a strange message as the last
line but not an error state :

vesta$ pwd
/opt/bw/build/xterm-356_FreeBSD_12.1_amd64.004
vesta$ ./configure --prefix=/opt/bw --x-includes=/usr/local/include/X11 \
 > --x-libraries=/usr/local/lib --with-x --without-xinerama 
--enable-logging \
 > --with-valgrind --disable-leaks --enable-toolbar 2>&1 | tee 
../xterm-356_FreeBSD_12.1_amd64.004.config.log
checking build system type... x86_64-unknown-freebsd12.1
checking host system type... x86_64-unknown-freebsd12.1
Configuring for freebsd12.1
checking for gcc... /usr/bin/cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for executable suffix...
checking for object suffix... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/cc accepts -g... yes
checking version of /usr/bin/cc... 8.0.1
checking if this is really Clang C compiler... yes
checking for /usr/bin/cc option to accept ANSI C... none needed
checking $CFLAGS variable... ok
checking $CC variable... ok
checking how to run the C preprocessor... /usr/bin/cc -E
checking for mawk... no
checking for gawk... no
checking for nawk... nawk
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for lint... no
checking for cppcheck... no
checking for splint... no
checking if the POSIX test-macros are already defined... no
checking if _XOPEN_SOURCE really is set... yes
checking if SIGWINCH is defined... yes
checking for ncurses/curses.h... no
checking for ncurses/term.h... no
checking for stdlib.h... yes
checking for sys/ptem.h... no
checking for sys/ttydefaults.h... yes
checking for term.h... yes
checking for termios.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for nl_langinfo and CODESET... yes
checking for signal global datatype... volatile sig_atomic_t
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... (cached) yes
checking for time_t... yes
checking for cc_t in <termios.h> or <termio.h>... yes
checking for mode_t... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking for off_t... yes
checking for gethostname... yes
checking for getusershell... yes
checking for endusershell... yes
checking for getlogin... yes
checking for initgroups... yes
checking for mkdtemp... yes
checking for putenv... yes
checking for unsetenv... yes
checking for sched_yield... yes
checking for setpgid... yes
checking for strftime... yes
checking for tcgetattr... yes
checking for waitpid... yes
checking for wcswidth... yes
checking for wcwidth... yes
checking for lastlog.h... no
checking for paths.h... yes
checking for lastlog path... no
checking for utmp implementation... utmpx
checking if utmpx.ut_host is declared... yes
checking if utmpx.ut_syslen is declared... no
checking if utmpx.ut_name is declared... ut_user
checking for exit-status in utmpx... no
checking if utmpx.ut_xtime is declared... define
checking if utmpx.ut_session is declared... no
checking if utmpx is SYSV flavor... yes
checking for lastlog.h... (cached) no
checking for struct lastlog... no
checking for sys/param.h... yes
checking if POSIX saved-ids are supported... yes
checking if we want full tgetent function... yes
checking for full tgetent function... no
checking for partial tgetent function... no
checking for X applications class... XTerm
checking for directory to install resource files... 
${exec_prefix}/lib/X11/app-defaults
checking for the icon name... mini.xterm
checking for icon symlink to use... NONE
checking for directory to install pixmaps... ${datadir}/pixmaps
checking for directory to install icons... no
checking if icon theme should be used... no
checking for icon(s) to install... icons/mini.xterm_48x48.png 
icons/mini.xterm_48x48.xpm
checking for icon name... mini.xterm
checking if you want to install desktop files... yes
checking for desktop-file-install... no
checking for install-permissions reference... xterm
checking for PATH separator... :
checking for xterm... no
checking for xterm... no
checking for symbolic link to create to xterm... xterm
checking if you want to disable openpty... no
checking if you want to disable setuid... no
checking if you want to disable setgid... no
checking if you want to run xterm setuid to a given user... no
checking if you want to run xterm setgid to match utmp/utmpx file... no
checking if you want to link with utempter... no
checking if external errno is declared... yes
checking if external errno exists... yes
checking for explicit tty group name... auto...
checking for tty group name... tty
checking if we may use the tty group... yes
checking for X... libraries /usr/local/lib, headers /usr/local/include/X11
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for POSIX wait functions... yes
checking if external sys_nerr is declared... yes
checking if external sys_nerr exists... yes
checking if external sys_errlist is declared... yes
checking if external sys_errlist exists... yes
checking for termios.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for X11/Intrinsic.h... no
checking if we should define SYSV... no
checking for elf_begin in -lelf... yes
checking if this is an SVR4 system... no
checking if you want to use pkg-config... yes
checking for pkg-config... none
configure: WARNING: pkg-config is not installed
checking for XOpenDisplay... no
checking for XOpenDisplay in -lX11... yes
checking for XtAppInitialize... no
checking for XtAppInitialize in -lXt... yes
checking for X11/DECkeysym.h... no
checking for X11/Sunkeysym.h... no
checking for X11/XF86keysym.h... no
checking for X11/XKBlib.h... no
checking for X11/TranslateI.h... no
checking for X11/Xpoll.h... no
checking for X11/extensions/XKB.h... no
checking if you want to use the Xpm library for colored icon... yes
checking for X11/xpm.h... no
checking if you want to use the Xinerama extension... no
checking if you want to link with Xaw 3d library... no
checking if you want to link with Xaw 3d xft library... no
checking if you want to link with neXT Athena library... no
checking if you want to link with Athena-Plus library... no
checking for XextCreateExtension in -lXext... yes
checking for XOpenDisplay... (cached) no
checking for XOpenDisplay in -lX11... (cached) yes
checking for XtAppInitialize... (cached) no
checking for XtAppInitialize in -lXt... (cached) yes
checking for X11/Xaw/SimpleMenu.h... no
checking for X11/Xaw/SimpleMenu.h in /usr/contrib/X11R6... no
checking for X11/Xaw/SimpleMenu.h in /usr/contrib/X11R5... no
checking for X11/Xaw/SimpleMenu.h in /usr/lib/X11R5... no
checking for X11/Xaw/SimpleMenu.h in /usr/local... yes
checking for XawSimpleMenuAddGlobalActions in -lXaw -lXmu... yes
checking for X11/Xpoll.h... (cached) no
checking for declaration of fd_set... sys/types.h
checking for declaration of fd_mask... sys/types.h
checking for IRIX 6.5 baud-rate redefinitions... no
checking for termios type tcflag_t... yes
checking for termios type speed_t... yes
checking for termios type cc_t... yes
checking for XcursorGetTheme in -lXcursor... no
checking for stropts.h... no
checking for grantpt... yes
checking for ptsname... yes
checking for posix_openpt... yes
checking if grantpt really works... yes
checking for pty features...  pty_isatty pty_tcsetattr tty_tcsetattr
checking for openpty in -lutil... yes
checking for util.h... no
checking for libutil.h... yes
checking for pty.h... no
checking if we can use XkbQueryExtension... yes
checking for XkbQueryExtension... yes
checking if we can use XkbKeycodeToKeysym... yes
checking for XkbKeycodeToKeysym... yes
checking for XKB Bell extension... no
checking for Xutf8LookupString... yes
checking if you want narrow prototypes for X libraries... yes
checking if we should use imake to help... yes
checking for xmkmf... no
checking for imake... no
checking for groff... /usr/local/bin/groff
checking for nroff... /usr/local/bin/nroff
checking for tbl... /usr/local/bin/tbl
checking for man2html... /opt/schily/bin/man2html
checking for the modified Earl Hood script... no
checking for program to convert manpage to html... /usr/local/bin/groff
checking for default terminal-id... vt420
checking for default terminal-type... xterm
checking if backarrow-key should be BS... yes
checking if backarrow-key should be treated as erase... no
checking for default backspace/DEL setting... maybe
checking for default pty initial erase setting... False
checking if alt should send ESC... no
checking if meta should send ESC... no
checking for tic... no
checking if you want active-icons... yes
checking if you want ANSI color... yes
checking if you want 16 colors like aixterm... yes
checking if you want 256 colors... yes
checking if you want direct-color support... yes
checking if you want blinking cursor... yes
checking if you want to ignore Linux's broken palette-strings... no
checking if you want to allow broken string-terminators... yes
checking if you want to compile-in icon data... no
checking if you want printable 128-159... yes
checking if you want bold colors mapped like IBM PC... yes
checking if you want separate color-classes... yes
checking if you want color-mode enabled by default... yes
checking if you want support for color highlighting... yes
checking if you want support for doublesize characters... yes
checking if you want fallback-support for box characters... yes
checking if you want to allow spawning new xterms... no
checking for XextCreateExtension in -lXext... (cached) yes
checking for X11/extensions/Xdbe.h... yes
checking for XdbeSwapBuffers... yes
checking if you want to enable double-buffering in default resources... no
checking if you want to use FreeType library... yes
checking for FreeType configuration script... auto
checking for freetype-config... none
checking for xft-config... none
checking if we can link with FreeType libraries... no
configure: WARNING: No libraries found for FreeType
checking if you want support for HP-style function keys... no
checking if you want support for SCO-style function keys... no
checking if you want support for Sun-style function keys... yes
checking if you want saved-lines stored as a FIFO... yes
checking if you want support for internationalization... yes
checking if you want support for initial-erase setup... yes
checking if you want support for input-method... yes
checking if X libraries support input-method... yes
checking if you want support for load-vt-fonts... no
checking if you want support for logging... yes
checking if you want to allow logging via a pipe... no
checking if you want support for iconify/maximize translations... yes
checking if you want NumLock to override keyboard tables... yes
checking if you want support for get/set of base64 selection data... yes
checking if you want support for pty-handshaking... yes
checking if you want support for mouse in readline applications... no
checking if you want support for regular-expression selections... yes
checking if you want to use PCRE2 for regular-expressions... no
checking if you want to use PCRE for regular-expressions... no
checking for regcomp... yes
checking for regular-expression headers... regex.h
checking if you want support for right-scrollbar... yes
checking if you want check for redundant name-change... yes
checking if you want support for selection-actions... yes
checking if you want support for session management... yes
checking if you want to use termcap function-keys... yes
checking if you want to use termcap-query/report... yes
checking if you want support for tek4014... yes
checking if you want pulldown menus with a toolbar... yes
checking if you want VT52 emulation... yes
checking if you want wide-attribute support... yes
checking if you want wide-character support... yes
checking if you want only 16-bit character support... no
checking if you want to use mini-luit/Latin9 built-in support... no
checking if you want to use luit... yes
checking for xterm-filter... no
checking for xterm-filter... no
checking for bluit... no
checking for luit... no
checking if you want dynamic-abbreviation support... no
checking if you want DECterm Locator support... no
checking if you want XHTML and SVG screen dump support... yes
checking if you want ReGIS graphics support... no
checking if you want sixel graphics support... no
checking if you want VT420 rectangle support... yes
checking if you want -ziconbeep option... yes
checking if you want debugging traces... no
checking if you want to use dmalloc for testing... no
checking if you want to use dbmalloc for testing... no
checking if you want to use valgrind for testing... yes
checking if you want to perform memory-leak testing... yes
checking if you want to see long compiling messages... yes
checking if you want magic cookie emulation... no
checking for tigetstr... no
checking for use_extended_names... no
checking if you want to turn on gcc warnings... no
checking if filesystem supports mixed-case filenames... yes
checking for exctags... no
checking for ctags... ctags
checking for exetags... no
checking for etags... no
checking for ctags... yes
checking for etags... no
checking for an rpath option... -Wl,-rpath,
checking if rpath-hack should be disabled... no
checking for updated LDFLAGS... maybe
checking for ldd... ldd
configure: creating ./config.status
config.status: creating Makefile
config.status: creating df-install
config.status: creating minstall
config.status: creating xtermcfg.h
mv: xtermcfg.h: set owner/group (was: 16411/0): Operation not permitted
vesta$
vesta$ echo $?
0
vesta$

I just tried again with :

CC=/usr/bin/cc
CFLAGS=-std=iso9899:1999 -pedantic -pedantic-errors -Weverything 
-Wno-reserved-id-macro -Wno-missing-prototypes -m64 -g -O0 
-fno-fast-math -fno-builtin 
-Wl,-rpath=/opt/bw/lib,--export-dynamic,--no-threads
CPPFLAGS=-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO 
-D_XOPEN_SOURCE=600
CXX=/usr/bin/c++
CXXFLAGS=-m64 -g -O0 -fno-fast-math -fno-builtin -Wl,-rpath=/opt/bw/lib
LD_FLAGS=--export-dynamic --no-threads --rpath=/opt/bw/lib
LD_OPTIONS=--export-dynamic --no-threads --rpath=/opt/bw/lib
LD_RUN_PATH=/opt/bw/lib

Yes I am flailing away here.

Regardless I see the same :

.
.
.
107 warnings generated.
/bin/sh ./plink.sh /usr/bin/cc -std=iso9899:1999 -pedantic 
-pedantic-errors -Weverything -Wno-reserved-id-macro 
-Wno-missing-prototypes -m64 -g -O0 -fno-fast-math -fno-builtin 
-Wl,-rpath=/opt/bw/lib,--export-dynamic,--no-threads -Qunused-arguments 
  -L/usr/local/lib -L/usr/local/lib  -o xterm button.o cachedGCs.o 
charproc.o charsets.o cursor.o data.o doublechr.o fontutils.o input.o 
linedata.o main.o menu.o misc.o print.o ptydata.o scrollback.o screen.o 
scrollbar.o tabs.o util.o version.o xstrings.o xtermcap.o VTPrsTbl.o 
TekPrsTbl.o Tekproc.o charclass.o precompose.o wcwidth.o html.o svg.o 
-lutil -lXaw -lXmu -lXt -lSM -lICE -lXext -lXt -lX11 -lSM -lICE
testing if -lutil is needed
...yes
testing if -lXaw is needed
...yes
testing if -lXmu is needed
...yes
testing if -lXt is needed
...yes
testing if -lSM is needed
...yes
testing if -lICE is needed
...yes
testing if -lXext is needed
...yes
testing if -lXt is needed
...yes
testing if -lX11 is needed
...yes
testing if -lSM is needed
...yes
testing if -lICE is needed
...yes
ld: error: undefined symbol: tgetstr
 >>> referenced by xtermcap.c:247 (./xtermcap.c:247)
 >>>               xtermcap.o:(loadTermcapStrings)

ld: error: undefined symbol: tgetent
 >>> referenced by xtermcap.c:509 (./xtermcap.c:509)
 >>>               xtermcap.o:(get_termcap)

ld: error: undefined symbol: tgetstr
 >>> referenced by xtermcap.c:556 (./xtermcap.c:556)
 >>>               xtermcap.o:(get_tcap_erase)

ld: error: undefined symbol: tgetent
 >>> referenced by xtermcap.c:614 (./xtermcap.c:614)
 >>>               xtermcap.o:(set_termcap)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:196: xterm] Error 1
real 7.20
user 5.30
sys 1.90
vesta$


Any input would be appreciated here.


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



More information about the xorg mailing list