Error building 1.16.3

The place to discuss linux version of MakeMKV
Post Reply
lazysysadmin
Posts: 1
Joined: Thu Mar 18, 2021 9:55 pm

Error building 1.16.3

Post by lazysysadmin »

While building the OSS part, I get this error on a debian system.

Code: Select all

gcc -g -O2 -D_linux_ -DMMCCXTR=1  -DHAVE_BUILDINFO_H -Itmp -D_GNU_SOURCE -oout/mmccextr.full mmccextr/ccextractor.c mmccextr/lib_ccx/activity.c mmccextr/lib_ccx/ccx_common_char_encoding.c mmccextr/lib_ccx/ccx_common_common.c mmccextr/lib_ccx/ccx_common_constants.c mmccextr/lib_ccx/ccx_common_option.c mmccextr/lib_ccx/ccx_common_timing.c mmccextr/lib_ccx/ccx_decoders_608.c mmccextr/lib_ccx/ccx_decoders_common.c mmccextr/lib_ccx/ccx_demuxer.c mmccextr/lib_ccx/ccx_encoders_common.c mmccextr/lib_ccx/ccx_encoders_helpers.c mmccextr/lib_ccx/ccx_encoders_srt.c mmccextr/lib_ccx/file_functions.c mmccextr/lib_ccx/general_loop.c mmccextr/lib_ccx/lib_ccx.c mmccextr/lib_ccx/output.c mmccextr/lib_ccx/params.c mmccextr/lib_ccx/params_dump.c mmccextr/lib_ccx/sequencing.c mmccextr/lib_ccx/utility.c -lc \
-ffunction-sections -Wl,--gc-sections -Wl,-z,defs
/usr/bin/ld: /tmp/cc1wjJHf.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:49: multiple definition of `signal_ctx'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:49: first defined here
/usr/bin/ld: /tmp/cc1wjJHf.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:48: multiple definition of `ccx_options'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:48: first defined here
/usr/bin/ld: /tmp/ccdT5CJc.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:49: multiple definition of `signal_ctx'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:49: first defined here
/usr/bin/ld: /tmp/ccdT5CJc.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:48: multiple definition of `ccx_options'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:48: first defined here
/usr/bin/ld: /tmp/cco59g1e.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:48: multiple definition of `ccx_options'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:48: first defined here
/usr/bin/ld: /tmp/cco59g1e.o:/tmp/makemkv-oss-1.16.3/mmccextr/lib_ccx/../ccextractor.h:49: multiple definition of `signal_ctx'; /tmp/ccQ6LwHe.o:/tmp/makemkv-oss-1.16.3/mmccextr/ccextractor.h:49: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:115: out/mmccextr.full] Errore 1
Is this a known problem?

Thank you
Woodstock
Posts: 10328
Joined: Sun Jul 24, 2011 11:21 pm

Re: Error building 1.16.3

Post by Woodstock »

m11kvm
Posts: 4
Joined: Fri Mar 19, 2021 1:31 am

Re: Error building 1.16.3

Post by m11kvm »

That's what happens when global variables are defined in a header file...

This patch will fix it. cd into the makemkv-oss-1.16.3 directory and apply with 'patch -p2 < patchfile'

Code: Select all

diff -ur 1.16.3.orig/makemkv-oss-1.16.3/mmccextr/ccextractor.c 1.16.3/makemkv-oss-1.16.3/mmccextr/ccextractor.c
--- 1.16.3.orig/makemkv-oss-1.16.3/mmccextr/ccextractor.c       2021-03-18 12:09:34.000000000 -0400
+++ 1.16.3/makemkv-oss-1.16.3/mmccextr/ccextractor.c    2021-03-18 21:21:07.337841383 -0400
@@ -9,6 +9,9 @@
 
 volatile int terminate_asap = 0;
 
+struct ccx_s_options ccx_options;
+struct lib_ccx_ctx *signal_ctx = NULL;
+
 void sigusr1_handler(int sig)
 {
     mprint("Caught SIGUSR1. Filename Change Requested\n");
diff -ur 1.16.3.orig/makemkv-oss-1.16.3/mmccextr/ccextractor.h 1.16.3/makemkv-oss-1.16.3/mmccextr/ccextractor.h
--- 1.16.3.orig/makemkv-oss-1.16.3/mmccextr/ccextractor.h       2021-03-18 12:09:34.000000000 -0400
+++ 1.16.3/makemkv-oss-1.16.3/mmccextr/ccextractor.h    2021-03-18 21:20:21.175533910 -0400
@@ -45,8 +45,8 @@
 #endif
 
 
-struct ccx_s_options ccx_options;
-struct lib_ccx_ctx *signal_ctx;
+extern struct ccx_s_options ccx_options;
+extern struct lib_ccx_ctx *signal_ctx;
 //volatile int terminate_asap = 0;
 
 struct ccx_s_options* api_init_options();
Last edited by m11kvm on Fri Mar 19, 2021 12:18 pm, edited 1 time in total.
m11kvm
Posts: 4
Joined: Fri Mar 19, 2021 1:31 am

Re: Error building 1.16.3

Post by m11kvm »

Also, here's the upstream fix for this issue: https://github.com/CCExtractor/ccextrac ... b0d94f08e0.
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Error building 1.16.3

Post by mike admin »

m11kvm wrote:
Fri Mar 19, 2021 1:51 am
Also, here's the upstream fix for this issue: https://github.com/CCExtractor/ccextrac ... b0d94f08e0.
Thanks for linking this info! I did not know it is caused by default -fno-common behavior change.
The oss package updated in-place with this patch integrated.
Zirias
Posts: 22
Joined: Mon Apr 22, 2019 3:30 pm

Re: Error building 1.16.3

Post by Zirias »

mike admin wrote:
Fri Mar 19, 2021 1:32 pm
The oss package updated in-place with this patch integrated.
In the name of anyone packaging: Please don't do that. I just got a patch accepted against FreeBSD ports to update to 1.16.3 and now it fails to build on the official builders because they of course check filesize and checksum. As a result, packages will be completely unavailable until my next patch is accepted (which is hopefully pretty quick). Using checksums for upstream packages is common practice to detect any "tampering" :)

edit: at least good to find this info here, build for FreeBSD will hopefully be fixed soon. https://bugs.freebsd.org/254475

edit2: FreeBSD ports tree is fixed now, I guess packages will be available in a few days. 8)
Post Reply