This code only switched the usage of the removed __ functions based on availability of _STAT_VER and _MKNOD_VER in the ports/linux/subport file. If you change the conditional to 'if true ; then' the system will enable the older style code unconditionally. I did verify that appears to be working for me.

If anyone has a good idea how to adjust the configure script to pass the data to the subport file, that would be ideal. Default behavior of checking the system, optional behaving of an --enable-compat-xfunctions -- or something like that.

As for the loongarch64, this code should work there as it's now written. I do not have a way to test this, so I'm hoping JiaLing Zhang will be able to build and test this.

All of my testing was accomplished using the 'make test' target. More extensive testing will be needed before we can trust this for OE, but it's probably closer to something that does what we need.

(There is still more duplication then I would like.. hopefully reviewers will be able to suggest something.)

--Mark

On 5/30/23 10:01 PM, Mark Hatle via lists.openembedded.org wrote:
Changes to eliminate __*.c function usage were based on the patch:

    From: JiaLing Zhang <zhangjial...@loongson.cn>
    Subject: [OE-core] [PATCH v4] Fixes pseudo build in loongarch64

    Fixes [YOCTO #15110]

    Some functions used in the project have been removed from glibc. After the 
removal of these functions,
    the architecture in glibc will not include the removed functions.
    This patch resolves the usage and compilation issues on the loongarch64 
architecture

    Signed-off-by: JiaLing Zhang <zhangjial...@loongson.cn>

This code is NOT loongarch64 specific, but implements support for newer
glibc where the __*x*stat and __xmknod* functions are no longer present
in headers as of roughly glibc 2.33.

The functions, on x86, x86_64 and aarch64 may still be present for
compatibility but new software should no longer be using it.  Pseudo
can likely change it's default behavior unless support for really old
hosts is still desired.

Signed-off-by: Mark Hatle <mark.ha...@amd.com>
---
  ports/linux/guts/fopen64.c                   |  4 +-
  ports/linux/guts/freopen64.c                 |  4 +-
  ports/linux/guts/fstat.c                     |  8 ++-
  ports/linux/guts/fstat64.c                   | 14 +++-
  ports/linux/guts/fstatat.c                   |  9 ++-
  ports/linux/guts/fstatat64.c                 | 42 +++++++++++-
  ports/linux/guts/lstat.c                     |  2 +-
  ports/linux/guts/lstat64.c                   |  2 +-
  ports/linux/guts/mknod.c                     |  2 +-
  ports/linux/guts/mknodat.c                   | 71 +++++++++++++++++++-
  ports/linux/guts/mkostemp64.c                |  2 +-
  ports/linux/guts/openat.c                    | 18 ++---
  ports/linux/guts/stat.c                      |  2 +-
  ports/linux/guts/stat64.c                    |  2 +-
  ports/linux/old__x/README                    | 28 ++++++++
  ports/linux/{ => old__x}/guts/__fxstat.c     |  0
  ports/linux/{ => old__x}/guts/__fxstat64.c   |  0
  ports/linux/{ => old__x}/guts/__fxstatat.c   |  0
  ports/linux/{ => old__x}/guts/__fxstatat64.c |  0
  ports/linux/{ => old__x}/guts/__lxstat.c     |  0
  ports/linux/{ => old__x}/guts/__lxstat64.c   |  0
  ports/linux/{ => old__x}/guts/__xmknod.c     |  0
  ports/linux/{ => old__x}/guts/__xmknodat.c   |  0
  ports/linux/{ => old__x}/guts/__xstat.c      |  0
  ports/linux/{ => old__x}/guts/__xstat64.c    |  0
  ports/linux/old__x/guts/fstat.c              | 15 +++++
  ports/linux/old__x/guts/fstat64.c            | 15 +++++
  ports/linux/old__x/guts/fstatat.c            | 15 +++++
  ports/linux/old__x/guts/fstatat64.c          | 15 +++++
  ports/linux/old__x/guts/lstat.c              | 15 +++++
  ports/linux/old__x/guts/lstat64.c            | 15 +++++
  ports/linux/old__x/guts/mknod.c              | 15 +++++
  ports/linux/old__x/guts/mknodat.c            | 15 +++++
  ports/linux/old__x/guts/mkostemp64.c         | 53 +++++++++++++++
  ports/linux/old__x/portdefs.h                | 40 +++++++++++
  ports/linux/old__x/pseudo_wrappers.c         | 48 +++++++++++++
  ports/linux/old__x/wrapfuncs.in              | 18 +++++
  ports/linux/portdefs.h                       | 19 ------
  ports/linux/pseudo_wrappers.c                | 43 ------------
  ports/linux/subports                         | 15 +++++
  ports/linux/wrapfuncs.in                     | 26 +++----
  pseudo_client.h                              | 38 +++++++++--
  42 files changed, 520 insertions(+), 110 deletions(-)
  create mode 100644 ports/linux/old__x/README
  rename ports/linux/{ => old__x}/guts/__fxstat.c (100%)
  rename ports/linux/{ => old__x}/guts/__fxstat64.c (100%)
  rename ports/linux/{ => old__x}/guts/__fxstatat.c (100%)
  rename ports/linux/{ => old__x}/guts/__fxstatat64.c (100%)
  rename ports/linux/{ => old__x}/guts/__lxstat.c (100%)
  rename ports/linux/{ => old__x}/guts/__lxstat64.c (100%)
  rename ports/linux/{ => old__x}/guts/__xmknod.c (100%)
  rename ports/linux/{ => old__x}/guts/__xmknodat.c (100%)
  rename ports/linux/{ => old__x}/guts/__xstat.c (100%)
  rename ports/linux/{ => old__x}/guts/__xstat64.c (100%)
  create mode 100644 ports/linux/old__x/guts/fstat.c
  create mode 100644 ports/linux/old__x/guts/fstat64.c
  create mode 100644 ports/linux/old__x/guts/fstatat.c
  create mode 100644 ports/linux/old__x/guts/fstatat64.c
  create mode 100644 ports/linux/old__x/guts/lstat.c
  create mode 100644 ports/linux/old__x/guts/lstat64.c
  create mode 100644 ports/linux/old__x/guts/mknod.c
  create mode 100644 ports/linux/old__x/guts/mknodat.c
  create mode 100644 ports/linux/old__x/guts/mkostemp64.c
  create mode 100644 ports/linux/old__x/portdefs.h
  create mode 100644 ports/linux/old__x/pseudo_wrappers.c
  create mode 100644 ports/linux/old__x/wrapfuncs.in
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#181984): 
https://lists.openembedded.org/g/openembedded-core/message/181984
Mute This Topic: https://lists.openembedded.org/mt/99234918/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to