Re: glibc regression on alpha with 2.34+

John Paul Adrian Glaubitz <[email protected]> Tue, 13 Dec 2022 17:21:55 +0100
Newsgroups gmane.linux.debian.ports.alpha
Message-ID <[email protected]>
Hi!

On 12/13/22 10:52, John Paul Adrian Glaubitz wrote:
> You could cross-compile glibc. That's most likely what I am going to do.

For the record, here's how I am doing it.

1. Create an alpha chroot on an x86_64 host system using debootstrap
    on a system with qemu-user-static installed.

    # debootstrap --no-check-gpg --arch=alpha unstable /srv/sid-alpha-sbuild http://ftp.ports.debian.org/debian-ports

    (See below for schroot configuration).

2. Install cross-compiler for alpha as well as build dependencies for glibc:

    # apt install g++-alpha-linux-gnu
    # apt build-dep --arch-only glibc

3. Cross-compile glibc on x86_64 on host system:

    $ cd /path/to/glibc/
    $ mkdir build && cd build
    $ ../configure --host=alpha-linux-gnu --disable-werror --prefix=/usr --disable-sanity-checks && make -j8

4. Enter alpha schroot and run the the following command from the build directory:

    (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$ LD_LIBRARY_PATH=/home/glaubitz/glibc-git/build /bin/bash

    If the bug is present, this command will segfault:

    Segmentation fault

    Otherwise it will just spawn another bash which can be exited with "exit":

    (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$ LD_LIBRARY_PATH=/home/glaubitz/glibc-git/build /bin/bash
    (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$
    exit
    (sid-alpha-sbuild)glaubitz@z6:~/glibc-git/build$

The trick is to share the glibc source directory into the schroot. This is achieved by the following
two configuration files:

root@z6:~> cat /etc/schroot/chroot.d/sid-alpha-sbuild
[sid-alpha-sbuild]
description=Debian sid chroot for alpha
type=directory
directory=/local_scratch/sid-alpha-sbuild
profile=sbuild
#aliases=sid
groups=root,sbuild,glaubitz,buildd
root-groups=root,sbuild,glaubitz,buildd
root@z6:~>

root@z6:~> cat /etc/schroot/sbuild/fstab
# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/proc           /proc           none    rw,bind         0       0
/sys            /sys            none    rw,bind         0       0
/dev/pts        /dev/pts        none    rw,bind         0       0
tmpfs           /dev/shm        tmpfs   defaults        0       0
# Mount a large scratch space for the build, so we don't use up
# space on an LVM snapshot of the chroot itself.
/home/glaubitz  /home/glaubitz   none    rw,bind         0       0
root@z6:~>

To bisect, just run the normal git bisect process from the and just run the
test command in the emulated schroot from a second terminal.

Adrian