Sergei Trofimovich f428a642e3 libyuv: fix libyuv.so underlinking
When `libyuv` is built with `jpeg` support it does not directly link
`libjpeg` in any form. As a result dynamic loading of the library
fails as:

    >>> import pillow_avif._avif
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: /usr/lib/libyuv.so: undefined symbol: jpeg_resync_to_restart

We can reproduce the same problem at build time if we build `libyuv` with
`LDFLAGS=-Wl,--no-undefined`:

    [ 99%] Linking CXX executable yuvconstants
    ld: CMakeFiles/yuv_shared.dir/source/mjpeg_decoder.cc.o: in function `libyuv::MJpegDecoder::MJpegDecoder()':
    mjpeg_decoder.cc:(.text+0xfc): undefined reference to `jpeg_resync_to_restart'
    ld: mjpeg_decoder.cc:(.text+0x136): undefined reference to `jpeg_std_error'
    ld: mjpeg_decoder.cc:(.text+0x194): undefined reference to `jpeg_CreateDecompress'

The change links `libgpeg` against `libyuv` itself to make it a
self-contained library. This fixes both loading if the library
itself and fixes linking of the library against other binaries
without explicit need for passing `-ljpeg`.

Change-Id: I044acb3799920e1536bdb3388442a40d4839348b
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4050883
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
2022-11-28 18:29:29 +00:00
build_overrides
docs
include
infra/config
source
tools_libyuv
unit_test
util
.clang-format
.gitignore
.gn
.vpython
.vpython3
Android.bp
Android.mk
AUTHORS
BUILD.gn
cleanup_links.py
CM_linux_packages.cmake
CMakeLists.txt libyuv: fix libyuv.so underlinking 2022-11-28 18:29:29 +00:00
codereview.settings
DEPS
DIR_METADATA
download_vs_toolchain.py
libyuv.gni
libyuv.gyp
libyuv.gypi
LICENSE
linux.mk
OWNERS
PATENTS
PRESUBMIT.py
public.mk
pylintrc
README.chromium
README.md
winarm.mk

libyuv is an open source project that includes YUV scaling and conversion functionality.

  • Scale YUV to prepare content for compression, with point, bilinear or box filter.
  • Convert to YUV from webcam formats for compression.
  • Convert to RGB formats for rendering/effects.
  • Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
  • Optimized for SSSE3/AVX2 on x86/x64.
  • Optimized for Neon on Arm.
  • Optimized for MSA on Mips.

Development

See Getting started for instructions on how to get started developing.

You can also browse the docs directory for more documentation.