Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error building libexiv2 in mythtv 32.0 #549

Closed
acarrico opened this issue Apr 21, 2022 · 8 comments
Closed

Link error building libexiv2 in mythtv 32.0 #549

acarrico opened this issue Apr 21, 2022 · 8 comments

Comments

@acarrico
Copy link
Contributor

  • Platform: Linux silver 5.15.2 #1-NixOS SMP Fri Nov 12 14:05:52 UTC 2021 x86_64 GNU/Linux

  • MythTV version: 32.0

  • Package version: I'm updating the package from version 31 to 32. The original is here:

https://github.com/NixOS/nixpkgs/blob/nixos-21.11/pkgs/applications/video/mythtv/default.nix

  • Component: libmythexiv2-0.28.so.32.0.0

What steps will reproduce the bug?

When I adapt the build script default.nix, linked above, to version 32, libmythexiv2-0.28.so.32.0.0 fails to link. I believe that the nix linker wrapper detects some bad paths passed from mythtv/external/libexiv2/Makefile.

Additional information

The release notes mention: [2807de0a74] Clone exiv2 into MythTV.

In mythtv/external/libexiv2/Makefile, the variable SRC_PATH_BARE is not defined.

I believe this happens because qmake uses mythtv/external/libexiv2/libexiv2.pro which includes settings.pro which includes config.mak. Here SRC_PATH_BARE and QMAKE_LFLAGS defined.

I'm not sure if SRC_PATH_BARE is in the wrong format to be expanded by qmake, or if it is intended to be passed through and config.mak was supposed to be included in the resulting Makefile.

Because of the issue, the linker command has some bad paths such as /external/FFmpeg/libswresample etc., which should be prefixed. Here is the linker command:

g++ -Wl,--as-needed -Wl,-z,noexecstack -L/opt/vc/lib/ -Wl,--warn-common -Wl,-rpath-link,/external/FFmpeg/libpostproc:/external/FFmpeg/libswresample:/external/FFmpeg/libswscale:/external/FFmpeg/libavfilter:/external/FFmpeg/libavdevice:/external/FFmpeg/libavformat:/external/FFmpeg/libavcodec:/external/FFmpeg/libavutil:/external/FFmpeg/libavresample -Wl,-rpath,/nix/store/p3jjq69kzxrz3axgc1dixc86zairbh43-qtwebkit-5.212.0-alpha4/lib -Wl,-rpath,/nix/store/p3jjq69kzxrz3axgc1dixc86zairbh43-qtwebkit-5.212.0-alpha4/lib -shared -Wl,-soname,libmythexiv2-0.28.so.32 -o libmythexiv2-0.28.so.32.0.0 obj/FileIo.o obj/MemIo.o obj/RemoteIo.o obj/actions.o obj/basicio.o obj/bigtiffimage.o obj/bmpimage.o obj/canonmn_int.o obj/casiomn_int.o obj/convert.o obj/cr2header_int.o obj/cr2image.o obj/crwimage.o obj/crwimage_int.o obj/datasets.o obj/easyaccess.o obj/error.o obj/exif.o obj/exiv2.o obj/fujimn_int.o obj/futils.o obj/getopt.o obj/gifimage.o obj/helper_functions.o obj/http.o obj/image.o obj/image_int.o obj/ini.o obj/iptc.o obj/jp2image.o obj/jpgimage.o obj/makernote_int.o obj/metadatum.o obj/minoltamn_int.o obj/mrwimage.o obj/nikonmn_int.o obj/olympusmn_int.o obj/orfimage.o obj/orfimage_int.o obj/panasonicmn_int.o obj/params.o obj/pentaxmn_int.o obj/pgfimage.o obj/pngchunk_int.o obj/pngimage.o obj/preview.o obj/properties.o obj/psdimage.o obj/rafimage.o obj/rw2image.o obj/rw2image_int.o obj/samsungmn_int.o obj/sigmamn_int.o obj/sonymn_int.o obj/tags.o obj/tags_int.o obj/tgaimage.o obj/tiffcomposite_int.o obj/tiffimage.o obj/tiffimage_int.o obj/tiffvisitor_int.o obj/types.o obj/utils.o obj/value.o obj/version.o obj/webpimage.o obj/xmp.o obj/xmpsidecar.o obj/ExpatAdapter.o obj/MD5.o obj/ParseRDF.o obj/UnicodeConversions.o obj/WXMPIterator.o obj/WXMPMeta.o obj/WXMPUtils.o obj/XML_Node.o obj/XMPCore_Impl.o obj/XMPIterator.o obj/XMPMeta-GetSet.o obj/XMPMeta-Parse.o obj/XMPMeta-Serialize.o obj/XMPMeta.o obj/XMPUtils-FileInfo.o obj/XMPUtils.o  -lexpat /nix/store/m1z1n4inqaasqpj0r07hqhdcpzdfv08c-qtbase-5.14.2/lib/libQt5Gui.so /nix/store/m1z1n4inqaasqpj0r07hqhdcpzdfv08c-qtbase-5.14.2/lib/libQt5Core.so -L/nix/store/45zg04mnwym5mpjhnbn820xprgzdalsp-libglvnd-1.3.3/lib -lGL -lpthread   
@acarrico
Copy link
Contributor Author

It looks like @linuxdude42 imported exiv2.

@stuarta
Copy link
Member

stuarta commented Apr 21, 2022

out of interest, what version is the system exiv2?

@acarrico
Copy link
Contributor Author

Looks like 0.27.5.

@linuxdude42
Copy link
Contributor

I don't think this is a libexiv2 issue because I see this same link line in other directories. You're just seeing it first in libexiv2 because exiv2 is the third directory built.

@linuxdude42
Copy link
Contributor

Try editing this line:

check_ldflags '-Wl,-rpath-link,\${SRC_PATH_BARE}/external/FFmpeg/libpostproc:\${SRC_PATH_BARE}/external/FFmpeg/libswresample:\${SRC_PATH_BARE}/external/FFmpeg/libswscale:\${SRC_PATH_BARE}/external/FFmpeg/libavfilter:\${SRC_PATH_BARE}/external/FFmpeg/libavdevice:\${SRC_PATH_BARE}/external/FFmpeg/libavformat:\${SRC_PATH_BARE}/external/FFmpeg/libavcodec:\${SRC_PATH_BARE}/external/FFmpeg/libavutil:\${SRC_PATH_BARE}/external/FFmpeg/libavresample'

Double each of the \$ characters pairs so you have \$\${SRC_BARE_PATH}. After doing this I no longer see SRC_PATH_BARE in any of the Makefiles.

@acarrico
Copy link
Contributor Author

acarrico commented Apr 22, 2022

@linuxdude42, I'm building now with the double \$\$ in configure. It takes a while on this ancient E5-2650v2, but so far so good.

We are dealing with several languages at once, sh, m4, make, qmake, and no type system to keep things straight, so it is no wonder that errors like this occur!

@acarrico
Copy link
Contributor Author

@linuxdude42 that builds fine for me, see PR #550. Thanks for your help.

@linuxdude42
Copy link
Contributor

Committed the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants