From 848404ed7b2f1c4048c83c231ae34efbd66face2 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Fri, 12 Aug 2022 15:05:26 +0200 Subject: [PATCH] package/intel-mediadriver: fix build with libexecinfo Fix the following build failure with libexecinfo raised since bump to version 22.4.3 in commit dd1c8879c503a093b807ea8ab04c31f685e7b340: /home/giuliobenetti/autobuild/run/instance-2/output-1/build/intel-mediadriver-22.5.1/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp:2481: undefined reference to `backtrace' Fixes: - http://autobuild.buildroot.org/results/3316e39c5113bb7600374eda45497a87c9ac9873 - http://autobuild.buildroot.org/results/1074e832dd2f67e6fea8ff1fc7e226245a4d51bd Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- .../0002-Fix-build-with-libexecinfo.patch | 43 +++++++++++++++++++ .../intel-mediadriver/intel-mediadriver.mk | 4 ++ 2 files changed, 47 insertions(+) create mode 100644 package/intel-mediadriver/0002-Fix-build-with-libexecinfo.patch diff --git a/package/intel-mediadriver/0002-Fix-build-with-libexecinfo.patch b/package/intel-mediadriver/0002-Fix-build-with-libexecinfo.patch new file mode 100644 index 0000000000..3a6705f2b8 --- /dev/null +++ b/package/intel-mediadriver/0002-Fix-build-with-libexecinfo.patch @@ -0,0 +1,43 @@ +From c5177d6fc64ad8bc25c8fbbe324e52744ef52e18 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 12 Aug 2022 09:50:33 +0200 +Subject: [PATCH] Fix build with libexecinfo + +Fix the following build failure with musl or uclibc-ng and libexecinfo: + +/home/giuliobenetti/autobuild/run/instance-2/output-1/build/intel-mediadriver-22.5.1/media_softlet/linux/common/os/osservice/mos_utilities_specific.cpp:2481: undefined reference to `backtrace' + +Fixes: + - http://autobuild.buildroot.org/results/3316e39c5113bb7600374eda45497a87c9ac9873 + +Signed-off-by: Fabrice Fontaine +[Upstream status: https://github.com/intel/media-driver/pull/1470] +--- + media_driver/media_top_cmake.cmake | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/media_driver/media_top_cmake.cmake b/media_driver/media_top_cmake.cmake +index 0e19a47c9..936d8c35a 100755 +--- a/media_driver/media_top_cmake.cmake ++++ b/media_driver/media_top_cmake.cmake +@@ -271,10 +271,16 @@ set_target_properties(${LIB_NAME} PROPERTIES LINK_FLAGS ${MEDIA_LINK_FLAGS}) + set_target_properties(${LIB_NAME} PROPERTIES PREFIX "") + set_target_properties(${LIB_NAME_STATIC} PROPERTIES PREFIX "") + ++set(MEDIA_LINK_EXTERNAL_LIBS "${PKG_PCIACCESS_LIBRARIES} m pthread dl") ++find_package(Backtrace) ++if(Backtrace_FOUND) ++ set(MEDIA_LINK_EXTERNAL_LIBS "${MEDIA_LINK_EXTERNAL_LIBS} ${Backtrace_LIBRARY}") ++endif() ++ + bs_ufo_link_libraries_noBsymbolic( + ${LIB_NAME} + "${INCLUDED_LIBS}" +- "${PKG_PCIACCESS_LIBRARIES} m pthread dl" ++ "${MEDIA_LINK_EXTERNAL_LIBS}" + ) + + if (NOT DEFINED INCLUDED_LIBS OR "${INCLUDED_LIBS}" STREQUAL "") +-- +2.35.1 + diff --git a/package/intel-mediadriver/intel-mediadriver.mk b/package/intel-mediadriver/intel-mediadriver.mk index f43e6d1b42..4669c71bf6 100644 --- a/package/intel-mediadriver/intel-mediadriver.mk +++ b/package/intel-mediadriver/intel-mediadriver.mk @@ -18,6 +18,10 @@ INTEL_MEDIADRIVER_DEPENDENCIES = \ libva \ mesa3d +ifeq ($(BR2_PACKAGE_LIBEXECINFO),y) +INTEL_MEDIADRIVER_DEPENDENCIES += libexecinfo +endif + ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y) INTEL_MEDIADRIVER_DEPENDENCIES += xlib_libX11 endif