0003-configure.pri-remove-some-of-the-thumb-detection-log.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From b00f7b41ffdee03f9982287d61c2fa21ebee5e6b Mon Sep 17 00:00:00 2001
  2. From: Arnout Vandecappelle <arnout@rnout.be>
  3. Date: Sat, 17 May 2025 22:09:32 +0200
  4. Subject: [PATCH] configure.pri: remove some of the thumb detection logic
  5. The hasThumbFlag test has a roundabout way of discovering whether thumb
  6. is available. It looks at the -mthumb and -marm flag (which does make
  7. some sense), but then it tries to look at -march to determine which ARM
  8. architecture version is used. That test doesn't work if GCC is
  9. configured for a default target architecture and no -march is passed on
  10. the command line.
  11. In Buildroot, we don't pass any -mthumb, -marm or -march in CFLAGS
  12. because all of that is included in the toolchain wrapper. Therefore, the
  13. logic has nothing to determine the target ARM ISA version and returns
  14. false.
  15. As a result, nothing is passed down to gn, and gn adds -marm to the
  16. build. There is in fact a warning about this:
  17. WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine.
  18. but since it's just a warning, it gets ignored.
  19. Indeed, the build does fail (when ffmpeg is built, i.e. when
  20. BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS is enabled) with:
  21. FAILED: obj/third_party/ffmpeg/ffmpeg_internal/vp8.o
  22. [...]
  23. {standard input}: Assembler messages:
  24. {standard input}:1119: Error: bad instruction `ldrhcs r0,[ip],#2'
  25. {standard input}:1156: Error: bad instruction `ldrhcs r9,[ip],#2'
  26. In practice, the architecture version doesn't really matter, because all
  27. the architectures supported by JSCore have thumb.
  28. Therefore, remove the logic for detecting if the CPU architecture
  29. supports thumb. Do keep the -marm and -mthumb logic, even though in
  30. Buildroot it doesn't do anything, and the warning gets ignored.
  31. Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
  32. Upstream: It's not clear if the same logic about JSCore applies in
  33. upstream, so not sent.
  34. ---
  35. configure.pri | 8 --------
  36. 1 file changed, 8 deletions(-)
  37. diff --git a/configure.pri b/configure.pri
  38. index 8da334c83..3ff298e9f 100644
  39. --- a/configure.pri
  40. +++ b/configure.pri
  41. @@ -370,14 +370,6 @@ defineTest(qtConfTest_hasThumbFlag) {
  42. !isEmpty(FLAG): return(true)
  43. FLAG = $$qtwebengine_extractCFlag("-marm")
  44. !isEmpty(FLAG): return(false)
  45. -
  46. - MARCH = $$qtwebengine_extractCFlag("-march=.*")
  47. - MARMV = $$replace(MARCH, "armv",)
  48. - !isEmpty(MARMV) {
  49. - MARMV = $$split(MARMV,)
  50. - MARMV = $$member(MARMV, 0)
  51. - }
  52. - if (isEmpty(MARMV) | lessThan(MARMV, 7)): return(false)
  53. # no flag assume mthumb
  54. return(true)
  55. }
  56. --
  57. 2.49.0