0001-Migrate-building-progs-tcapsh-static-to-sudotest.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From 9b1c003748d4df78416d50fce139f0875224440b Mon Sep 17 00:00:00 2001
  2. From: "Andrew G. Morgan" <morgan@kernel.org>
  3. Date: Tue, 10 Nov 2020 20:47:45 -0800
  4. Subject: [PATCH] Migrate building progs/tcapsh-static to sudotest
  5. This addresses:
  6. https://bugzilla.kernel.org/show_bug.cgi?id=210135
  7. https://bugs.busybox.net/show_bug.cgi?id=13296
  8. Some notes on expectations:
  9. When building DYNAMIC=yes folk want to avoid depending on a
  10. static libc.a file in their build tree. The best we can do is
  11. to move building static test tool objects to sudotest.
  12. make DYNAMIC=yes clean all test
  13. will build the progs binaries and run the tests with all dynamic
  14. linking. It will, however, build the libcap.a etc libraries too
  15. even though they are not used for linking.
  16. make DYNAMIC=no clean all test
  17. will build the progs binaries and run the tests with all static
  18. linking. It will, however, build the libcap.so etc libraries too
  19. even though they are not used for linking.
  20. make SHARED=no clean all test
  21. will build and link progs and test binaries statically against
  22. libcap.a. No shared libraries (libcap.so etc) will be built.
  23. In all cases, whether linked against or not, libcap.a is built.
  24. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
  25. [Patch taken from upstream:
  26. https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=9b1c003748d4df78416d50fce139f0875224440b]
  27. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
  28. ---
  29. tests/Makefile | 8 ++++----
  30. 1 file changed, 4 insertions(+), 4 deletions(-)
  31. diff --git a/tests/Makefile b/tests/Makefile
  32. index fc39fee..1e7039d 100644
  33. --- a/tests/Makefile
  34. +++ b/tests/Makefile
  35. @@ -17,13 +17,13 @@ install: all
  36. ifeq ($(DYNAMIC),yes)
  37. LINKEXTRA=-Wl,-rpath,../libcap
  38. -DEPS=../libcap/libcap.so ../progs/tcapsh-static
  39. +DEPS=../libcap/libcap.so
  40. ifeq ($(PTHREADS),yes)
  41. DEPS += ../libcap/libpsx.so
  42. endif
  43. else
  44. LDFLAGS += --static
  45. -DEPS=../libcap/libcap.a ../progs/tcapsh-static
  46. +DEPS=../libcap/libcap.a
  47. ifeq ($(PTHREADS),yes)
  48. DEPS += ../libcap/libpsx.a
  49. endif
  50. @@ -71,10 +71,10 @@ libcap_psx_test: libcap_psx_test.c $(DEPS)
  51. $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
  52. # privileged
  53. -run_libcap_launch_test: libcap_launch_test noop
  54. +run_libcap_launch_test: libcap_launch_test noop ../progs/tcapsh-static
  55. sudo ./libcap_launch_test
  56. -run_libcap_psx_launch_test: libcap_psx_launch_test
  57. +run_libcap_psx_launch_test: libcap_psx_launch_test ../progs/tcapsh-static
  58. sudo ./libcap_psx_launch_test
  59. libcap_launch_test: libcap_launch_test.c $(DEPS)
  60. --
  61. 2.20.1