Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2022 22:58:04 -0800
From:      Fred Finster <fred@thegalacticzoo.com>
To:        peter.hutterer@who-t.net, alan.coopersmith@oracle.com, daniel@fooishbar.org
Cc:        fredfinster58@gmail.com, freebsd-arm@freebsd.org
Subject:   libinput_drv.so , libinput.so.10.13.0 fail to build for ARM64 FreeBSD 14.0-CURRENT source tree, versionsort() function declaration problem
Message-ID:  <076925bf-b95c-9d34-6685-8293c5449e4f@thegalacticzoo.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------UgHk0r8kR0fpCk2KzPP7oZFq
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello Xorg maintainers,  I apologize for throwing so much information 
over the wall to point out a simple issue of broken software for

versionsort()  function, that is an update to file 
/usr/src/lib/libc/gen/scandir.c

My inexperience, gets me close to a solution, yet "No Cigar" for the answer.

I tried to learn much on my own and figure out where the fault is, 
before asking you.  I am sure it will be a missing line or a missing 
define somewhere easy to see, with your experience in the Xorg files.

I was using FreeBSD 14.0-CURRENT software and pkgs.    "pkg update"  
"pkg upgrade"    At somepoint,  "startx"  would show a desktop 
environment, yet no keyboad or mouse input was received.  SSH 
fred@192.168.1.7 into the raspberry pi 4B and displaying 
/var/log/Xorg.0.log showed a failure of libinput_drv.so

[ 3730.553] (EE) Failed to load 
/usr/local/lib/xorg/modules/input/libinput_drv.so: 
/usr/local/lib/libinput.so.10: Undefined symbol "versionsort@FBSD_1.7"

I thought patiently waiting, someone else will find and fix this 
problem, and then a pkg update pkg upgrade sequence will pull in the fix 
and the desktop will work again.
So today,  I searched, grepped, read, tested building 
/usr/ports/x11/libinput  and still have not got a solution except to 
comment out the single line 1062 in quirks.c file. Built and then 
another test file  tools/libinput-record.c is broken.
So at your own pace and time, take a look an update  the ARM64 source 
tree to fix this broken use of  versionsort() function.

Thank you,

Fred Finster


 From Xorg Maintainers doc
xinput
P:      Peter Hutterer
M: peter.hutterer@who-t.net
L: xorg-devel@lists.x.org
W: https://gitlab.freedesktop.org/xorg/app/xinput
S:      Maintained

xf86-input-keyboard
P:      Alan Coopersmith
M: alan.coopersmith@oracle.com
L: xorg-devel@lists.x.org
W: https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard
S:      Maintained

xf86-input-mouse
P:      Alan Coopersmith
M: alan.coopersmith@oracle.com
L: xorg-devel@lists.x.org
W: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
S:      Maintained

Input subsystem
P:      Daniel Stone
M: daniel@fooishbar.org
P:      Peter Hutterer
M: peter.hutterer@who-t.net
L: xorg-devel@lists.x.org
W: https://wiki.x.org
S:      Maintained, being overhauled
S:      Please contact Daniel or Peter if you're planning to work on this

HERE I POSTED all the information I could find to fix my own problem.  
Alas, I am not experienced enough to solve this 'versionsort' missing 
error on my blog post here below.
https://ghostbsd-arm64.blogspot.com/2022/11/libinput-module-error-fbsd17-not-found.html

I can see 'versionsort' defined in with file 
/usr/src/lib/libc/gen/scandir.c   and  /usr/src/include/dirent.h

is ___BSD_VISIBLE defined??





libinput.so.10.13.0 is broken,  from updating software portsnap fetch 
update;  Then building /usr/ports/x11/libinput and having an issue with 
versionsort() function being defined
Is that a broken "for ARM64 source code tree" with #define __BSD_VISIBLE 
1 and #define __POSIX_VISIBLE 200809


Okay,  I do see below, that I mixed grep source with my GhostBSD 
fredTC93-pc x86_64 and my Raspberry Pi 4B Fred_RasPi4B ARM64:

WHY in file /usr/src/include/dirent.h  is there not a matching 
declaration line for versionsort()  ?
I see that updated software November 13, 2022 has versionsort() declared 
at line /usr/src/include/dirent.h:111:int

fred@fredTC93-pc /u/src> grep -in sort ./include/dirent.h ./sys/sys/dirent.
./include/dirent.h:107:intalphasort(const struct dirent **, const struct 
dirent **);

root@Fred_RasPi4B:/usr/src/include # grep -in sort 
/usr/src/include/dirent.h /usr/src/sys/sys/dirent.h
/usr/src/include/dirent.h:107:int     alphasort(const struct dirent **, 
const struct dirent **);
/usr/src/include/dirent.h:111:int     versionsort(const struct dirent 
**, const struct dirent **);


