This is a regression introduced by =sys-apps/openrc-0.26.2. It is critical in that it leaves a system unbootable. I'm masking >sys-apps/openrc-0.24.2 on all uclibc profiles
Actually, all versions of openrc after 0.23.2 are broken so I'm restricting the mask to >sys-apps/openrc-0.23.2
This problem was introduced with commit 074d90f5 which just dropped -D_BSD_SOURCE from CPPFLAGS in mk/os-Linux.mk. This was to address bug #604666 about some compiler warnings. I'm looking more deeply into what this macro is exposing (or hiding) when defined.
Two possible fixes: 1) we revert those changes in openrc. This makes for compatibility with current uclibc-ng and <=sys-libs/glibc-2.19. See man 7 feature_test_macros: To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE Note: we have glibc-2.17 and later in the tree. 2) I add _DEFAULT_SOURCE to uclibc-ng which it currently lacks. I'm going to do the later anyhow, but I think that removing -D_BSD_SOURCES was premature even for glibc.
(In reply to Anthony Basile from comment #3) > Two possible fixes: > > 1) we revert those changes in openrc. This makes for compatibility with > current uclibc-ng and <=sys-libs/glibc-2.19. See man 7 feature_test_macros: > > To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and > _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define > both _BSD_SOURCE and _DEFAULT_SOURCE > > Note: we have glibc-2.17 and later in the tree. I'm no expert on glibc, but 2.20+ has been stable for almost two years at this point. Also, I haven't received any requests from outside of Gentoo that I go back to the older versions. Another thing to consider is that glibc-2.20+ has a hard requirement for >= Linux 2.6.32, and I don't think we have a kernel that old in the tree. > 2) I add _DEFAULT_SOURCE to uclibc-ng which it currently lacks. > > I'm going to do the later anyhow, but I think that removing -D_BSD_SOURCES > was premature even for glibc. As I said above, it has been almost two years and this is the first time I've heard of this issue, so although I can be convinced this was premature, I'm not convinced at this point.
Do you have a backtrace for peanut gallery? It looks odd that openrc SIGSEGVs instead of printing what went wrong.
With https://github.com/OpenRC/openrc/pull/136 enabled openrc is full of build erros on uclibc-ng, like: libeinfo.c: In function 'colour_terminal': libeinfo.c:466:4: error: implicit declaration of function 'strlcpy' [-Werror=implicit-function-declaration] strlcpy(tmp, tgoto(bold, 0, 0), sizeof(tmp)); ^ libeinfo.c:466:4: warning: nested extern declaration of 'strlcpy' [-Wnested-externs] libeinfo.c:467:4: error: implicit declaration of function 'strlcat' [-Werror=implicit-function-declaration] strlcat(tmp, tgoto(_af, 0, c & 0x07), sizeof(tmp)); ^ libeinfo.c:467:4: warning: nested extern declaration of 'strlcat' [-Wnested-externs] libeinfo.c: In function 'elogv': libeinfo.c:525:3: error: implicit declaration of function 'vsyslog' [-Werror=implicit-function-declaration] vsyslog(level, fmt, apc); ^ libeinfo.c:525:3: warning: nested extern declaration of 'vsyslog' [-Wnested-externs] These are clearly BSD functions, not POSIX. This change is enough to get openrc-9999 building and running for me: diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk index 3a3c5167..15666fca 100644 --- a/mk/os-Linux.mk +++ b/mk/os-Linux.mk @@ -11,7 +11,7 @@ SFX= .Linux.in PKG_PREFIX?= /usr -CPPFLAGS+= -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 +CPPFLAGS+= -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 LIBDL= -Wl,-Bdynamic -ldl ifeq (${MKSELINUX},yes) diff --git a/src/rc/openrc-init.c b/src/rc/openrc-init.c index 398259cc..c6611ab5 100644 --- a/src/rc/openrc-init.c +++ b/src/rc/openrc-init.c @@ -201,8 +201,10 @@ int main(int argc, char **argv) printf("PID1: Received \"%s\" from FIFO...\n", buf); if (strcmp(buf, "halt") == 0) handle_shutdown("shutdown", RB_HALT_SYSTEM); +#ifdef RB_KEXEC else if (strcmp(buf, "kexec") == 0) handle_shutdown("reboot", RB_KEXEC); +#endif else if (strcmp(buf, "poweroff") == 0) handle_shutdown("shutdown", RB_POWER_OFF); else if (strcmp(buf, "reboot") == 0)
(In reply to Sergei Trofimovich from comment #5) > Do you have a backtrace for peanut gallery? > > It looks odd that openrc SIGSEGVs instead of printing what went wrong. reverting the removal of -D_BSD_SOURCES is not the correct fix. i'll be sending a patch to uclibc-ng@ the problem there. this macro has been deprecated in favor of _DEFAULT_SOURCES. man feature_test_macros(7)
Hey all, can someone on this bug tell me why OpenRC has -D_XOPEN_SOURCE=700 also defined? I removed it on glibc, and things seemed to compile fine, but I don't know for sure why we need this macro for OpenRC and it would be very helpful to know this. I did not commit the removal, it was just to test here. Thanks, William
(In reply to William Hubbs from comment #8) > Hey all, > > can someone on this bug tell me why OpenRC has -D_XOPEN_SOURCE=700 also > defined? > > I removed it on glibc, and things seemed to compile fine, but I don't > know for sure why we need this macro for OpenRC and it would be very > helpful to know this. I did not commit the removal, it was just to test > here. > > Thanks, > > William Answering this question would require detailed knowledge of what functionalities are incorporated in openrc that assume X/Open 7 standards. I don't know openrc well enough to answer that.
Upstream just pushed my patch that fixes this problem: http://repo.or.cz/uclibc-ng.git/commit/526747a2bf6193f784a578b0b97cffaccb44e3df I'll back port it to 1.0.24 and unmask openrc on the uclibc profiles when I stabilize 1.0.24 and upgrade all the stages. I'll then drop <1.0.23 and we should be good. It'll take me about 1 month.
Okay we should be done. While the arm and mips stages still need rebuilding with uclibc-ng-1.0.25 and latest openrc, this should happen on the next round of builds.