1.10.2 compile failure with recent openssl (on Debian)

The place to discuss linux version of MakeMKV
Post Reply
malattia
Posts: 8
Joined: Sun Dec 01, 2013 2:59 am
Location: Tokyo, Japan

1.10.2 compile failure with recent openssl (on Debian)

Post by malattia »

Openssl appears to have hidden declarations of ECDSA_SIG[1], so the code in libabi/src/ossl_ec.c fails now.
Here's the errors:

Code: Select all

libabi/src/ossl_ec.c: In function ‘OSSL_ECDSA_do_verify_rs’:
libabi/src/ossl_ec.c:204:15: error: storage size of ‘sig’ isn’t known
     ECDSA_SIG sig;
               ^~~
libabi/src/ossl_ec.c: In function ‘OSSL_ecdsa_sig_get_r’:
libabi/src/ossl_ec.c:222:56: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka const struct ECDSA_SIG_st}’
     return (const OSSL_BIGNUM*) ((const ECDSA_SIG*)sig)->r;
                                                        ^~
I attempted a fix, though there seems to much that goes on in the non-OSS binary that I don't have control over.

[1]: https://github.com/openssl/openssl/comm ... 19ffdb7cf2
--
mattia
billy_bob
Posts: 1
Joined: Fri Dec 16, 2016 11:42 pm

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by billy_bob »

Yep. Seeing this on a Debian as well.

gcc -g -O2 -D_linux_ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D_REENTRANT -shared -Wl,-z,defs -oout/libmakemkv.so.1.full -Ilibebml/inc -DEBML_NO_READ -DEBML_STRICT_API -DEBML_DEBUG -Ilibmatroska/inc \
-Ilibmakemkv/inc -Isstring/inc -Imakemkvgui/inc -Ilibabi/inc -Ilibffabi/inc -DDCA_LOG -DDCA_FFMALLOC \
libebml/src/EbmlBinary.cpp libebml/src/EbmlContexts.cpp libebml/src/EbmlCrc32.cpp libebml/src/EbmlDate.cpp libebml/src/EbmlDummy.cpp libebml/src/EbmlElement.cpp libebml/src/EbmlFloat.cpp libebml/src/EbmlHead.cpp libebml/src/EbmlMaster.cpp libebml/src/EbmlSInteger.cpp libebml/src/EbmlString.cpp libebml/src/EbmlSubHead.cpp libebml/src/EbmlUInteger.cpp libebml/src/EbmlUnicodeString.cpp libebml/src/EbmlVersion.cpp libebml/src/EbmlVoid.cpp libebml/src/IOCallback.cpp libebml/src/MemIOCallback.cpp libmatroska/src/FileKax.cpp libmatroska/src/KaxAttached.cpp libmatroska/src/KaxAttachments.cpp libmatroska/src/KaxBlock.cpp libmatroska/src/KaxBlockData.cpp libmatroska/src/KaxCluster.cpp libmatroska/src/KaxContexts.cpp libmatroska/src/KaxCues.cpp libmatroska/src/KaxCuesData.cpp libmatroska/src/KaxInfoData.cpp libmatroska/src/KaxSeekHead.cpp libmatroska/src/KaxSegment.cpp libmatroska/src/KaxTracks.cpp libmatroska/src/KaxVersion.cpp libmatroska/src/KaxSemantic.cpp libmakemkv/src/ebmlwrite.cpp libmakemkv/src/libmkv.cpp libmakemkv/src/version.cpp libmakemkv/src/world.cpp libmakemkv/src/stdstring.cpp sstring/src/sstring.cpp \
libabi/src/ossl_aes.c libabi/src/ossl_sha.c libabi/src/ossl_ec.c libabi/src/zlib.c libabi/src/xpat.c libabi/src/libm.c libabi/src/httplinux.cpp makemkvgui/src/api_linux.cpp libabi/src/sys_linux.c makemkvgui/src/spawn_posix.cpp libffabi/src/ffabi.c libffabi/src/mlp.c libffabi/src/log.c libffabi/src/audio_convert.c libffabi/src/audio_mix.c libffabi/src/audio_mix_matrix.c libffabi/src/dcadec/bitstream.cpp libffabi/src/dcadec/core_decoder.cpp libffabi/src/dcadec/dca_context.cpp libffabi/src/dcadec/dmix_tables.cpp libffabi/src/dcadec/exss_parser.cpp libffabi/src/dcadec/idct_fixed.cpp libffabi/src/dcadec/interpolator.cpp libffabi/src/dcadec/interpolator_fixed.cpp libffabi/src/dcadec/interpolator_float.cpp libffabi/src/dcadec/ta.cpp libffabi/src/dcadec/xll_decoder.cpp libffabi/src/dcadec/idct_float.cpp \
-DHAVE_BUILDINFO_H -Itmp -I/usr/include/x86_64-linux-gnu \
-fPIC -Xlinker -dy -Xlinker --version-script=libmakemkv/src/libmakemkv.vers \
-Xlinker -soname=libmakemkv.so.1 -lc -lstdc++ -lcrypto -lz -lexpat -lavcodec -lavutil -lm -lrt
libabi/src/ossl_ec.c: In function ‘OSSL_ECDSA_do_verify_rs’:
libabi/src/ossl_ec.c:204:15: error: storage size of ‘sig’ isn’t known
ECDSA_SIG sig;
^~~
libabi/src/ossl_ec.c: In function ‘OSSL_ecdsa_sig_get_r’:
libabi/src/ossl_ec.c:222:56: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka const struct ECDSA_SIG_st}’
return (const OSSL_BIGNUM*) ((const ECDSA_SIG*)sig)->r;
^~
openssl on my machine: ii openssl 1.1.0c-2 amd64
malattia
Posts: 8
Joined: Sun Dec 01, 2013 2:59 am
Location: Tokyo, Japan

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by malattia »

