Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 829212 - sys-libs/glibc-2.33-r1 sln fails in install-symbolic-link
Summary: sys-libs/glibc-2.33-r1 sln fails in install-symbolic-link
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-14 21:58 UTC by Nuno
Modified: 2022-05-26 14:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
strace sln (trace.txt,12.74 KB, text/plain)
2021-12-14 21:58 UTC, Nuno
Details
bzip2 -k /dev/shm/sys-libs/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log (build.log.bz2,186.42 KB, application/x-bzip)
2021-12-14 22:10 UTC, Nuno
Details
dmesg (dmesg.txt,4.01 KB, text/plain)
2021-12-15 10:59 UTC, Nuno
Details
bug-829212-old-kernel-system-sln.patch (bug-829212-old-kernel-system-sln.patch,607 bytes, patch)
2021-12-21 23:39 UTC, Nuno
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno 2021-12-14 21:58:54 UTC
Created attachment 759016 [details]
strace sln

I'm trying to build sys-libs/glibc-2.33-r1::gentoo on my Banana Pi and it's failing on the install phase with the following:

    /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/sln /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/symlink.list
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/ld-linux-armhf.so.3: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libc.so.6: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libBrokenLocale.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libm.so.6: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libdl.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libpthread.so.0: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libc.so.6: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/librt.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libcrypt.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libthread_db.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libresolv.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnss_dns.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libanl.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnss_files.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnss_db.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnss_compat.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnss_hesiod.so.2: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libnsl.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libutil.so.1: invalid destination: Invalid argument
    /var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/ld-linux-armhf.so.3: invalid destination: Invalid argument
    make[1]: *** [Makefile:115: install-symbolic-link] Error 255                  
    make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'
    make: *** [Makefile:12: install] Error 2                                      
     * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (install phase):              
     *   emake failed



I've tried both glibc-2.33-r1 and glibc-2.33-r7, which are currently stable on arm, and get the same error.

    # emerge -pqv '=sys-libs/glibc-2.33-r1::gentoo'
    [ebuild   R   ] sys-libs/glibc-2.33-r1  USE="(crypt) multiarch nscd ssp (static-libs) -audit -caps (-cet) -compile-locales -custom-cflags -doc -gd -headers-only (-multilib) -multilib-bootstrap -profile (-selinux) (-static-pie) -suid -systemtap -test (-vanilla)"


Partial emerge --info:

    Portage 3.0.28 (python 3.9.9-final-0, default/linux/arm/17.0/armv7a, gcc-11.2.0, glibc-2.33-r1, 3.4.104-sunxi-g1df3de8e armv7l)
    =================================================================           
                             System Settings                                    
    =================================================================           
    System uname: Linux-3.4.104-sunxi-g1df3de8e-armv7l-with-glibc2.33           
    KiB Mem:      992956 total,     28680 free                                  
    KiB Swap:    4194296 total,   3904528 free                                  
    Timestamp of repository gentoo: Sat, 11 Dec 2021 01:45:01 +0000             
    Head commit of repository gentoo: 3f6c0b9b945215fbf8c349e823c45edd38d4dcd0  
    sh bash 5.1_p8                                                              
    ld GNU ld (Gentoo 2.37_p1 p0) 2.37                                          
    distcc 3.4 armv7a-unknown-linux-gnueabihf [disabled]                        
    app-shells/bash:          5.1_p8::gentoo                                    
    dev-lang/perl:            5.34.0-r3::gentoo                                 
    dev-lang/python:          3.8.12_p1::gentoo, 3.9.9::gentoo, 3.10.0_p1::gentoo
    dev-lang/rust-bin:        1.53.0::gentoo                                    
    dev-util/cmake:           3.20.5::gentoo                                    
    sys-apps/baselayout:      2.7-r3::gentoo                                    
    sys-apps/openrc:          0.44.9::gentoo                                    
    sys-apps/sandbox:         2.25::gentoo                                      
    sys-devel/autoconf:       2.69-r5::gentoo, 2.71-r1::gentoo                  
    sys-devel/automake:       1.16.4::gentoo                                    
    sys-devel/binutils:       2.37_p1::gentoo                                   
    sys-devel/gcc:            11.2.0::gentoo                                    
    sys-devel/gcc-config:     2.4::gentoo                                       
    sys-devel/libtool:        2.4.6-r6::gentoo                                  
    sys-devel/make:           4.3::gentoo                                       
    sys-kernel/linux-headers: 5.10-r1::gentoo (virtual/os-headers)              
    sys-libs/glibc:           2.33-r1::gentoo


sln seems to be working:

    portage@banana:/tmp$ cat links.txt                                          
    a.txt /tmp/link-a.txt                                                       
    b.txt /tmp//link-b.txt                                                      
    portage@banana:/tmp$ /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/sln links.txt
    portage@banana:/tmp$ ls -l link-*                                           
    lrwxrwxrwx 1 portage portage 5 Dec 14 21:41 link-a.txt -> a.txt             
    lrwxrwxrwx 1 portage portage 5 Dec 14 21:41 link-b.txt -> b.txt