fred@fredTC93-pc /u/src> cd /usr/ports/x11
fred@fredTC93-pc /u/p/x11> grep -inr scandir *
evtest/files/patch-evtest.c:16:-ndev = scandir(DEV_INPUT_EVENT, 
&namelist, is_event_device, versionsort);
evtest/files/patch-evtest.c:17:+ndev = scandir(DEV_INPUT_EVENT, 
&namelist, is_event_device, alphasort);
fred@fredTC93-pc /u/p/x11>

LIKE:
./include/dirent.h:108:int versionsort(const struct dirent **, const 
struct dirent **);




root@Fred_RasPi4B:/usr/ports/x11/libinput # grep -inr versionsort *
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build:114:if 
cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build:115: 
config_h.set('HAVE_VERSIONSORT', '1')
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/quirks/README.md:22:Data 
files are read in versionsort order, read order determines how values
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:31:#if 
!defined(HAVE_VERSIONSORT) || defined(TEST_VERSIONSORT)
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:67:#ifndef 
HAVE_VERSIONSORT
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:75:versionsort(const 
struct dirent **a, const struct dirent **b)
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/quirks.c:42:#include 
"libinput-versionsort.h"
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/quirks.c:1092: 
ndev = scandir(data_path, &namelist, is_data_file, versionsort);
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/litest.c:1487: 
            versionsort);
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/test-utils.c:39:#define 
TEST_VERSIONSORT
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/test-utils.c:40:#include 
"libinput-versionsort.h"
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:46:#include 
"libinput-versionsort.h"
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:1881: 
ndev = scandir("/dev/input", &namelist, is_event_node, versionsort);
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:1943: 
ndev = scandir("/dev/input", &namelist, is_event_node, versionsort);
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build.orig:114:if 
cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build.orig:115: 
config_h.set('HAVE_VERSIONSORT', '1')
Binary file 
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-private/coredata.dat 
matches


root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-logs 
# grep -inr versionsort *
meson-log.txt:323:            #ifndef versionsort
meson-log.txt:324:                versionsort;
meson-log.txt:332:                versionsort;
meson-log.txt:336:Header "dirent.h" has symbol "versionsort" : YES
root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-logs 
#


root@Fred_RasPi4B:/usr/src/lib/libc/gen # ls -l scandir*
-rw-r--r--  1 root  wheel  5018 Nov 13 00:36 scandir-compat11.c
-rw-r--r--  1 root  wheel  5306 Nov 13 00:36 scandir.3
-rw-r--r--  1 root  wheel  5965 Nov 13 00:36 scandir.c
-rw-r--r--  1 root  wheel  1416 Aug  5 12:24 scandir_b.c


partial file  /usr/src/lib/libc/gen/scandir.c
#ifndef _KERNEL

__BEGIN_DECLS
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700
int      alphasort(const struct dirent **, const struct dirent **);
int      dirfd(DIR *);
#endif
#if __BSD_VISIBLE
int      versionsort(const struct dirent **, const struct dirent **);
DIR     *__opendir2(const char *, int);
int      fdclosedir(DIR *);
ssize_t  getdents(int, char *, size_t);
ssize_t  getdirentries(int, char *, size_t, off_t *);
#endif
DIR     *opendir(const char *);
DIR     *fdopendir(int);
struct dirent *
          readdir(DIR *);
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
int      readdir_r(DIR *, struct dirent *, struct dirent **);
#endif
void     rewinddir(DIR *);
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700
int      scandir(const char *, struct dirent ***,
             int (*)(const struct dirent *), int (*)(const struct dirent **,
             const struct dirent **));
#ifdef __BLOCKS__
int      scandir_b(const char *, struct dirent ***,
             int (^)(const struct dirent *),
             int (^)(const struct dirent **, const struct dirent **));
#endif
#endif
#if __BSD_VISIBLE
int      scandirat(int, const char *, struct dirent ***,
             int (*)(const struct dirent *), int (*)(const struct dirent **,
             const struct dirent **));
#endif
#if __XSI_VISIBLE
void     seekdir(DIR *, long);
long     telldir(DIR *);
#endif
int      closedir(DIR *);
__END_DECLS

#endif /* !_KERNEL */

#endif /* !_DIRENT_H_ */




~~~~~~~~~~EOF~~~~~~~~

root@Fred_RasPi4B:/usr/ports/x11/libinput # make clean
===>  Cleaning for ninja-1.11.1,2
===>  Cleaning for pkgconf-1.8.0_1,1
===>  Cleaning for libinput-1.22.0


