diff options
| author | Ross Burton <ross.burton@arm.com> | 2025-09-24 13:07:35 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-09-25 11:09:04 +0100 |
| commit | 917d6652fc1c0610fd493990395b6b528613879d (patch) | |
| tree | c7aabc4af5710783e8113e3dcf92ec75148e5662 | |
| parent | 0068ff98105a8128a4cc1d1f4d33d195a23dcb50 (diff) | |
| download | poky-917d6652fc1c0610fd493990395b6b528613879d.tar.gz | |
lame: don't use -march=native when building with clang
Because of a logic error, lame's configure always passes -march=native
when building with clang.
This is a terrible idea in general as it's not often your build machine
and target hardware aligns, and leads to some amusing errors:
unknown target CPU 'neoverse-n1'
note: valid target CPU values are: i386, i486, ...
Move the HAVE_CLANG block up into the FULL_OPTIMIZATION case, alongside
HAVE_GCC. This option is never enabled (as it's basically "use native")
so resolves the build failure.
(From OE-Core rev: d6f0e26ccf19872e1f4eebb346d76c7bff87ba2a)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-multimedia/lame/lame/clang.patch | 99 | ||||
| -rw-r--r-- | meta/recipes-multimedia/lame/lame_3.100.bb | 1 |
2 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/lame/lame/clang.patch b/meta/recipes-multimedia/lame/lame/clang.patch new file mode 100644 index 0000000000..116000c577 --- /dev/null +++ b/meta/recipes-multimedia/lame/lame/clang.patch | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | Don't use -march=native when building with clang | ||
| 2 | |||
| 3 | Because of a logic error, lame's configure always passes -march=native | ||
| 4 | when building with clang. | ||
| 5 | |||
| 6 | This is a terrible idea in general as it's not often your build machine | ||
| 7 | and target hardware aligns, and leads to some amusing errors: | ||
| 8 | |||
| 9 | unknown target CPU 'neoverse-n1' | ||
| 10 | note: valid target CPU values are: i386, i486, ... | ||
| 11 | |||
| 12 | Move the HAVE_CLANG block up into the FULL_OPTIMIZATION case, alongside | ||
| 13 | HAVE_GCC. This option is never enabled (as it's basically "use native") | ||
| 14 | so resolves the build failure. | ||
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 18 | |||
| 19 | diff --git i/configure.in w/configure.in | ||
| 20 | index 5e43179..d51b017 100644 | ||
| 21 | --- i/configure.in | ||
| 22 | +++ w/configure.in | ||
| 23 | @@ -960,45 +960,43 @@ if test "x$HAVE_GCC" = "xyes" -o "x$HAVE_CLANG" = "xyes"; then | ||
| 24 | ;; | ||
| 25 | esac | ||
| 26 | fi | ||
| 27 | + | ||
| 28 | + if test "x${HAVE_CLANG}" = "xyes"; then | ||
| 29 | + case "${CLANG_VERSION}" in | ||
| 30 | + 3.[89]*|[45].*) | ||
| 31 | + OPTIMIZATION="-Ofast" | ||
| 32 | + ;; | ||
| 33 | + *) | ||
| 34 | + OPTIMIZATION="-O3" | ||
| 35 | + ;; | ||
| 36 | + esac | ||
| 37 | + | ||
| 38 | + # generic CPU specific options | ||
| 39 | + case ${host_cpu} in | ||
| 40 | + *486) | ||
| 41 | + OPTIMIZATION="${OPTIMIZATION} -march=i486" | ||
| 42 | + ;; | ||
| 43 | + *586) | ||
| 44 | + OPTIMIZATION="${OPTIMIZATION} -march=i586 \ | ||
| 45 | + -mtune=native" | ||
| 46 | + ;; | ||
| 47 | + *686) | ||
| 48 | + OPTIMIZATION="${OPTIMIZATION} -march=i686 \ | ||
| 49 | + -mtune=native" | ||
| 50 | + ;; | ||
| 51 | + *86) | ||
| 52 | + OPTIMIZATION="${OPTIMIZATION} -march=native \ | ||
| 53 | + -mtune=native" | ||
| 54 | + ;; | ||
| 55 | + esac | ||
| 56 | + | ||
| 57 | + fi | ||
| 58 | ;; | ||
| 59 | *) | ||
| 60 | AC_MSG_ERROR(bad value �${CONFIG_EXPOPT}� for expopt option) | ||
| 61 | ;; | ||
| 62 | esac | ||
| 63 | |||
| 64 | - | ||
| 65 | - if test "x${HAVE_CLANG}" = "xyes"; then | ||
| 66 | - case "${CLANG_VERSION}" in | ||
| 67 | - 3.[89]*|[45].*) | ||
| 68 | - OPTIMIZATION="-Ofast" | ||
| 69 | - ;; | ||
| 70 | - *) | ||
| 71 | - OPTIMIZATION="-O3" | ||
| 72 | - ;; | ||
| 73 | - esac | ||
| 74 | - | ||
| 75 | - # generic CPU specific options | ||
| 76 | - case ${host_cpu} in | ||
| 77 | - *486) | ||
| 78 | - OPTIMIZATION="${OPTIMIZATION} -march=i486" | ||
| 79 | - ;; | ||
| 80 | - *586) | ||
| 81 | - OPTIMIZATION="${OPTIMIZATION} -march=i586 \ | ||
| 82 | - -mtune=native" | ||
| 83 | - ;; | ||
| 84 | - *686) | ||
| 85 | - OPTIMIZATION="${OPTIMIZATION} -march=i686 \ | ||
| 86 | - -mtune=native" | ||
| 87 | - ;; | ||
| 88 | - *86) | ||
| 89 | - OPTIMIZATION="${OPTIMIZATION} -march=native \ | ||
| 90 | - -mtune=native" | ||
| 91 | - ;; | ||
| 92 | - esac | ||
| 93 | - | ||
| 94 | - fi | ||
| 95 | - | ||
| 96 | - | ||
| 97 | if test "${expopt_msg_result_printed}" = "no" ; then | ||
| 98 | AC_MSG_RESULT(${CONFIG_EXPOPT}) | ||
| 99 | fi | ||
diff --git a/meta/recipes-multimedia/lame/lame_3.100.bb b/meta/recipes-multimedia/lame/lame_3.100.bb index efaf3b9817..42689df351 100644 --- a/meta/recipes-multimedia/lame/lame_3.100.bb +++ b/meta/recipes-multimedia/lame/lame_3.100.bb | |||
| @@ -12,6 +12,7 @@ DEPENDS = "ncurses gettext-native" | |||
| 12 | 12 | ||
| 13 | SRC_URI = "${SOURCEFORGE_MIRROR}/lame/lame-${PV}.tar.gz \ | 13 | SRC_URI = "${SOURCEFORGE_MIRROR}/lame/lame-${PV}.tar.gz \ |
| 14 | file://no-gtk1.patch \ | 14 | file://no-gtk1.patch \ |
| 15 | file://clang.patch \ | ||
| 15 | " | 16 | " |
| 16 | 17 | ||
| 17 | SRC_URI[sha256sum] = "ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e" | 18 | SRC_URI[sha256sum] = "ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e" |
