Commit Graph

358215 Commits

Author SHA1 Message Date
Maximilian Bosch
da55ba2a06
sfizz: fix build w/glibc-2.34, actually enable tests
Failing Hydra build: https://hydra.nixos.org/build/163931927
2022-02-27 10:26:59 +01:00
Maximilian Bosch
64f9c92361
soci: fix build w/glibc-2.34
We don't run the tests and I didn't manage to get them running
trivially, so let's disable them. This not only speeds up
compilation-time, but also fixes the build for glibc 2.34.

Failing Hydra build: https://hydra.nixos.org/build/163952252
2022-02-27 10:26:58 +01:00
Maximilian Bosch
e10ea9608a
gcc{7,9,10}: apply patches for asan w/glibc-2.34
This should fix a few broken cc-wrapper tests that also check for
libasan[1][2][3]:

    [...]
    checking whether sanitizers are fully functional... ==243==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)
    [...]

The underlying issue is that `SIGSTKSZ` isn't a compile-time constant
anymore, but in this case the uninitialized `kAltStackSize` was
initialized early enough to evalute to `0`[4].

The issue is already fixed in gcc11 and there's  GCC 8.5 which also
contains the patch, however the backports to v9 and v10 aren't released
yet, so we have to apply patches on our own here.

For GCC 7.5 I applied the patch from gcc8 as it doesn't seem as if
there's an official upstream backport.

[1] https://hydra.nixos.org/build/163102264
[2] https://hydra.nixos.org/build/163624687
[3] https://hydra.nixos.org/build/163619227
[4] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100114
2022-02-27 10:26:58 +01:00
Maximilian Bosch
6a977757e2
zeroc-ice: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163122463
2022-02-27 10:26:58 +01:00
Maximilian Bosch
8ba95b6855
symengine: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163675793
2022-02-27 10:26:57 +01:00
Maximilian Bosch
5f9c36c07f
spdlog_0: fix build w/glibc-2.34
The patch only appears necessary for spdlog_1, so we skip it for v0
which builds fine without it.

Failing Hydra build: https://hydra.nixos.org/build/163659629
2022-02-27 10:26:57 +01:00
Maximilian Bosch
a2ac7c607b
recastnavigation: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163634618
2022-02-27 10:26:57 +01:00
Maximilian Bosch
322c490803
mustache-hpp: fix build w/glibc-2.34
Actually, this package doesn't need a build as it copies over the
.hpp-file only, so I simplified it a bit.

Failing Hydra build: https://hydra.nixos.org/build/163643601
2022-02-27 10:26:56 +01:00
Maximilian Bosch
52bba1de8a
clingcon: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163641612
2022-02-27 10:26:56 +01:00
Maximilian Bosch
f31930977d
djmount: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163123869
2022-02-27 10:26:56 +01:00
Maximilian Bosch
7605d492a7
qt512.qtwebengine: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163120450
2022-02-27 10:26:55 +01:00
Maximilian Bosch
81e0c947ec
xnee: fix build w/glibc-2.34
ChangeLog: https://hydra.nixos.org/build/163058159
2022-02-27 10:26:55 +01:00
Maximilian Bosch
4427e547ca
jetbrains.jdk: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163085108
2022-02-27 10:26:55 +01:00
Maximilian Bosch
c0f49544d4
maude: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163067005
2022-02-27 10:26:54 +01:00
Maximilian Bosch
1046c86c99
libosmscout: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/163072881
2022-02-27 10:26:54 +01:00
Maximilian Bosch
748faeb623
glibc: don't hide symbol __nss_files_fopen
I realized that `libredirect` doesn't wrap `__nss_files_fopen` anymore
which subsequently broke the `checkPhase` of `pkgs.openssh`[1] which was
implemented in 85c63a515d.

The reason for that is what `libc_hidden_{def,proto}` are used for, to
quote `libc-symbols.h`[2]:

    The following macros are used for PLT bypassing within libc.so
    (and if needed other libraries similarly).

This basically means that these symbols are altered in a way so that
they cannot be wrapped by `libredirect` even though it re-defines
`__nss_files_fopen` while being loaded at first with `LD_PRELOAD`.