root@Fred_RasPi4B:/usr/ports/x11/libinput # make -dn
===>  Building for libinput-1.22.0
[  3% 1/32] cc  -o libinput.so.10.13.0 
libinput.so.10.13.0.p/src_filter.c.o 
libinput.so.10.13.0.p/src_filter-flat.c.o 
libinput.so.10.13.0.p/src_filter-low-dpi.c.o 
libinput.so.10.13.0.p/src_filter-mouse.c.o 
libinput.so.10.13.0.p/src_filter-touchpad.c.o 
libinput.so.10.13.0.p/src_filter-touchpad-flat.c.o 
libinput.so.10.13.0.p/src_filter-touchpad-x230.c.o 
libinput.so.10.13.0.p/src_filter-tablet.c.o 
libinput.so.10.13.0.p/src_filter-trackpoint.c.o 
libinput.so.10.13.0.p/src_filter-trackpoint-flat.c.o 
libinput.so.10.13.0.p/src_libinput.c.o 
libinput.so.10.13.0.p/src_libinput-private-config.c.o 
libinput.so.10.13.0.p/src_evdev.c.o 
libinput.so.10.13.0.p/src_evdev-debounce.c.o 
libinput.so.10.13.0.p/src_evdev-fallback.c.o 
libinput.so.10.13.0.p/src_evdev-totem.c.o 
libinput.so.10.13.0.p/src_evdev-middle-button.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-tap.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-thumb.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-buttons.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-edge-scroll.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-gestures.c.o 
libinput.so.10.13.0.p/src_evdev-tablet.c.o 
libinput.so.10.13.0.p/src_evdev-tablet-pad.c.o 
libinput.so.10.13.0.p/src_evdev-tablet-pad-leds.c.o 
libinput.so.10.13.0.p/src_evdev-wheel.c.o 
libinput.so.10.13.0.p/src_path-seat.c.o 
libinput.so.10.13.0.p/src_udev-seat.c.o 
libinput.so.10.13.0.p/src_timer.c.o -Wl,--as-needed -Wl,--no-undefined 
-Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libinput.so.10 
-fstack-protector-strong -O2 -pipe -fstack-protector-strong -isystem 
/usr/local/include -fno-strict-aliasing -isystem /usr/local/include 
-Wl,-rpath,/usr/local/lib -Wl,-rpath-link,/usr/local/lib 
liblibinput-util.a libquirks.a 
-Wl,--version-script,/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput.sym 
/usr/local/lib/libmtdev.so /usr/local/lib/libudev.so 
/usr/local/lib/libevdev.so /usr/local/lib/libepoll-shim.so -lrt -lm 
/usr/local/lib/libwacom.so -Wl,--end-group
FAILED: libinput.so.10.13.0
cc  -o libinput.so.10.13.0 libinput.so.10.13.0.p/src_filter.c.o 
libinput.so.10.13.0.p/src_filter-flat.c.o 
libinput.so.10.13.0.p/src_filter-low-dpi.c.o 
libinput.so.10.13.0.p/src_filter-mouse.c.o 
libinput.so.10.13.0.p/src_filter-touchpad.c.o 
libinput.so.10.13.0.p/src_filter-touchpad-flat.c.o 
libinput.so.10.13.0.p/src_filter-touchpad-x230.c.o 
libinput.so.10.13.0.p/src_filter-tablet.c.o 
libinput.so.10.13.0.p/src_filter-trackpoint.c.o 
libinput.so.10.13.0.p/src_filter-trackpoint-flat.c.o 
libinput.so.10.13.0.p/src_libinput.c.o 
libinput.so.10.13.0.p/src_libinput-private-config.c.o 
libinput.so.10.13.0.p/src_evdev.c.o 
libinput.so.10.13.0.p/src_evdev-debounce.c.o 
libinput.so.10.13.0.p/src_evdev-fallback.c.o 
libinput.so.10.13.0.p/src_evdev-totem.c.o 
libinput.so.10.13.0.p/src_evdev-middle-button.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-tap.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-thumb.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-buttons.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-edge-scroll.c.o 
libinput.so.10.13.0.p/src_evdev-mt-touchpad-gestures.c.o 
libinput.so.10.13.0.p/src_evdev-tablet.c.o 
libinput.so.10.13.0.p/src_evdev-tablet-pad.c.o 
libinput.so.10.13.0.p/src_evdev-tablet-pad-leds.c.o 
libinput.so.10.13.0.p/src_evdev-wheel.c.o 
libinput.so.10.13.0.p/src_path-seat.c.o 
libinput.so.10.13.0.p/src_udev-seat.c.o 
libinput.so.10.13.0.p/src_timer.c.o -Wl,--as-needed -Wl,--no-undefined 
-Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libinput.so.10 
-fstack-protector-strong -O2 -pipe -fstack-protector-strong -isystem 
/usr/local/include -fno-strict-aliasing -isystem /usr/local/include 
-Wl,-rpath,/usr/local/lib -Wl,-rpath-link,/usr/local/lib 
liblibinput-util.a libquirks.a 
-Wl,--version-script,/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput.sym 
/usr/local/lib/libmtdev.so /usr/local/lib/libudev.so 
/usr/local/lib/libevdev.so /usr/local/lib/libepoll-shim.so -lrt -lm 
/usr/local/lib/libwacom.so -Wl,--end-group
ld: error: undefined symbol: versionsort
 >>> referenced by quirks.c
 >>> libquirks.a.p/src_quirks.c.o:(quirks_init_subsystem) in archive 
