mirror of
https://github.com/thead-yocto-mirror/meta-openembedded
synced 2026-09-10 16:16:00 +02:00
* it was used only to provide chkshsgr which is now replaced with no-op call
since
commit 50d526d06a
Author: Khem Raj <raj.khem@gmail.com>
Date: Tue Jan 28 11:28:52 2020 -0800
daemontools: Disable the chkshsgr tests
Running the chkhsgr test during cross compile fails
./chkshsgr || ( cat warn-shsgr; exit 1 )
Oops. Your getgroups() returned 0, and setgroups() failed; this means
that I can't reliably do my shsgr test. Please either ``make'' as root
or ``make'' while you're in one or more supplementary groups.
All OE based targets have working getgroups()/setgroups()
implementation, so its a safe assumption and therefore make the test
to be a dummy
* the native chkshsgr from daemontools-native was actually being
called only because of this chunk of cross-compile.patch:
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
+ chkshsgr || ( cat warn-shsgr; exit 1 )
but all chkshsgr does is:
short x[4];
x[0] = x[1] = 0;
if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
_exit(0);
which running on host system, doesn't say anything useful about the
cross compile target, so it's easier to just remove the call in
cross-compile.patch and simplify all this nonsense
* I came across this because daemontools-native was failing for me
in "bitbake world" with zeus, which might be the same case as what
Khem was seeing - just the final commit message doesn't reflect that
* daemontools-native fails to build without the above commit in
zeus as well, when building inside docker container where my
build user is in fewer groups (just 1) so the
getgroups(1,x) call doesn't fail, but on more average OS the
user will be in more than 4 groups and
getgroups(1,x) would fail with errno 22 EINVAL
- so setgroups isn't even called to return 1 error when chkshsgr is called
http://man7.org/linux/man-pages/man2/setgroups.2.html
If the calling process is a member of more than size
supplementary groups, then an error results.
if I increase the size of x enough for x to hold all groups, then setgroups
will fail with errno 1 EPERM, which is the same error as shown
under docker container where getgroups doesn't fail, because
in both cases I'm using unprivileged user for builds
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
46 lines
2.1 KiB
Diff
46 lines
2.1 KiB
Diff
make sure it can be compiled for cross target
|
|
|
|
1. never try to compile target binary by native gcc
|
|
2. target's chkshsgr doesn't work on native.
|
|
3. it's wrong to do target tests on native.
|
|
|
|
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
|
|
|
diff -Nurp daemontools-0.76.orig/src/conf-cc daemontools-0.76/src/conf-cc
|
|
--- daemontools-0.76.orig/src/conf-cc 2001-07-13 00:49:49.000000000 +0800
|
|
+++ daemontools-0.76/src/conf-cc 2014-11-26 09:34:38.828812162 +0800
|
|
@@ -1,3 +1,3 @@
|
|
-gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings
|
|
+${CC} -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings
|
|
|
|
This will be used to compile .c files.
|
|
diff -Nurp daemontools-0.76.orig/src/conf-ld daemontools-0.76/src/conf-ld
|
|
--- daemontools-0.76.orig/src/conf-ld 2001-07-13 00:49:49.000000000 +0800
|
|
+++ daemontools-0.76/src/conf-ld 2014-11-26 09:34:49.880811730 +0800
|
|
@@ -1,3 +1,3 @@
|
|
-gcc -s
|
|
+${CC}
|
|
|
|
This will be used to link .o files into an executable.
|
|
diff -Nurp daemontools-0.76.orig/src/Makefile daemontools-0.76/src/Makefile
|
|
--- daemontools-0.76.orig/src/Makefile 2001-07-13 00:49:49.000000000 +0800
|
|
+++ daemontools-0.76/src/Makefile 2014-11-26 09:38:47.120802459 +0800
|
|
@@ -165,7 +165,7 @@ hassgprm.h: choose compile hassgprm.h1 h
|
|
|
|
hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \
|
|
tryshsgr.c warn-shsgr
|
|
- ./chkshsgr || ( cat warn-shsgr; exit 1 )
|
|
+ echo "Warning: We can not run test on cross target. - ignoring ./chkshsgr || ( cat warn-shsgr; exit 1 )"
|
|
./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h
|
|
|
|
haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
|
|
@@ -265,7 +265,7 @@ readproctitle.o: compile error.h readpro
|
|
rts: envdir envuidgid fghack matchtest multilog pgrphack \
|
|
readproctitle rts.tests setlock setuidgid softlimit supervise svc \
|
|
svok svscan svscanboot svstat tai64n tai64nlocal
|
|
- env - /bin/sh rts.tests 2>&1 | cat -v > rts
|
|
+ echo "Warning: We can not run test on cross target. - ignoring env - /bin/sh rts.tests 2>&1 | cat -v > rts"
|
|
|
|
scan_ulong.o: compile scan.h scan_ulong.c
|
|
./compile scan_ulong.c
|