Created attachment 896804 [details] emerge --info net-misc/openssh-9.8_p1-r1 fails to compile on my x86_64 machine running hardened musl
Created attachment 896805 [details] build log
Broke with https://github.com/openssh/openssh-portable/commit/08f579231cd38a1c657aaa6ddeb8ab57a1fd4f5c.
I think it might work better to -USYSTEMD_NOTIFY with musl.
That is better but I tried passing -USYSTEMD_NOTIFY without success so I removed the preprocessor define from configure.ac
(In reply to Sam James from comment #3) > I think it might work better to -USYSTEMD_NOTIFY with musl. I disagree. The code is designed to be a noop when systemd is not being used. It would be better to fix the compile failure than to disable the code specifically for musl.
It looks like glibc's sys/socket.h has some macro magic to make all "struct sockaddr" types compatible with each other.
(In reply to Mike Gilbert from comment #5) > (In reply to Sam James from comment #3) > > I think it might work better to -USYSTEMD_NOTIFY with musl. > > I disagree. The code is designed to be a noop when systemd is not being used. > > It would be better to fix the compile failure than to disable the code > specifically for musl. Obviously - but I'm talking about a hacky cast to make it build on musl when it's never going to be taken, but might break runtime on glibc, vs stubbing it.
i.e. I'm not opposed to a patch, but the original one isn't obviously right and if we have to pick between the two, I'd take the macro being undefined. Feel free to look at doing it right if you have time though.
As far as I am aware, casting to struct sockaddr * is the accepted way to deal with this.
Blocking musl stages, e.g. on riscv
Reported https://bugzilla.mindrot.org/show_bug.cgi?id=3707. floppym discussed it on IRC and I was being a bit anal, I think. I'll do the cast for now given OpenSSH builds with -fno-strict-aliasing.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=452e53a96051ccb5000b6d1b923bc5f25aade72d commit 452e53a96051ccb5000b6d1b923bc5f25aade72d Author: Quincy Fleming <quincyf467@protonmail.com> AuthorDate: 2024-07-04 22:00:27 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-07-07 08:43:56 +0000 net-misc/openssh: Fix compile error on musl Closes: https://github.com/gentoo/gentoo/pull/37440 Closes: https://bugs.gentoo.org/935353 Signed-off-by: Quincy Fleming <quincyf467@protonmail.com> Signed-off-by: Sam James <sam@gentoo.org> net-misc/openssh/files/openssh-9.8_p1-musl-connect.patch | 13 +++++++++++++ net-misc/openssh/openssh-9.8_p1-r2.ebuild | 1 + 2 files changed, 14 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d791fcea11352d79bb896d131433a4c12d5e2fee commit d791fcea11352d79bb896d131433a4c12d5e2fee Author: Sam James <sam@gentoo.org> AuthorDate: 2024-07-07 08:43:34 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-07-07 08:43:57 +0000 net-misc/openssh: switch to upstream variant of patch Bug: https://bugs.gentoo.org/935353 Signed-off-by: Sam James <sam@gentoo.org> net-misc/openssh/files/openssh-9.8_p1-musl-connect.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)