From nobody Tue Dec 13 06:58:04 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NWTpm6Vpsz4kKfn for ; Tue, 13 Dec 2022 06:58:08 +0000 (UTC) (envelope-from fred@thegalacticzoo.com) Received: from nmtao102.oxsus-vadesecure.net (mta-132b.oxsus-vadesecure.net [135.148.117.231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NWTpm0Pcnz4JPH for ; Tue, 13 Dec 2022 06:58:07 +0000 (UTC) (envelope-from fred@thegalacticzoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=webcom.xion.oxcs.net header.s=mail1 header.b=E2CJmupb; spf=pass (mx1.freebsd.org: domain of fred@thegalacticzoo.com designates 135.148.117.231 as permitted sender) smtp.mailfrom=fred@thegalacticzoo.com; dmarc=pass (policy=quarantine) header.from=thegalacticzoo.com DKIM-Signature: v=1; a=rsa-sha256; bh=haogOl/4N4IjC5YwCAnRPaQ14O2nbCsHG+4VuA ho3Hc=; c=relaxed/relaxed; d=webcom.xion.oxcs.net; h=from:reply-to: subject:date:to:cc:resent-date:resent-from:resent-to:resent-cc: in-reply-to:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; q=dns/txt; s=mail1; t=1670914687; x=1671519487; b=E2CJmupb9hzVRmo7gCwNF5BSN6x3Zq6Tt1tLrHkSH ZONYxt5R07mbXGBbulCXSwpQwNUYy0kfmtkouQ5U5nGOtVqqR+vnAZbukV+hpjPSJ/nP7HJ /MPxr0tlBz0iIKS1zUDidOza+JLOY3g3cTU+6T5lAquB3x10bS1NqqfR14frLgTdRvAAvce Y7zM03s8+B/NNuPy9djMhnYEysLK51DOhuhTjle2zkOeEKFe5qaZBRvWHlHOJqj5y+vOffg x9sUb2uzz2af+DVtU1eyPQuadCpR/JtOvO65i8QPN7NeCosN1CdMUsG128wEfSLyt4KquEm Vs9jjEfJIrmIST4nQ== Received: from proxy-13.proxy.cloudus.ewr.xion.oxcs.net ([76.14.221.149]) by oxsus1nmtao02p.internal.vadesecure.com with ngmta id 74c23bec-1730480dc4835aa2; Tue, 13 Dec 2022 06:58:06 +0000 Content-Type: multipart/alternative; boundary="------------UgHk0r8kR0fpCk2KzPP7oZFq" Message-ID: <076925bf-b95c-9d34-6685-8293c5449e4f@thegalacticzoo.com> Date: Mon, 12 Dec 2022 22:58:04 -0800 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: peter.hutterer@who-t.net, alan.coopersmith@oracle.com, daniel@fooishbar.org From: Fred Finster Subject: libinput_drv.so , libinput.so.10.13.0 fail to build for ARM64 FreeBSD 14.0-CURRENT source tree, versionsort() function declaration problem Cc: fredfinster58@gmail.com, freebsd-arm@freebsd.org X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[thegalacticzoo.com,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:135.148.117.231]; R_DKIM_ALLOW(-0.20)[webcom.xion.oxcs.net:s=mail1]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:16276, ipnet:135.148.0.0/17, country:FR]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[135.148.117.231:from]; DKIM_TRACE(0.00)[webcom.xion.oxcs.net:+]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_NONE(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org] X-Rspamd-Queue-Id: 4NWTpm0Pcnz4JPH X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N 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
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
S:      Maintained

xf86-input-keyboard
P:      Alan Coopersmith
S:      Maintained

xf86-input-mouse
P:      Alan Coopersmith
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.

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:int  alphasort(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--