libquirks.a
 >>> referenced by quirks.c
 >>> libquirks.a.p/src_quirks.c.o:(quirks_init_subsystem) in archive 
libquirks.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11/libinput
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/libinput
root@Fred_RasPi4B:/usr/ports/x11/libinput #

root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools 
# grep -in versionsort *
libinput-record.c:46:#include "libinput-versionsort.h"
libinput-record.c:1881:    ndev = scandir("/dev/input", &namelist, 
is_event_node, versionsort);
libinput-record.c:1943:    ndev = scandir("/dev/input", &namelist, 
is_event_node, versionsort);

-- 
Fred  Finster
fred@thegalacticzoo.com
+1 971-718-9144

--------------UgHk0r8kR0fpCk2KzPP7oZFq
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div>
      <div>Hello Xorg maintainers,  I apologize for throwing so much
        information over the wall to point out a simple issue of broken
        software for</div>
      <div><br>
      </div>
      <div>versionsort()  function, that is an update to file
        /usr/src/lib/libc/gen/scandir.c</div>
      <div><br>
      </div>
      <div>My inexperience, gets me close to a solution, yet "No Cigar"
        for the answer.<br>
      </div>
      <div><br>
      </div>
      <div>I tried to learn much on my own and figure out where the
        fault is, before asking you.  I am sure it will be a missing
        line or a missing define somewhere easy to see, with your
        experience in the Xorg files.<br>
      </div>
      <div><br>
      </div>
      <div>I was using FreeBSD 14.0-CURRENT software and pkgs.    "pkg
        update"  "pkg upgrade"    At somepoint,  "startx"  would show a
        desktop environment, yet no keyboad or mouse input was
        received.  SSH <a class="moz-txt-link-abbreviated" href="mailto:fred@192.168.1.7">fred@192.168.1.7</a> into the raspberry pi 4B and
        displaying /var/log/Xorg.0.log showed a failure of
        libinput_drv.so <br>
      </div>
      <div><br>
        <span style="color: rgb(117, 117, 117); font-family: Roboto,
          sans-serif; font-size: 15px; font-style: normal;
          font-variant-ligatures: normal; font-variant-caps: normal;
          font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; background-color: rgb(255,
          255, 255); text-decoration-thickness: initial;
          text-decoration-style: initial; text-decoration-color:
          initial; display: inline !important; float: none;">[ 
          3730.553] (EE) Failed to load
          /usr/local/lib/xorg/modules/input/libinput_drv.so:
          /usr/local/lib/libinput.so.10: Undefined symbol
          <a class="moz-txt-link-rfc2396E" href="mailto:versionsort@FBSD_1.7">"versionsort@FBSD_1.7"</a></span></div>
      <div><span style="color: rgb(117, 117, 117); font-family: Roboto,
          sans-serif; font-size: 15px; font-style: normal;
          font-variant-ligatures: normal; font-variant-caps: normal;
          font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: left; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; background-color: rgb(255,
          255, 255); text-decoration-thickness: initial;
          text-decoration-style: initial; text-decoration-color:
          initial; display: inline !important; float: none;"><br>
        </span></div>
      <div>I thought patiently waiting, someone else will find and fix
        this problem, and then a pkg update pkg upgrade sequence will
        pull in the fix and the desktop will work again.</div>
      <div>So today,  I searched, grepped, read, tested building 
        /usr/ports/x11/libinput  and still have not got a solution
        except to comment out the single line 1062 in quirks.c file. 
        Built and then another test file  tools/libinput-record.c is
        broken.</div>
      <div>So at your own pace and time, take a look an update  the
        ARM64 source tree to fix this broken use of  versionsort()
        function.<br>
      </div>
      <div><br>
      </div>
      <div>Thank you,</div>
      <div><br>
      </div>
      <div>Fred Finster</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>From Xorg Maintainers doc<br>
      </div>
      <div>xinput</div>
      <div>P:      Peter Hutterer</div>
      <div>M:      <a class="moz-txt-link-abbreviated" href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a></div>
      <div>L:      <a class="moz-txt-link-abbreviated" href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a></div>
      <div>W:      <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/xorg/app/xinput">https://gitlab.freedesktop.org/xorg/app/xinput</a></div>;
      <div>S:      Maintained</div>
      <div><br>
      </div>
    </div>
    <div>
      <div>xf86-input-keyboard</div>
      <div>P:      Alan Coopersmith</div>
      <div>M:      <a class="moz-txt-link-abbreviated" href="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</a></div>
      <div>L:      <a class="moz-txt-link-abbreviated" href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a></div>
      <div>W:     
        <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard">https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard</a></div>;
      <div>S:      Maintained</div>
    </div>
    <div><br>
    </div>
    <div>
      <div>xf86-input-mouse</div>
      <div>P:      Alan Coopersmith</div>
      <div>M:      <a class="moz-txt-link-abbreviated" href="mailto:alan.coopersmith@oracle.com">alan.coopersmith@oracle.com</a></div>
      <div>L:      <a class="moz-txt-link-abbreviated" href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a></div>
      <div>W:     
        <a class="moz-txt-link-freetext" href="https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse">https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse</a></div>;
      <div>S:      Maintained</div>
    </div>
    <div><br>
    </div>
    <div>Input subsystem<br>
      P:      Daniel Stone<br>
      M:      <a class="moz-txt-link-abbreviated" href="mailto:daniel@fooishbar.org">daniel@fooishbar.org</a><br>
      P:      Peter Hutterer<br>
      M:      <a class="moz-txt-link-abbreviated" href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a><br>
      L:      <a class="moz-txt-link-abbreviated" href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a><br>
      W:      <a class="moz-txt-link-freetext" href="https://wiki.x.org">https://wiki.x.org</a><br>;
      S:      Maintained, being overhauled<br>
      S:      Please contact Daniel or Peter if you're planning to work
      on this<br>
      <br>
      HERE I POSTED all the information I could find to fix my own
      problem.  Alas, I am not experienced enough to solve this
      'versionsort' missing error on my blog post here below.</div>
    <div><a class="moz-txt-link-freetext" href="https://ghostbsd-arm64.blogspot.com/2022/11/libinput-module-error-fbsd17-not-found.html">https://ghostbsd-arm64.blogspot.com/2022/11/libinput-module-error-fbsd17-not-found.html</a></div>;
    <div><br>
    </div>
    <div>I can see 'versionsort' defined in with file 
      /usr/src/lib/libc/gen/scandir.c   and  /usr/src/include/dirent.h<br>
    </div>
    <p>is ___BSD_VISIBLE defined??<br>
    </p>
    <p><br>
    </p>
    <div><br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>libinput.so.10.13.0 is broken,  from updating software portsnap
      fetch update;  Then building /usr/ports/x11/libinput and having an
      issue with versionsort() function being defined</div>
    <div>Is that a broken "for ARM64 source code tree" with #define
      __BSD_VISIBLE 1 and #define __POSIX_VISIBLE 200809</div>
    <div> <br>
    </div>
    <div><br>
    </div>
    <div>Okay,  I do see below, that I mixed grep source with my
      GhostBSD fredTC93-pc x86_64 and my Raspberry Pi 4B Fred_RasPi4B
      ARM64:<br>
    </div>
    <div><br>
    </div>
    <div>
      <div>
        <div>WHY in file /usr/src/include/dirent.h  is there not a
          matching declaration line for versionsort()  ? <br>
        </div>
        <div>I see that updated software November 13, 2022 has
          versionsort() declared at line /usr/src/include/dirent.h:111:int<br>
        </div>
        <div><br>
        </div>
        <div>fred@fredTC93-pc /u/src&gt; grep -in sort 
          ./include/dirent.h ./sys/sys/dirent.</div>
        <div>./include/dirent.h:107:int<span style="white-space: pre;">	</span><span> </span>alphasort(const
          struct dirent **, const struct dirent **);</div>
      </div>
      <div><br>
      </div>
      <div>root@Fred_RasPi4B:/usr/src/include # grep -in sort
        /usr/src/include/dirent.h /usr/src/sys/sys/dirent.h<br>
        /usr/src/include/dirent.h:107:int     alphasort(const struct
        dirent **, const struct dirent **);<br>
        /usr/src/include/dirent.h:111:int     versionsort(const struct
        dirent **, const struct dirent **);<br>
        <br>
      </div>
      <div><br>
      </div>
      <div>fred@fredTC93-pc /u/src&gt; cd /usr/ports/x11</div>
      <div>fred@fredTC93-pc /u/p/x11&gt; grep -inr scandir *</div>
      <div>evtest/files/patch-evtest.c:16:-<span style="white-space: pre;">	</span>ndev
        = scandir(DEV_INPUT_EVENT, &amp;namelist, is_event_device,
        versionsort);</div>
      <div>evtest/files/patch-evtest.c:17:+<span style="white-space: pre;">	</span>ndev
        = scandir(DEV_INPUT_EVENT, &amp;namelist, is_event_device,
        alphasort);</div>
      <div>fred@fredTC93-pc /u/p/x11&gt; </div>
      <div><br>
      </div>
      <div>LIKE:</div>
      <div>
        <div>./include/dirent.h:108:int<span style="white-space: pre;">	</span> versionsort(const
          struct dirent **, const struct dirent **);</div>
        <div><br>
        </div>
      </div>
      <div><br>
        <div><br style="color: rgb(0, 0, 0); font-family: &quot;Times
            New Roman&quot;; font-size: medium; font-style: normal;
            font-variant-ligatures: normal; font-variant-caps: normal;
            font-weight: 400; letter-spacing: normal; orphans: 2;
            text-align: left; text-indent: 0px; text-transform: none;
            white-space: normal; widows: 2; word-spacing: 0px;
            -webkit-text-stroke-width: 0px; text-decoration-thickness:
            initial; text-decoration-style: initial;
            text-decoration-color: initial;">
          <br>
        </div>
      </div>
      <div>root@Fred_RasPi4B:/usr/ports/x11/libinput # grep -inr
        versionsort *<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build:114:if
        cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build:115:   
        config_h.set('HAVE_VERSIONSORT', '1')<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/quirks/README.md:22:Data
        files are read in versionsort order, read order determines how
        values<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:31:#if
        !defined(HAVE_VERSIONSORT) || defined(TEST_VERSIONSORT)<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:67:#ifndef
        HAVE_VERSIONSORT<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput-versionsort.h:75:versionsort(const
        struct dirent **a, const struct dirent **b)<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/quirks.c:42:#include
        "libinput-versionsort.h"<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/quirks.c:1092:   
        ndev = scandir(data_path, &amp;namelist, is_data_file,
        versionsort);<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/litest.c:1487:   
                   versionsort);<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/test-utils.c:39:#define 
        TEST_VERSIONSORT<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/test/test-utils.c:40:#include
        "libinput-versionsort.h"<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:46:#include
        "libinput-versionsort.h"<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:1881:   
        ndev = scandir("/dev/input", &amp;namelist, is_event_node,
        versionsort);<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools/libinput-record.c:1943:   
        ndev = scandir("/dev/input", &amp;namelist, is_event_node,
        versionsort);<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build.orig:114:if
        cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)<br>
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/meson.build.orig:115:   
        config_h.set('HAVE_VERSIONSORT', '1')<br>
        Binary file