However, after running the exact command that is failing as portage under strace (complete output attached), I see the problem:

    portage@banana:~/sys-libs/glibc-2.33-r1/image/lib$ strace -- /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/sln /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/symlink.list
    (...)
    statx(AT_FDCWD, "/var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libc.so.6", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_BASIC_STATS, 0xbef74dc0) = -1 ENOSYS (Function not implemented)
    fstatat64(AT_FDCWD, "/var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libc.so.6", 0xbef74d58, 0x1 /* AT_??? */) = -1 EINVAL (Invalid argument)
write(2, "/var/tmp/portage/sys-libs/glibc-"..., 100/var/tmp/portage/sys-libs/glibc-2.33-r1/image//lib/libc.so.6: invalid destination: Invalid argument
    ) = 100
    (...)


Output of file:

    /var/tmp/portage/sys-libs/glibc-2.33-r1/work/build-arm-armv7a-unknown-linux-gnueabihf-nptl/elf/sln: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, with debug_info, not stripped


Please let me know if any additional info is needed. The build log is quite big since it only fails in the install phase, but I can attach it if needed.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-14 22:03:30 UTC
Concerned about the very old kernel and suspect it might be related.

Could you compress the build log and attach it?
Comment 2 Nuno 2021-12-14 22:10:08 UTC
Created attachment 759018 [details]
bzip2 -k /dev/shm/sys-libs/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log

Hi Sam! Thanks for your reply. Here's the compressed build log.
Comment 3 Nuno 2021-12-14 22:18:25 UTC
I should probably mention that I have /var/tmp/portage mounted as tmpfs:

tmpfs   /var/tmp/portage   tmpfs  size=2500M,nr_inodes=1M,uid=portage,gid=portage,noatime,exec    0 0


Trying to build without tmpfs right now.
Comment 4 Andreas K. Hรผttel archtester gentoo-dev 2021-12-14 22:28:39 UTC
(In reply to Sam James from comment #1)
> Concerned about the very old kernel and suspect it might be related.

Yup.

statx() was added to Linux in kernel 4.11; library support was
added in glibc 2.28.
Comment 5 Steve Arnold archtester gentoo-dev 2021-12-14 22:35:59 UTC
Can you also provide the boot dmesg file from your Banana Pi?  You should be able to "match" the full name to a device tree file in 5.14-ish mainline.
Comment 6 Nuno 2021-12-15 10:59:11 UTC
Created attachment 759140 [details]
dmesg

Thanks for the replies, everyone.

Compiling without tmpfs failed as well.

It's a Banana Pi M1 (Allwinner A20).

Unfortunately the kernel I'm using[1] does not support DTS/DTB, but I've attached a partial dmesg output anyway.

I did a few tests using gentoo-sources 5.4 and arch/arm/boot/dts/sun7i-a20-bananapi.dts about a year ago. It was working fine, except for some issues with onewire (which I need) and voltage readings under sysfs (if I recall correctly), so I reverted back to this 3.4. I didn't have the time to try again since :(

Maybe I'll just try compiling glibc with a patched sln for now.

[1] https://github.com/linux-sunxi/linux-sunxi
Comment 7 Nuno 2021-12-21 23:39:46 UTC
Created attachment 759994 [details, diff]
bug-829212-old-kernel-system-sln.patch

I was able to build/install glibc-2.33-r7 using this custom patch I wrote.
It changes the Makerules file to use the /sbin/sln binary available in my system (from the previous install of glibc). It's just a quick workaround. Looking back, I'm not sure I should have done this since the /sbin/sln I have installed now has the same problem ๐Ÿ˜….

Anyway. Hopefully I'll be able to try out a new kernel in the next month or so.

Do you think this issue should be reported upstream?
Perhaps the minimum required kernel version should be raised (though that's not ideal) or an alternative function called if statx is not implemented.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-22 04:17:46 UTC
(In reply to Nuno from comment #7)
> Created attachment 759994 [details, diff] [details, diff]
> bug-829212-old-kernel-system-sln.patch
> 
> I was able to build/install glibc-2.33-r7 using this custom patch I wrote.
> It changes the Makerules file to use the /sbin/sln binary available in my
> system (from the previous install of glibc). It's just a quick workaround.
> Looking back, I'm not sure I should have done this since the /sbin/sln I
> have installed now has the same problem ๐Ÿ˜….
> 
> Anyway. Hopefully I'll be able to try out a new kernel in the next month or
> so.
> 
> Do you think this issue should be reported upstream?
> Perhaps the minimum required kernel version should be raised (though that's
> not ideal) or an alternative function called if statx is not implemented.

I think it probably should be, although I've got to be honest, I've not had time to really look at this properly :(

If you do report it upstream, could you pop the link here too (and link this bug in the upstream report)?

I think it seems like a valid bug: it should fall back, and at the very least, if glibc isn't interested in supporting older versions, they need to crank up the minimum requirements.
Comment 9 Nuno 2022-05-26 14:37:17 UTC
Sorry I didn't really get a chance to report this upstream.

Meanwhile, it seems this has been fixed in 2.34-r13, since I was able to install it:

     Thu May 26 08:14:31 2022 <<< sys-libs/glibc-2.33-r7
     Thu May 26 08:17:08 2022 >>> sys-libs/glibc-2.34-r13

(still using linux 3.4.104)