The problem was caused by a change in 2.34[3] where the `files`-module
for NSS isn't loaded from `libnss_files.so.2` anymore, but the relevant
symbols are directly obtained from `libc.so.6` since a lot of glibc's
APIs were merged into `libc.so.6` before.

As this would effectively break `libredirect` whenever it tries to wrap
C APIs that interact with NSS (e.g. to use `getpwnam(3)`), I decided to
undo this change for `__nss_files_fopen`.

[1] https://hydra.nixos.org/build/160688523
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=include/libc-symbols.h;h=d41ecf4384d07f9108698dba1d4e9e6a7a9b975f;hb=ae37d06c7d127817ba43850f0f898b793d42aea7
[3] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf;hp=6212bb67f4695962748a5981e1b9fea105af74f6
2022-02-27 10:26:53 +01:00
Maximilian Bosch
6b98a5e512
nethack-qt: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/156236800
2022-02-27 10:26:53 +01:00
Maximilian Bosch
fe58c181d3
libspf2: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/156229214
2022-02-27 10:26:53 +01:00
Maximilian Bosch
89caa8e552
libfive: mark as broken
Failing Hydra build: https://hydra.nixos.org/build/156227205

Vendored `catch2` is too old and thus cannot be patched.
2022-02-27 10:26:52 +01:00
Maximilian Bosch
18d915e48e
ursadb: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/156279394
2022-02-27 10:26:52 +01:00
Maximilian Bosch
5f56cd5406
tiscamera: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/156249703
2022-02-27 10:26:52 +01:00
Maximilian Bosch
518865059a
libowfat: mark as broken
Failing Hydra build: https://hydra.nixos.org/build/156248131

This doesn't build with `glibc-2.34`, however there's already an
upstream fix and can be marked as unbroken as soon as it's available[1].

I tried to apply the patch from a Git mirror[2], however this doesn't
apply properly on `0.32` and I decided to wait for a release - such as
Gentoo does it - instead.

[1] https://bugs.gentoo.org/806505
[2] a10f89d5f3
2022-02-27 10:26:52 +01:00
Maximilian Bosch
da905d4cf9
nixos/stage-1: fix modprobe in initial ramdisk on systems w/glibc-2.34
This effectively fixes the majority of all VM tests which were broken
because `/dev/vda` (or any other block device) wasn't mountable:

      machine # mounting /dev/vda on /...
      machine # mount: mounting /dev/vda on /mnt-root/ failed: No such device[    2.820976] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
      machine # [    2.821757] CPU: 0 PID: 1 Comm: init Not tainted 5.10.72 #1-NixOS
      machine # [    2.821757] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
      machine # [    2.821757] Call Trace:
      machine # [    2.821757]  dump_stack+0x6b/0x83
      machine # [    2.821757]  panic+0x101/0x2c8
      machine # [    2.821757]  do_exit.cold+0x14/0xb3
      machine # [    2.821757]  do_group_exit+0x33/0xa0
      machine # [    2.821757]  __x64_sys_exit_group+0x14/0x20
      machine # [    2.821757]  do_syscall_64+0x33/0x40
      machine # [    2.821757]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      machine # [    2.821757] RIP: 0033:0x7f67ec2800f6
      machine # [    2.821757] Code: 00 4c 8b 0d 2c 5d 11 00 eb 19 66 2e 0f 1f 84 00 00 00 00 00 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 77 22 f4 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e2 f7 d8 64 41 89 01 eb da 66 2e 0f 1f 84 00
      machine # [    2.821757] RSP: 002b:00007fff8f5a71d8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
      machine # [    2.821757] RAX: ffffffffffffffda RBX: 0000000000699704 RCX: 00007f67ec2800f6
      machine # [    2.821757] RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
      machine # [    2.821757] RBP: 0000000000000004 R08: 00000000000000e7 R09: ffffffffffffff80
      machine # [    2.821757] R10: 00007f67ec33f3e0 R11: 0000000000000202 R12: 000000000000000b
      machine # [    2.821757] R13: 00007fff8f5a75a8 R14: 0000000000000000 R15: 00000000004fc198
      machine # [    2.821757] Kernel Offset: 0x31e00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
      machine # [    2.821757] Rebooting in 1 seconds..

