010-both-libraries.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From da39ee0e68b6d9293133a7c41c6cf73354dce337 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <[email protected]>
  3. Date: Wed, 21 Feb 2024 13:57:56 -0800
  4. Subject: [PATCH] libfdt: rework shared/static libraries
  5. Instead of creating 2 libraries manualy, just call both_libraries and
  6. link to the appropriate one as requested.
  7. Fixes compilation when passing -Ddefault_libraries=both as the
  8. static_library name is duplicated.
  9. Signed-off-by: Rosen Penev <[email protected]>
  10. Signed-off-by: David Gibson <[email protected]>
  11. ---
  12. libfdt/meson.build | 17 +++++------------
  13. 1 file changed, 5 insertions(+), 12 deletions(-)
  14. --- a/libfdt/meson.build
  15. +++ b/libfdt/meson.build
  16. @@ -16,7 +16,7 @@ sources = files(
  17. 'fdt_wip.c',
  18. )
  19. -libfdt = library(
  20. +libfdt = both_libraries(
  21. 'fdt', sources,
  22. version: '1.6.0',
  23. link_args: ['-Wl,--no-undefined', version_script],
  24. @@ -24,17 +24,12 @@ libfdt = library(
  25. install: true,
  26. )
  27. -libfdt_a = static_library(
  28. - 'fdt', sources,
  29. - install: true,
  30. -)
  31. -
  32. libfdt_inc = include_directories('.')
  33. if static_build
  34. - link_with = libfdt_a
  35. + link_with = libfdt.get_static_lib()
  36. else
  37. - link_with = libfdt
  38. + link_with = libfdt.get_shared_lib()
  39. endif
  40. libfdt_dep = declare_dependency(