work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-private/coredata.dat
        matches</div>
      <br>
    </div>
    <div><br>
    </div>
    <div>root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-logs
      # grep -inr versionsort *<br>
      meson-log.txt:323:            #ifndef versionsort<br>
      meson-log.txt:324:                versionsort;<br>
      meson-log.txt:332:                versionsort;<br>
      meson-log.txt:336:Header "dirent.h" has symbol "versionsort" : YES
      <br>
root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/_build/meson-logs
      # <br>
      <br style="color: rgb(0, 0, 0); font-family: &quot;Times New
        Roman&quot;; font-size: medium; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: 400; letter-spacing: normal; orphans: 2;
        text-align: left; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; text-decoration-thickness:
        initial; text-decoration-style: initial; text-decoration-color:
        initial;">
      <div><br>
      </div>
      <div>root@Fred_RasPi4B:/usr/src/lib/libc/gen # ls -l scandir*<br>
        -rw-r--r--  1 root  wheel  5018 Nov 13 00:36 scandir-compat11.c<br>
        -rw-r--r--  1 root  wheel  5306 Nov 13 00:36 scandir.3<br>
        -rw-r--r--  1 root  wheel  5965 Nov 13 00:36 scandir.c<br>
        -rw-r--r--  1 root  wheel  1416 Aug  5 12:24 scandir_b.c<br>
        <br>
      </div>
    </div>
    <div><br>
    </div>
    <div>partial file  /usr/src/lib/libc/gen/scandir.c</div>
    <div>#ifndef _KERNEL<br>
      <br>
      __BEGIN_DECLS<br>
      #if __POSIX_VISIBLE &gt;= 200809 || __XSI_VISIBLE &gt;= 700<br>
      int      alphasort(const struct dirent **, const struct dirent
      **);<br>
      int      dirfd(DIR *);<br>
      #endif<br>
      #if __BSD_VISIBLE<br>
      int      versionsort(const struct dirent **, const struct dirent
      **);<br>
      DIR     *__opendir2(const char *, int);<br>
      int      fdclosedir(DIR *);<br>
      ssize_t  getdents(int, char *, size_t);<br>
      ssize_t  getdirentries(int, char *, size_t, off_t *);<br>
      #endif<br>
      DIR     *opendir(const char *);<br>
      DIR     *fdopendir(int);<br>
      struct dirent *<br>
               readdir(DIR *);<br>
      #if __POSIX_VISIBLE &gt;= 199506 || __XSI_VISIBLE &gt;= 500<br>
      int      readdir_r(DIR *, struct dirent *, struct dirent **);<br>
      #endif<br>
      void     rewinddir(DIR *);<br>
      #if __POSIX_VISIBLE &gt;= 200809 || __XSI_VISIBLE &gt;= 700<br>
      int      scandir(const char *, struct dirent ***,<br>
                  int (*)(const struct dirent *), int (*)(const struct
      dirent **,<br>
                  const struct dirent **));<br>
      #ifdef __BLOCKS__<br>
      int      scandir_b(const char *, struct dirent ***,<br>
                  int (^)(const struct dirent *),<br>
                  int (^)(const struct dirent **, const struct dirent
      **));<br>
      #endif<br>
      #endif<br>
      #if __BSD_VISIBLE<br>
      int      scandirat(int, const char *, struct dirent ***,<br>
                  int (*)(const struct dirent *), int (*)(const struct
      dirent **,<br>
                  const struct dirent **));<br>
      #endif<br>
      #if __XSI_VISIBLE<br>
      void     seekdir(DIR *, long);<br>
      long     telldir(DIR *);<br>
      #endif<br>
      int      closedir(DIR *);<br>
      __END_DECLS<br>
      <br>
      #endif /* !_KERNEL */<br>
      <br>
      #endif /* !_DIRENT_H_ */<br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>~~~~~~~~~~EOF~~~~~~~~</div>
    <div><br>
    </div>
    <div>root@Fred_RasPi4B:/usr/ports/x11/libinput # make clean<br>
      ===&gt;  Cleaning for ninja-1.11.1,2<br>
      ===&gt;  Cleaning for pkgconf-1.8.0_1,1<br>
      ===&gt;  Cleaning for libinput-1.22.0<br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>root@Fred_RasPi4B:/usr/ports/x11/libinput # make -dn<br>
      ===&gt;  Building for libinput-1.22.0<br>
      [  3% 1/32] cc  -o libinput.so.10.13.0
      libinput.so.10.13.0.p/src_filter.c.o
      libinput.so.10.13.0.p/src_filter-flat.c.o
      libinput.so.10.13.0.p/src_filter-low-dpi.c.o
      libinput.so.10.13.0.p/src_filter-mouse.c.o
      libinput.so.10.13.0.p/src_filter-touchpad.c.o
      libinput.so.10.13.0.p/src_filter-touchpad-flat.c.o
      libinput.so.10.13.0.p/src_filter-touchpad-x230.c.o
      libinput.so.10.13.0.p/src_filter-tablet.c.o
      libinput.so.10.13.0.p/src_filter-trackpoint.c.o
      libinput.so.10.13.0.p/src_filter-trackpoint-flat.c.o
      libinput.so.10.13.0.p/src_libinput.c.o
      libinput.so.10.13.0.p/src_libinput-private-config.c.o
      libinput.so.10.13.0.p/src_evdev.c.o
      libinput.so.10.13.0.p/src_evdev-debounce.c.o
      libinput.so.10.13.0.p/src_evdev-fallback.c.o
      libinput.so.10.13.0.p/src_evdev-totem.c.o
      libinput.so.10.13.0.p/src_evdev-middle-button.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-tap.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-thumb.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-buttons.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-edge-scroll.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-gestures.c.o
      libinput.so.10.13.0.p/src_evdev-tablet.c.o
      libinput.so.10.13.0.p/src_evdev-tablet-pad.c.o
      libinput.so.10.13.0.p/src_evdev-tablet-pad-leds.c.o
      libinput.so.10.13.0.p/src_evdev-wheel.c.o
      libinput.so.10.13.0.p/src_path-seat.c.o
      libinput.so.10.13.0.p/src_udev-seat.c.o
      libinput.so.10.13.0.p/src_timer.c.o -Wl,--as-needed
      -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group
      -Wl,-soname,libinput.so.10 -fstack-protector-strong -O2 -pipe
      -fstack-protector-strong -isystem /usr/local/include
      -fno-strict-aliasing -isystem /usr/local/include
      -Wl,-rpath,/usr/local/lib -Wl,-rpath-link,/usr/local/lib
      liblibinput-util.a libquirks.a