This happened because the kernel failed to load modules such as `ext4`
from `boot.initrd.availableKernelModules`[1] on e.g. a `mount(2)` syscall.

The problem is that `kmod` isn't linked against `libpthread.so.0`
anymore because it got merged into `libc.so.6` (however, the .so still
exists), but still needs it:

      machine # newfstatat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/lib/x86_64", 0x7ffd951114c0, 0) = -1 ENOENT (No such file or directory)
      machine # openat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/lib/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
      machine # newfstatat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/lib/x86_64", 0x7ffd951114c0, 0) = -1 ENOENT (No such file or directory)
      machine # openat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
      machine # newfstatat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/lib", 0x7ffd951114c0, 0) = -1 ENOENT (No such file or directory)
      machine # openat(AT_FDCWD, "/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.34-36/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
      machine # writev(2, [{iov_base="/nix/store/kdc9n48ksdc1a8y8w512w"..., iov_len=69}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libpthread.so.0", iov_len=15}, {iov_base=": ", iov_len=2}, {iov_base="cy
      machine # ) = 184
      machine # exit_group(127)                         = ?
      machine # +++ exited with 127 +++
      machine # mount: mounting /dev/vda on /mnt-root/ failed: No such device
      machine # [   19.167180] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
      machine # [   19.167711] CPU: 0 PID: 1 Comm: init Not tainted 5.10.72 #1-NixOS

This is not a problem

* inside stage-1 because `LD_LIBRARY_PATH` points to `$out/lib` of
  extra-utils where `libpthread.so.6` also exists.
* on a running system because `${pkgs.glibc}/lib` is part of kmod's
  rpath.

However this is a problem inside the kernel which calls `modprobe` (in
our case `kmod`) to load modules and doesn't know about
`LD_LIBRARY_PATH`. Also, the rpath-reference was nuked.

To work around this, the kernel's `modprobe`
(i.e. `/proc/sys/kernel/modprobe`) now points to a wrapper which
explicitly declares `LD_LIBRARY_PATH`. We can't use `makeWrapper` here
because `modprobe` itself must not be renamed. Otherwise, `kmod` (which
is the link-target of `modprobe`) won't work because it expects
`argv[0] == "modprobe"` to perform modprobe's tasks.

[1] https://nixos.org/manual/nixos/stable/options.html#opt-boot.initrd.availableKernelModules
2022-02-27 10:26:51 +01:00
Maximilian Bosch
29e14f8a72
polyml*: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/156205993
2022-02-27 10:26:51 +01:00
Maximilian Bosch
0bdcc48485
conky: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155171697
2022-02-27 10:26:50 +01:00
Maximilian Bosch
40fc0090fc
aspcud: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155189149
2022-02-27 10:26:50 +01:00
Maximilian Bosch
84635a6e17
apitrace: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155150225
2022-02-27 10:26:50 +01:00
Maximilian Bosch
65f5fdb818
arangodb*: fix build w/glibc-2.34
Failing Hydra builds:
* https://hydra.nixos.org/build/155187495 (3.3)
* https://hydra.nixos.org/build/155161270 (3.4)
* https://hydra.nixos.org/build/155154245 (3.5)
2022-02-27 10:26:49 +01:00
Maximilian Bosch
f8fc20df2b
breakpad: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155160812

Fix derived from Fedora's Chromium fix[1].

[1] c3fea07699/f/chromium-92.0.4515.107-rawhide-gcc-std-max-fix.patch
2022-02-27 10:26:49 +01:00
Maximilian Bosch
dbe99a0172
ntp: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155170191

Patch derived from linuxfromscratch/openembedded.org[1][2].

