diff mbox series

gitlab-ci/custom-runners: Disable -static-pie for ubuntu-20.04-aarch64

Message ID 20220823210329.1969895-1-richard.henderson@linaro.org
State Superseded
Headers show
Series gitlab-ci/custom-runners: Disable -static-pie for ubuntu-20.04-aarch64 | expand

Commit Message

Richard Henderson Aug. 23, 2022, 9:03 p.m. UTC
The project has reached the magic size at which we see

/usr/aarch64-linux-gnu/lib/libc.a(init-first.o): in function `__libc_init_first':
(.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against \
symbol `__environ' defined in .bss section in /usr/aarch64-linux-gnu/lib/libc.a(environ.o)
/usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please recompile with -fPIC

The bug has been reported upstream, but in the meantime there is
nothing we can do except build a non-pie executable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---

Irritatingly, once this is fixed, we're still in a broken state because
we're now picking up an x86_64 cross-compiler, without all of the
required static libraries:

  https://gitlab.com/qemu-project/qemu/-/jobs/2923714301#L3028

    Cross compilers
    aarch64                      : cc
    arm                          : arm-linux-gnueabihf-gcc
    i386                         : i686-linux-gnu-gcc
    mips64el                     : mips64el-linux-gnuabi64-gcc
    mipsel                       : mipsel-linux-gnu-gcc
    riscv64                      : riscv64-linux-gnu-gcc
    s390x                        : s390x-linux-gnu-gcc
    x86_64                       : x86_64-linux-gnu-gcc

where we hadn't done so just 4 days ago:

  https://gitlab.com/qemu-project/qemu/-/jobs/2908305198

    Cross compilers
    aarch64                      : cc
    arm                          : arm-linux-gnueabihf-gcc
    i386                         : i686-linux-gnu-gcc
    riscv64                      : riscv64-linux-gnu-gcc
    s390x                        : s390x-linux-gnu-gcc

Alex? I think you're the only one who would know how this host
is supposed to be configured for gitlab...

I guess I'm not going to let this affect the release, but we
do have quite a number of annoyingly consistent failures now.
We should either fix them or disable them.


r~

---
 .gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alex Bennée Aug. 24, 2022, 5:15 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> The project has reached the magic size at which we see
>
> /usr/aarch64-linux-gnu/lib/libc.a(init-first.o): in function `__libc_init_first':
> (.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against \
> symbol `__environ' defined in .bss section in /usr/aarch64-linux-gnu/lib/libc.a(environ.o)
> /usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please recompile with -fPIC
>
> The bug has been reported upstream, but in the meantime there is
> nothing we can do except build a non-pie executable.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>
> Irritatingly, once this is fixed, we're still in a broken state because
> we're now picking up an x86_64 cross-compiler, without all of the
> required static libraries:
>
>   https://gitlab.com/qemu-project/qemu/-/jobs/2923714301#L3028
>
>     Cross compilers
>     aarch64                      : cc
>     arm                          : arm-linux-gnueabihf-gcc
>     i386                         : i686-linux-gnu-gcc
>     mips64el                     : mips64el-linux-gnuabi64-gcc
>     mipsel                       : mipsel-linux-gnu-gcc
>     riscv64                      : riscv64-linux-gnu-gcc
>     s390x                        : s390x-linux-gnu-gcc
>     x86_64                       : x86_64-linux-gnu-gcc
>
> where we hadn't done so just 4 days ago:
>
>   https://gitlab.com/qemu-project/qemu/-/jobs/2908305198
>
>     Cross compilers
>     aarch64                      : cc
>     arm                          : arm-linux-gnueabihf-gcc
>     i386                         : i686-linux-gnu-gcc
>     riscv64                      : riscv64-linux-gnu-gcc
>     s390x                        : s390x-linux-gnu-gcc
>
> Alex? I think you're the only one who would know how this host
> is supposed to be configured for gitlab...

Ahh because aarch64.ci.qemu.org is also a developer box I had enabled a
bunch of additional cross compilers for the tests (because we can't take
full advantage of the docker images on non-x86). However it shouldn't
affect the main build, these compilers are only used for the TCG tests.

It looks like the compiler is borked because:

/usr/lib/gcc-cross/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libm-2.35.a: No such file or directory                     
/usr/lib/gcc-cross/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libmvec.a: No such file or directory       

but the libc6-dev-amd64-cross package puts this in:

  /usr/x86_64-linux-gnu/lib/libmvec.a

Anyway as x86_64 is the one compiler that is available in the docker
multiarch I've dropped that for now. It won't get used by the CI system
as it can't use docker but developers using the box should get:

  Cross compilers
    aarch64                      : cc
    arm                          : arm-linux-gnueabihf-gcc
    i386                         : i686-linux-gnu-gcc
    mips64el                     : mips64el-linux-gnuabi64-gcc
    mipsel                       : mipsel-linux-gnu-gcc
    riscv64                      : riscv64-linux-gnu-gcc
    s390x                        : s390x-linux-gnu-gcc
    x86_64                       : $(DOCKER_SCRIPT) cc --cc x86_64-linux-gnu-gcc -i qemu/debian-amd64-cross -s /home/alex/lsrc/qemu.git --

> I guess I'm not going to let this affect the release, but we
> do have quite a number of annoyingly consistent failures now.
> We should either fix them or disable them.

The rest of the tests build and run fine now.

>
>
> r~
>
> ---
>  .gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml b/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
> index 3d878914e7..85a234801a 100644
> --- a/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
> +++ b/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
> @@ -16,7 +16,9 @@ ubuntu-20.04-aarch64-all-linux-static:
>   # --disable-glusterfs is needed because there's no static version of those libs in distro supplied packages
>   - mkdir build
>   - cd build
> - - ../configure --enable-debug --static --disable-system --disable-glusterfs --disable-libssh
> + # Disable -static-pie due to build error with system libc:
> + # https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1987438
> + - ../configure --enable-debug --static --disable-system --disable-glusterfs --disable-libssh --disable-pie --extra-cflags='-fno-pie -no-pie'
>     || { cat config.log meson-logs/meson-log.txt; exit 1; }
>   - make --output-sync -j`nproc --ignore=40`
>   - make --output-sync -j`nproc --ignore=40` check V=1

I'll update this once the tree is open as you may have noticed the host
is now a 22.04 one (which hopefully means we can enable glusterfs and
libssh now)
diff mbox series

Patch

diff --git a/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml b/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
index 3d878914e7..85a234801a 100644
--- a/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
+++ b/.gitlab-ci.d/custom-runners/ubuntu-20.04-aarch64.yml
@@ -16,7 +16,9 @@  ubuntu-20.04-aarch64-all-linux-static:
  # --disable-glusterfs is needed because there's no static version of those libs in distro supplied packages
  - mkdir build
  - cd build
- - ../configure --enable-debug --static --disable-system --disable-glusterfs --disable-libssh
+ # Disable -static-pie due to build error with system libc:
+ # https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1987438
+ - ../configure --enable-debug --static --disable-system --disable-glusterfs --disable-libssh --disable-pie --extra-cflags='-fno-pie -no-pie'
    || { cat config.log meson-logs/meson-log.txt; exit 1; }
  - make --output-sync -j`nproc --ignore=40`
  - make --output-sync -j`nproc --ignore=40` check V=1