--
mattia
mkvfann
Posts: 4
Joined: Sun Dec 18, 2016 1:40 am

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by mkvfann »

I appreciate the help - so far - in this thread. Thank you malattia. However, once I add the struct definition, I'm getting this (Debian unstable):

I'm seeing this about "not in ELF format":

Code: Select all

mkdir -p tmp
ld -r -b binary -o tmp/image_data.o makemkvgui/bin/image_data.bin
ld: makemkvgui/bin/image_data.bin: not in ELF format
Makefile:93: recipe for target 'tmp/image_data.o' failed
make: *** [tmp/image_data.o] Error 1
Full output from ./configure, and make:

Code: Select all

wls@rivendell:~/Downloads/makemkv-oss-1.10.3$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for -objcopy... no
checking for objcopy... objcopy
checking for -ld... no
checking for ld... ld
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for compress2 in -lz... yes
checking openssl/opensslconf.h usability... yes
checking openssl/opensslconf.h presence... yes
checking for openssl/opensslconf.h... yes
checking for AES_encrypt in -lcrypto... yes
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for XML_ParserCreate in -lexpat... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ffmpeg... yes
checking whether LIBAVCODEC_VERSION_MAJOR is declared... yes
checking LIBAVCODEC_VERSION_MAJOR... 57
checking for AVFrame.nb_samples... yes
checking whether AV_SAMPLE_FMT_U8P is declared... yes
checking for avcodec_encode_audio2... yes
checking for AVCodecContext.refcounted_frames... yes
checking whether avcodec_free_frame is declared... no
checking whether av_frame_free is declared... yes
checking for av_log_format_line... yes
checking for enum AVCodecID... yes
checking whether AV_CODEC_ID_NONE is declared... yes
checking whether av_frame_get_channels is declared... yes
checking whether av_frame_get_sample_rate is declared... yes
checking whether av_frame_set_channel_layout is declared... yes
checking for AVCodecParserContext.duration... yes
checking whether AV_CH_TOP_BACK_CENTER is declared... yes
checking for qt5... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libffabi/src/ffabicfg.h
config.status: libffabi/src/ffabicfg.h is unchanged
wls@rivendell:~/Downloads/makemkv-oss-1.10.3$ make
mkdir -p out
gcc -g -O2 -D_linux_ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D_REENTRANT -shared -Wl,-z,defs -oout/libdriveio.so.0.full -Ilibdriveio/inc libdriveio/src/infolist.cpp libdriveio/src/scsihlp.cpp libdriveio/src/srlist.cpp libdriveio/src/stdquery.cpp libdriveio/src/tipclient.cpp libdriveio/src/tipcommon.cpp libdriveio/src/tipserver.cpp libdriveio/src/drives/pioneer.cpp libdriveio/src/drives/xboxhddvd.cpp \
-fPIC -Xlinker -dy -Xlinker --version-script=libdriveio/src/libdriveio.vers \
-Xlinker -soname=libdriveio.so.0 -lc -lstdc++
objcopy --strip-all --strip-debug --strip-unneeded --discard-all out/libdriveio.so.0.full out/libdriveio.so.0 
mkdir -p tmp
echo "#define BUILDINFO_ARCH_NAME \"x86_64-linux-gnu\"" >> tmp/gen_buildinfo.h
echo "#define BUILDINFO_BUILD_DATE \"Sat Dec 17 18:46:55 MST 2016\"" >> tmp/gen_buildinfo.h
mkdir -p out
gcc -g -O2 -D_linux_ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D_REENTRANT -shared -Wl,-z,defs -oout/libmakemkv.so.1.full -Ilibebml/inc -DEBML_NO_READ -DEBML_STRICT_API -DEBML_DEBUG -Ilibmatroska/inc \
-Ilibmakemkv/inc -Isstring/inc -Imakemkvgui/inc -Ilibabi/inc -Ilibffabi/inc -DDCA_LOG -DDCA_FFMALLOC \
libebml/src/EbmlBinary.cpp libebml/src/EbmlContexts.cpp libebml/src/EbmlCrc32.cpp libebml/src/EbmlDate.cpp libebml/src/EbmlDummy.cpp libebml/src/EbmlElement.cpp libebml/src/EbmlFloat.cpp libebml/src/EbmlHead.cpp libebml/src/EbmlMaster.cpp libebml/src/EbmlSInteger.cpp libebml/src/EbmlString.cpp libebml/src/EbmlSubHead.cpp libebml/src/EbmlUInteger.cpp libebml/src/EbmlUnicodeString.cpp libebml/src/EbmlVersion.cpp libebml/src/EbmlVoid.cpp libebml/src/IOCallback.cpp libebml/src/MemIOCallback.cpp  libmatroska/src/FileKax.cpp libmatroska/src/KaxAttached.cpp libmatroska/src/KaxAttachments.cpp libmatroska/src/KaxBlock.cpp libmatroska/src/KaxBlockData.cpp libmatroska/src/KaxCluster.cpp libmatroska/src/KaxContexts.cpp libmatroska/src/KaxCues.cpp libmatroska/src/KaxCuesData.cpp libmatroska/src/KaxInfoData.cpp libmatroska/src/KaxSeekHead.cpp libmatroska/src/KaxSegment.cpp libmatroska/src/KaxTracks.cpp libmatroska/src/KaxVersion.cpp libmatroska/src/KaxSemantic.cpp libmakemkv/src/ebmlwrite.cpp libmakemkv/src/libmkv.cpp libmakemkv/src/version.cpp libmakemkv/src/world.cpp libmakemkv/src/stdstring.cpp  sstring/src/sstring.cpp \
libabi/src/ossl_aes.c libabi/src/ossl_sha.c libabi/src/ossl_ec.c libabi/src/zlib.c libabi/src/xpat.c libabi/src/libm.c libabi/src/httplinux.cpp makemkvgui/src/api_linux.cpp libabi/src/sys_linux.c makemkvgui/src/spawn_posix.cpp libffabi/src/ffabi.c libffabi/src/mlp.c libffabi/src/log.c libffabi/src/audio_convert.c libffabi/src/audio_mix.c libffabi/src/audio_mix_matrix.c libffabi/src/dcadec/bitstream.cpp libffabi/src/dcadec/core_decoder.cpp libffabi/src/dcadec/dca_context.cpp libffabi/src/dcadec/dmix_tables.cpp libffabi/src/dcadec/exss_parser.cpp libffabi/src/dcadec/idct_fixed.cpp libffabi/src/dcadec/interpolator.cpp libffabi/src/dcadec/interpolator_fixed.cpp libffabi/src/dcadec/interpolator_float.cpp libffabi/src/dcadec/ta.cpp libffabi/src/dcadec/xll_decoder.cpp libffabi/src/dcadec/idct_float.cpp  \
-DHAVE_BUILDINFO_H -Itmp -I/usr/include/x86_64-linux-gnu \
-fPIC -Xlinker -dy -Xlinker --version-script=libmakemkv/src/libmakemkv.vers \
-Xlinker -soname=libmakemkv.so.1 -lc -lstdc++ -lcrypto -lz -lexpat -lavcodec -lavutil -lm -lrt
libabi/src/sys_linux.c: In function ‘SYS_readdir’:
libabi/src/sys_linux.c:79:5: warning: ‘readdir64_r’ is deprecated [-Wdeprecated-declarations]
     err = readdir64_r(dirp,&data.ent,&pent);
     ^~~