[1] https://www.linuxfromscratch.org/blfs/view/svn/basicnet/ntp.html
[2] https://patchwork.openembedded.org/patch/180019/
2022-02-27 10:26:49 +01:00
Maximilian Bosch
a3f4ff59ae
openmw: mark as broken 2022-02-27 10:26:49 +01:00
Maximilian Bosch
d4593d4daf
pdfslicer: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155183850
2022-02-27 10:26:48 +01:00
Maximilian Bosch
7c5781615f
trafficserver: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155205200
2022-02-27 10:26:48 +01:00
Maximilian Bosch
c905ab58a2
trenchbroom: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155141010
2022-02-27 10:26:48 +01:00
Maximilian Bosch
b770794ce3
eternal-terminal: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/154077447
2022-02-27 10:26:44 +01:00
Maximilian Bosch
c2050675d6
leatherman: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155215198
2022-02-27 10:25:40 +01:00
Maximilian Bosch
49a7ee9604
seasocks: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155145624
2022-02-27 10:25:40 +01:00
Maximilian Bosch
f8a7d99e54
spdlog: 1.8.5 -> 1.9.2, fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155163350
2022-02-27 10:25:40 +01:00
Maximilian Bosch
bcf8aeff3c
ocaml 4.10/4.11: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/155189331
Applied a smaller patch from Fedora's fork[1] as it also applies on
older versions.

That said, these versions seem unmaintained anyways, so we should
probably drop them entirely.

[1] https://pagure.io/fedora-ocaml/c/dfb5e954a04f59b0456cc4c0ddf3acaf22e0ff07?branch=fedora-35-4.12.0
2022-02-27 10:25:39 +01:00
Maximilian Bosch
f97b995186
texinfo: fix build w/glibc-2.34 2022-02-27 10:25:39 +01:00
Maximilian Bosch
8e16dcc4aa
openjdk11: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/154132196
2022-02-27 10:25:39 +01:00
Maximilian Bosch
917b7e5fd2
ocaml: fix build w/glibc-2.34
ChangeLog: https://hydra.nixos.org/build/154122673
2022-02-27 10:25:39 +01:00
Maximilian Bosch
1470227ef4
postfix: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/154082134
2022-02-27 10:25:38 +01:00
Maximilian Bosch
48d7135742
emacs: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/153252802
2022-02-27 10:25:38 +01:00
Maximilian Bosch
96418eb0e7
rcs: fix build w/glibc-2.34
Failing Hydra build: https://hydra.nixos.org/build/153235059
2022-02-27 10:25:38 +01:00
Maximilian Bosch
0caf7e5f0c
qt514.qtwebengine: fix build w/glibc-2.34
Same problem here as with QT 5.15.

Failing Hydra build: https://hydra.nixos.org/build/153224604
2022-02-27 10:25:37 +01:00
Maximilian Bosch
b9078e581b
qt515.qtwebengine: fix build w/glibc-2.34
Derived from Fedora 35: d122c01163
Failing Hydra build: https://hydra.nixos.org/build/153232768
2022-02-27 10:25:37 +01:00
Maximilian Bosch
f81f59dfce
autofs: fix build w/glibc-2.34
This build was also broken by a libc const that isn't a number anymore
and thus can't be used at places where a constant value is needed:

    automount.c:86:37: error: initializer element is not constant

Failing Hydra build: https://hydra.nixos.org/build/153253104
2022-02-27 10:25:37 +01:00
Maximilian Bosch
486f248ce4
catch: fix build w/glibc-2.34
The issue was that `SIGSTKSZ` isn't an actual const anymore and thus
can't be used to define sizes of static variables such as

    static char foo[SIGSTKSZ];

since this results in compiler errors such as

    error: array bound is not an integer constant before ']' token

Fedora worked around this by hard-coding the value in `catch`. Since
this is mainly a testing-framework and there's no other fix for v1 - we
should eventually remove it entirely in favor of v2 anyways - I guess
this is a good-enough fix.

Failing Hydra build: https://hydra.nixos.org/build/152455108
2022-02-27 10:25:36 +01:00
Maximilian Bosch
8631ba18ee
fuse: fix build w/glibc-2.34
`closefrom` is now a part of `glibc-2.34`[1]:

> * The function closefrom has been added.  It closes all file descriptors
>   greater than or equal to a given integer.  This function is a GNU extension,
>   although it is also present in other systems.

Failing Hydra build: https://hydra.nixos.org/build/152456339

[1] https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
2022-02-27 10:25:36 +01:00