Unverified Commit 123f0110 authored by Artturin's avatar Artturin Committed by GitHub
Browse files

mjpg-streamer: Fix `input_uvc.so: undefined symbol: resolutions_help` (#465036)

parents 47145e97 1f2a2d22
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
From 7b24e2a593a0029c6f555c9001be87a34eceecc6 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Tue, 6 Aug 2024 17:04:55 +0200
Subject: [PATCH] Export all symbols of mjpg_streamer binary

Fixes runtime error with stripped binary

    dlopen: /usr/lib/mjpg-streamer/input_uvc.so: undefined symbol: resolutions_help

Source: http://lists.busybox.net/pipermail/buildroot/2024-August/759732.html

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 mjpg-streamer-experimental/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mjpg-streamer-experimental/CMakeLists.txt b/mjpg-streamer-experimental/CMakeLists.txt
index cf26620e..3ff12cdf 100644
--- a/mjpg-streamer-experimental/CMakeLists.txt
+++ b/mjpg-streamer-experimental/CMakeLists.txt
@@ -92,6 +92,7 @@ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 add_executable(mjpg_streamer mjpg_streamer.c
                              utils.c)
 
+set_property(TARGET mjpg_streamer PROPERTY ENABLE_EXPORTS ON)
 target_link_libraries(mjpg_streamer pthread dl)
 install(TARGETS mjpg_streamer DESTINATION bin)
 
+11 −2
Original line number Diff line number Diff line
@@ -17,14 +17,23 @@ stdenv.mkDerivation {
    sha256 = "1cl159svfs1zzzrd3zgn4x7qy6751bvlnxfwf5hn5fmg4iszajw7";
  };

  patches = [
    # https://patchwork.ozlabs.org/project/buildroot/patch/20240808192126.1767471-1-bernd@kuhls.net/#3373402
    # https://github.com/jacksonliam/mjpg-streamer/pull/401
    ./fix-undefined-symbol-error.patch
  ];

  prePatch = ''
    cd mjpg-streamer-experimental
    substituteInPlace ./CMakeLists.txt --replace-fail "cmake_minimum_required(VERSION 2.8.3)" "cmake_minimum_required(VERSION 2.8.3...3.10)"
    substituteInPlace ./mjpg-streamer-experimental/CMakeLists.txt --replace-fail "cmake_minimum_required(VERSION 2.8.3)" "cmake_minimum_required(VERSION 2.8.3...3.10)"
  '';

  nativeBuildInputs = [ cmake ];
  buildInputs = [ libjpeg ];

  preConfigure = ''
    cd mjpg-streamer-experimental
  '';

  postFixup = ''
    patchelf --set-rpath "$(patchelf --print-rpath $out/bin/mjpg_streamer):$out/lib/mjpg-streamer" $out/bin/mjpg_streamer
  '';