-Wl,--version-script,/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput.sym
      /usr/local/lib/libmtdev.so /usr/local/lib/libudev.so
      /usr/local/lib/libevdev.so /usr/local/lib/libepoll-shim.so -lrt
      -lm /usr/local/lib/libwacom.so -Wl,--end-group<br>
      FAILED: libinput.so.10.13.0 <br>
      cc  -o libinput.so.10.13.0 libinput.so.10.13.0.p/src_filter.c.o
      libinput.so.10.13.0.p/src_filter-flat.c.o
      libinput.so.10.13.0.p/src_filter-low-dpi.c.o
      libinput.so.10.13.0.p/src_filter-mouse.c.o
      libinput.so.10.13.0.p/src_filter-touchpad.c.o
      libinput.so.10.13.0.p/src_filter-touchpad-flat.c.o
      libinput.so.10.13.0.p/src_filter-touchpad-x230.c.o
      libinput.so.10.13.0.p/src_filter-tablet.c.o
      libinput.so.10.13.0.p/src_filter-trackpoint.c.o
      libinput.so.10.13.0.p/src_filter-trackpoint-flat.c.o
      libinput.so.10.13.0.p/src_libinput.c.o
      libinput.so.10.13.0.p/src_libinput-private-config.c.o
      libinput.so.10.13.0.p/src_evdev.c.o
      libinput.so.10.13.0.p/src_evdev-debounce.c.o
      libinput.so.10.13.0.p/src_evdev-fallback.c.o
      libinput.so.10.13.0.p/src_evdev-totem.c.o
      libinput.so.10.13.0.p/src_evdev-middle-button.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-tap.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-thumb.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-buttons.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-edge-scroll.c.o
      libinput.so.10.13.0.p/src_evdev-mt-touchpad-gestures.c.o
      libinput.so.10.13.0.p/src_evdev-tablet.c.o
      libinput.so.10.13.0.p/src_evdev-tablet-pad.c.o
      libinput.so.10.13.0.p/src_evdev-tablet-pad-leds.c.o
      libinput.so.10.13.0.p/src_evdev-wheel.c.o
      libinput.so.10.13.0.p/src_path-seat.c.o
      libinput.so.10.13.0.p/src_udev-seat.c.o
      libinput.so.10.13.0.p/src_timer.c.o -Wl,--as-needed
      -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group
      -Wl,-soname,libinput.so.10 -fstack-protector-strong -O2 -pipe
      -fstack-protector-strong -isystem /usr/local/include
      -fno-strict-aliasing -isystem /usr/local/include
      -Wl,-rpath,/usr/local/lib -Wl,-rpath-link,/usr/local/lib
      liblibinput-util.a libquirks.a
