Subject: [libc-help] query about ABI formats in string libarary.

聂戬 22451155@zju.edu.cn
Wed Mar 26 16:48:53 GMT 2025


Dear libc-help maintainers,




I am a student try to cross compile glibc from x86_64 to aarch64 for my school team. I encounter a problem that some objects in string library are in version 1 (GNU/Linux) , what I expected is version 1 (GNU/Linux). I want to ask how can I fix it.




The environment of my system is:

Cross compile toolchian: gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu

gcc version: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0

Kernel: 5.15.0-134-generic




The configuration of glibc is:

glibc/configure \

    CFLAGS="-g -O2 -fthread-jumps -mcmodel=large -mabi=lp64" \

    --prefix=$(abs_builddir) \

    --enable-hacker-mode \

    --enable-timezone-tools \

    --disable-build-nscd \

    --disable-default-pie \

    --disable-pic \

    --disable-pie \

    --disable-nscd \

    --disable-pt_chown \

    --enable-static-nss \

    --disable-shared \

    --disable-tunables \

    --disable-werror \

    aarch64 \

    build_alias=x86_64 \

    host_alias=aarch64 \

    target_alias=aarch64




aarch64-none-linux-gnu-gcc --sysroot=/home/ukl/Desktop/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/libc ../sysdeps/aarch64/multiarch/memchr.c \

-c -std=gnu11 -fgnu89-inline  -g -O2 -fthread-jumps -mcmodel=large -mabi=lp64 -UUKL_BP -Wall -Wwrite-strings -Wundef \

-fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno \

-ftls-model=initial-exec -I../include -I/home/ukl/Desktop/rk-ukl/glibc-build/string -I/home/ukl/Desktop/rk-ukl/glibc-build \ 

-I../sysdeps/unix/sysv/linux/ukl  -I../sysdeps/unix/sysv/linux/aarch64  -I../sysdeps/aarch64/nptl \ 

-I../sysdeps/unix/sysv/linux/generic  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/unix/sysv/linux/include \

-I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  \

-I../sysdeps/unix/sysv  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/aarch64/fpu  -I../sysdeps/aarch64/multiarch \ -I../sysdeps/aarch64  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754/ldbl-128  -I../sysdeps/ieee754/dbl-64/wordsize-64 \

-I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio \

-I. -D_LIBC_REENTRANT -DMODULE_NAME=libc -DMODULE_libc=0 -DMODULE_testsuite=2 -DMODULE_rtld=1 -DMODULE_libpthread=0 \

-DMODULE_nonlib=3 -DMODULE_ldconfig=4 -DMODULE_libutil=0 -DMODULE_libnsl=0 -DMODULE_libnss_files=0 -DMODULE_libnss_nisplus=0 \

-DMODULE_libdl=0 -DMODULE_librt=0 -DMODULE_libresolv=0 -DMODULE_libmvec=0 -DMODULE_libm=0 -DMODULE_LIBS_BEGIN=0 \

-DMODULE_nscd=5 -DMODULE_libnss_dns=0 -DMODULE_iconvprogs=6 -DMODULE_libcrypt=0 -include ../include/libc-symbols.h \

-o /home/ukl/Desktop/rk-ukl/glibc-build/string/memchr.o -MD -MP -MF /home/ukl/Desktop/rk-ukl/glibc-build/string/memchr.o.dt \

-MT /home/ukl/Desktop/rk-ukl/glibc-build/string/memchr.o




The abi version error files are:

$ file *.o | grep -v "version 1 (SYSV)"

memchr.o:                        ELF 64-bit LSB relocatable, ARM aarch64, version 1 (GNU/Linux), with debug_info, not stripped

memcpy.o:                        ELF 64-bit LSB relocatable, ARM aarch64, version 1 (GNU/Linux), with debug_info, not stripped

memmove.o:                       ELF 64-bit LSB relocatable, ARM aarch64, version 1 (GNU/Linux), with debug_info, not stripped

memset.o:                        ELF 64-bit LSB relocatable, ARM aarch64, version 1 (GNU/Linux), with debug_info, not stripped

strlen.o:                        ELF 64-bit LSB relocatable, ARM aarch64, version 1 (GNU/Linux), with debug_info, not stripped







Thank for your time and expertise,

Jian Nie

Th


More information about the Libc-help mailing list