In file included from libabi/src/sys_linux.c:24:0:
/usr/include/dirent.h:201:12: note: declared here
 extern int readdir64_r (DIR *__restrict __dirp,
            ^~~~~~~~~~~
libffabi/src/ffabi.c: In function ‘ffm_audio_decode_put_data’:
libffabi/src/ffabi.c:242:5: warning: ‘avcodec_decode_audio4’ is deprecated [-Wdeprecated-declarations]
     r = avcodec_decode_audio4(ctx->avctx,ctx->frame,&ctx->have_frame,&avpkt);
     ^
In file included from libffabi/src/ffabi.c:22:0:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4763:5: note: declared here
 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
     ^~~~~~~~~~~~~~~~~~~~~
libffabi/src/ffabi.c: In function ‘ffm_audio_encode_close’:
libffabi/src/ffabi.c:377:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&ctx->pck);
     ^~~~~~~~~~~~~~
In file included from libffabi/src/ffabi.c:22:0:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4473:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^~~~~~~~~~~~~~
libffabi/src/ffabi.c: In function ‘ffm_audio_encode_put_frame’:
libffabi/src/ffabi.c:398:5: warning: ‘av_free_packet’ is deprecated [-Wdeprecated-declarations]
     av_free_packet(&ctx->pck);
     ^~~~~~~~~~~~~~