-Wl,--version-script,/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/src/libinput.sym
      /usr/local/lib/libmtdev.so /usr/local/lib/libudev.so
      /usr/local/lib/libevdev.so /usr/local/lib/libepoll-shim.so -lrt
      -lm /usr/local/lib/libwacom.so -Wl,--end-group<br>
      ld: error: undefined symbol: versionsort<br>
      &gt;&gt;&gt; referenced by quirks.c<br>
      &gt;&gt;&gt;              
      libquirks.a.p/src_quirks.c.o:(quirks_init_subsystem) in archive
      libquirks.a<br>
      &gt;&gt;&gt; referenced by quirks.c<br>
      &gt;&gt;&gt;              
      libquirks.a.p/src_quirks.c.o:(quirks_init_subsystem) in archive
      libquirks.a<br>
      cc: error: linker command failed with exit code 1 (use -v to see
      invocation)<br>
      ninja: build stopped: subcommand failed.<br>
      *** Error code 1<br>
      <br>
      Stop.<br>
      make[1]: stopped in /usr/ports/x11/libinput<br>
      *** Error code 1<br>
      <br>
      Stop.<br>
      make: stopped in /usr/ports/x11/libinput<br>
      root@Fred_RasPi4B:/usr/ports/x11/libinput # <br>
    </div>
    <div><br>
    </div>
    <div>root@Fred_RasPi4B:/usr/ports/x11/libinput/work/libinput-fc59e574e050c502c9a3adefacf97babf3d09c7a/tools
      # grep -in versionsort *<br>
      libinput-record.c:46:#include "libinput-versionsort.h"<br>
      libinput-record.c:1881:    ndev = scandir("/dev/input",
      &amp;namelist, is_event_node, versionsort);<br>
      libinput-record.c:1943:    ndev = scandir("/dev/input",
      &amp;namelist, is_event_node, versionsort);<br>
    </div>
    <div><br>
    </div>
    <p></p>
    <pre class="moz-signature" cols="72">-- 
Fred  Finster
<a class="moz-txt-link-abbreviated" href="mailto:fred@thegalacticzoo.com">fred@thegalacticzoo.com</a>
+1 971-718-9144</pre>
  </body>
</html>

--------------UgHk0r8kR0fpCk2KzPP7oZFq--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?076925bf-b95c-9d34-6685-8293c5449e4f>