- add "-std=gnu17" to `env.NIX_CFLAGS_COMPILE` for `openjdk8` and `openjdk11`
Similar to what archlinux and gentoo did:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65ea75ab7b558c1a7471eaf9ab542cee66631ea5e2b65f230b87ced23f8b
Fixes build failure of `openjdk8` with gcc15:
```
In file included from /build/source/hotspot/agent/src/os/linux/libproc_impl.h:30,
from /build/source/hotspot/agent/src/os/linux/salibelf.h:30,
from /build/source/hotspot/agent/src/os/linux/salibelf.c:25:
/build/source/hotspot/agent/src/os/linux/libproc.h:86:13: error: 'bool'
cannot be defined via 'typedef'
86 | typedef int bool;
| ^~~~
/build/source/hotspot/agent/src/os/linux/libproc.h:86:13: note: 'bool'
is a keyword with '-std=c23' onwards
```
Fixes build failure of `openjdk11` with gcc15:
```
/build/source/src/java.base/unix/native/libnet/DefaultProxySelector.c:
In function 'getProxyByGProxyResolver':
/build/source/src/java.base/unix/native/libnet/DefaultProxySelector.c:389:16:
error: too many arguments to function 'g_proxy_resolver_lookup'; expected 0, have 4
389 | proxies = (*g_proxy_resolver_lookup)(resolver, uri, NULL, &error);
| ~^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
/build/source/src/java.base/unix/native/libnet/DefaultProxySelector.c:408:34:
error: too many arguments to function 'g_network_address_parse_uri'; expected 0, have 3
408 | (*g_network_address_parse_uri)(proxies[i], 0,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
```
A few patches of mine were just merged (yay!). Let's upgrade the
`fetchpatch` invocations from the original mailing list submission to
the accepted commit, accordingly.
I narrowed down the the files to patch because patching
autoconf-generated files will break, and is not needed because we are
regenerating those files anyways.
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>