Page 1 of 1

How to cross-compile only one module?

Posted: 18 Apr 2019 18:56
by mangup
Is it possible to cross-compile only one module?

Re: How to cross-compile only one module?

Posted: 18 Apr 2019 20:57
by Jean-Baptiste Kempf
yes.

Re: How to cross-compile only one module?

Posted: 19 Apr 2019 00:45
by mangup
great. How to do it?

Re: How to cross-compile only one module?

Posted: 19 Apr 2019 07:05
by Jean-Baptiste Kempf
The same way you compile a normal out-of-tree module, but using your cross-compiler instead of gcc

Re: How to cross-compile only one module?

Posted: 22 Apr 2019 21:34
by mangup
So, according to OutOfTreeCompile instruction, I've prepared linux Makefile.
But I've got .so only after changes in code: there were problem with "static_assert()" , "N_" and "_" macros'es definition.

Question1: how to build .so without this code changes?

After that I've cloned Makefile and modified next lines:
LD = /usr/bin/x86_64-w64-mingw32-ld
CC = /usr/bin/x86_64-w64-mingw32-gcc
PKG_CONFIG = /usr/bin/x86_64-w64-mingw32-pkg-config

and stuck with error:

Code: Select all

vlc/modules/demux$ make -f makefile_mp4_w Package vlc-plugin was not found in the pkg-config search path. Perhaps you should add the directory containing `vlc-plugin.pc' to the PKG_CONFIG_PATH environment variable No package 'vlc-plugin' found make: Nothing to be done for 'all'.

Question2.1: how to modify makefile for windows-build ?
Question2.2: taking in account absence of compiled dependencies (libvlccore.dll) ?

Re: How to cross-compile only one module?

Posted: 25 Apr 2019 12:59
by mangup
UPD:
I've built .so with one change in code

Code: Select all

diff --git a/include/vlc_aout.h b/include/vlc_aout.h index 43fbf2f120..cc5d717b1f 100644 --- a/include/vlc_aout.h +++ b/include/vlc_aout.h @@ -24,6 +24,7 @@ #define VLC_AOUT_H 1 #include <assert.h> +#include "vlc_fixups.h" /** * \defgroup audio_output Audio output
but still failed to build .dll using modified makefile:

Code: Select all

COMPILER_PATH=/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/bin/ LIBRARY_PATH=/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/ COLLECT_GCC_OPTIONS='-std=gnu99' '-shared' '-o' 'libmp4_plugin.dll' '-L/home/andreyrusanov/work' '-L/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32' '-v' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/collect2 -m i386pep --shared -Bdynamic -e DllMainCRTStartup --enable-auto-image-base -o libmp4_plugin.dll /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/crtbegin.o -L/home/andreyrusanov/work -L/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 -L/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 -L/usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/../../../../x86_64-w64-mingw32/lib mp4/mp4.o mp4/fragments.o mp4/libmp4.o mp4/heif.o mp4/essetup.o mp4/meta.o asf/asfpacket.o -lm -llibvlccore -lssp -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32/crtend.o undefined reference to `__assert_fail' undefined reference to `strndup' undefined reference to `__snprintf_chk'
So, the question now is - how to solve this undefined references ?

Re: How to cross-compile only one module?

Posted: 25 Apr 2019 15:23
by unidan
Hi, you should look at the command line done by the build.sh, iirc you can set the environment variable V=1 or VERBOSE=1 or maybe SILENT= or use "make -n" to check what is executed

Re: How to cross-compile only one module?

Posted: 25 Apr 2019 16:08
by mangup
yep, i found that vlc has own realization of some functions (including necessary compat/strndup compat/strcasestr)
but where to get __assert_fail, __snprintf_chk ?

Re: How to cross-compile only one module?

Posted: 25 Apr 2019 17:50
by RĂ©mi Denis-Courmont
Those two functions are provided by the CRT.

Re: How to cross-compile only one module?

Posted: 25 Apr 2019 18:04
by mangup
which library should i link?
I've tried /usr/lib/x86_64-linux-gnu/wine/fakedlls/crtdll.dll and /usr/lib/x86_64-linux-gnu/wine/fakedlls/msvcrt40.dll
- there were many undefined reference errors, but working instance dll was compiled.