Compilation failed: makemkv-oss

The place to discuss linux version of MakeMKV
Post Reply
Message
Author
Rocket
Posts: 5
Joined: Mon Apr 27, 2020 6:40 pm

Compilation failed: makemkv-oss

#1 Post by Rocket » Mon Apr 27, 2020 6:53 pm

Hello,

I'm trying to build makemkv-oss, but the compilation failed. My system:

Code: Select all

Linux KISS 5.6.4 #3 SMP Wed Apr 15 15:55:21 UTC 2020 x86_64 GNU/Linux
On KISS Linux, musl is used instead of glibc. I don't know if it can be a problem.
I try to compile makemkv-oss 1.15.1. It's the first time I compile it, so I don't know if there was no problem before.
I have compiled ffmpeg and disabled shared libraries.

The compilation fails

Code: Select all

gcc -O3 -pipe -march=native -D_linux_  -D_REENTRANT -shared -Wl,-z,defs -oout/libmmbd.so.0.full -I./makemkvgui/inc -I./libmmbd/inc -I./libdriveio/inc \
-I./libmakemkv/inc -I./sstring/inc -I./libabi/inc makemkvgui/src/client.cpp makemkvgui/src/marshall.cpp libmmbd/src/marmmbd.cpp libmmbd/src/nstring.cpp libmmbd/src/mmbd.cpp libmmbd/src/mmconn.cpp libmmbd/src/mmbdipc.cpp libmmbd/src/utf8.cpp libmmbd/src/aacs.cpp libmmbd/src/bdplus.cpp libmmbd/src/crypto_ossl.cpp makemkvgui/src/api_posix.cpp makemkvgui/src/api_linux.cpp makemkvgui/src/sem_posix.cpp makemkvgui/src/spawn_posix.cpp sstring/src/sstring.cpp \
libdriveio/src/srlist.cpp \
-fPIC -Xlinker -dy -Xlinker --version-script=libmmbd/src/libmmbd.vers \
-Xlinker -soname=libmmbd.so.0 -lc -lstdc++ -lrt -lpthread -lcrypto
makemkvgui/src/client.cpp: In member function 'bool CApClient::Init(char, const char*, unsigned int*)':
makemkvgui/src/client.cpp:121:52: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  121 |     if (false==ApOpenSgrp(&m_sem,(uint64_t*)m_mem->args))
      |                                             ~~~~~~~^~~~
makemkvgui/src/client.cpp: In member function 'void CApClient::ExecCmd(AP_CMD)':
makemkvgui/src/client.cpp:218:45: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  218 |             p_str = (const utf16_t*) m_mem->strbuf;
      |                                      ~~~~~~~^~~~~~
makemkvgui/src/client.cpp:271:87: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  271 |             m_Ui->UpdateCurrentInfo( (unsigned int) m_mem->args[0] , (utf16_t*)m_mem->strbuf );
      |                                                                                ~~~~~~~^~~~~~
makemkvgui/src/client.cpp:277:128: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  277 |                 rr = m_Ui->ReportUiMessage( (unsigned long) m_mem->args[0] , (unsigned long) m_mem->args[2] , (utf16_t*)m_mem->strbuf );
      |                                                                                                                         ~~~~~~~^~~~~~
makemkvgui/src/client.cpp:289:53: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  289 |                 const utf16_t* p = (utf16_t*)m_mem->strbuf;
      |                                              ~~~~~~~^~~~~~
makemkvgui/src/client.cpp:305:152: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  305 |                 m_mem->args[0] = m_Ui->ReportUiDialog((unsigned long) m_mem->args[0] , (unsigned long) m_mem->args[1] , count, text , (utf16_t*)m_mem->strbuf );
      |                                                                                                                                                 ~~~~~~~^~~~~~
makemkvgui/src/marshall.cpp: In member function 'const utf16_t* CApClient::GetSettingString(ApSettingId)':
makemkvgui/src/marshall.cpp:59:30: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
   59 |     return (utf16_t*)(m_mem->strbuf);
      |                      ~~~~~~~~^~~~~~~
makemkvgui/src/marshall.cpp: In member function 'const utf16_t* CApClient::GetAppString(unsigned int, unsigned int, unsigned int)':
makemkvgui/src/marshall.cpp:100:33: warning: taking address of packed member of '_AP_SHMEM' may result in an unaligned pointer value [-Waddress-of-packed-member]
  100 |         return (utf16_t*)m_mem->strbuf;
      |                          ~~~~~~~^~~~~~
sstring/src/sstring.cpp: In function 'int sprintf_s(char*, size_t, const char*, ...)':
sstring/src/sstring.cpp:78:15: error: '_vsnprintf' was not declared in this scope; did you mean 'vsnprintf'?
   78 |     int rtn = _vsnprintf(buffer,sizeOfBuffer,format,args);
      |               ^~~~~~~~~~
      |               vsnprintf
make: *** [Makefile:86: out/libmmbd.so.0.full] Error 1
make: *** Waiting for unfinished jobs....
Do you have any idea what can be wrong ?

Thank you!

Rocket
Posts: 5
Joined: Mon Apr 27, 2020 6:40 pm

Re: Compilation failed: makemkv-oss

#2 Post by Rocket » Sat May 09, 2020 6:22 am

I have found the following in sstring/src/sstring.cpp:

Code: Select all

#if defined(__GLIBC__) || defined(_darwin_)
#define _vsnprintf vsnprintf
#define _vsnwprintf vswprintf
#endif
I assume a change is done for glibc and not for musl. So I replaced _vsnprintf to vsnprintf in this file. I ended with this patch:

Code: Select all

--- a/sstring/src/sstring.cpp
+++ b/sstring/src/sstring.cpp
@@ -75,7 +75,7 @@
     va_list args;
     va_start(args,format);

-    int rtn = _vsnprintf(buffer,sizeOfBuffer,format,args);
+    int rtn = vsnprintf(buffer,sizeOfBuffer,format,args);

     va_end(args);
Probably a change has to be done for musl-distribution on Linux.

Post Reply