In file included from libffabi/src/ffabi.c:22:0:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:4473:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^~~~~~~~~~~~~~
libffabi/src/ffabi.c:434:5: warning: ‘avcodec_encode_audio2’ is deprecated [-Wdeprecated-declarations]
     return avcodec_encode_audio2(ctx->avctx,&ctx->pck,frame,&ctx->have_packet);
     ^~~~~~
In file included from libffabi/src/ffabi.c:22:0:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:5284:5: note: declared here
 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
     ^~~~~~~~~~~~~~~~~~~~~
objcopy --strip-all --strip-debug --strip-unneeded --discard-all out/libmakemkv.so.1.full out/libmakemkv.so.1 
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_mainwnd.cpp makemkvgui/src/mainwnd.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_logtext.cpp makemkvgui/src/logtext.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_dirselectbox.cpp makemkvgui/src/dirselectbox.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_aboutbox.cpp makemkvgui/src/aboutbox.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_settingdlg.cpp makemkvgui/src/settingdlg.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_backupdlg.cpp makemkvgui/src/backupdlg.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_lineeditk.cpp makemkvgui/src/lineeditk.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_dvdbox.cpp makemkvgui/src/dvdbox.h
mkdir -p tmp
/usr/lib/x86_64-linux-gnu/qt5/bin/moc -o tmp/moc_drivebox.cpp makemkvgui/src/drivebox.h
mkdir -p tmp
ld -r -b binary -o tmp/image_data.o makemkvgui/bin/image_data.bin
ld: makemkvgui/bin/image_data.bin: not in ELF format
Makefile:93: recipe for target 'tmp/image_data.o' failed
make: *** [tmp/image_data.o] Error 1
Any help appreciated. I currently have a blu-ray with AACS v62 that I can't rip until I upgrade.
malattia
Posts: 8
Joined: Sun Dec 01, 2013 2:59 am
Location: Tokyo, Japan

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by malattia »

Not sure about that error.

Perhaps some version of

Code: Select all

ld
that doesn't understand that

Code: Select all

-b binary
option?

Code: Select all

malattia@tito:~/Downloads/makemkv-oss-1.10.2> objdump -i |grep '^binary'
binary

malattia@tito:~/Downloads/makemkv-oss-1.10.2> ld -version
GNU ld (GNU Binutils for Debian) 2.27.51.20161201
Copyright (C) 2016 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

malattia@tito:~/Downloads/makemkv-oss-1.10.2> apt-cache policy binutils
binutils:
  Installed: 2.27.51.20161201-1
  Candidate: 2.27.51.20161212-1
  Version table:
     2.27.51.20161212-1 500
        500 http://ftp.us.debian.org/debian unstable/main amd64 Packages
 *** 2.27.51.20161201-1 500
        500 http://ftp.us.debian.org/debian testing/main amd64 Packages
        100 /var/lib/dpkg/status
/me updates his system

Ha! funny now with 2.27.51.20161212-1 I get the same failure :'(

Code: Select all

malattia@tito:~/Downloads/makemkv-oss-1.10.2> ld -r -b binary -o tmp/image_data.o makemkvgui/bin/image_data.bin
ld: makemkvgui/bin/image_data.bin: not in ELF format
--
mattia
malattia
Posts: 8
Joined: Sun Dec 01, 2013 2:59 am
Location: Tokyo, Japan

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by malattia »

Using ld.gold seems to get things back in shape.

There's some ways to set ld.gold as the default here: https://bugs.debian.org/cgi-bin/bugrepo ... bug=718814

This seems to work for me:

Code: Select all

PATH=/usr/lib/gold-ld:$PATH make
--
mattia
mkvfann
Posts: 4
Joined: Sun Dec 18, 2016 1:40 am

Re: 1.10.2 compile failure with recent openssl (on Debian)

Post by mkvfann »

malattia, that worked for me as well (setting PATH to use gold-ld). I'm still a little confused as to why that works, but it works nonetheless.

Up and running with the latest MakeMKV. Thank you!
Post Reply