How to cross-compile only one module?

This forum is about all development around libVLC.
mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

How to cross-compile only one module?

Postby mangup » 18 Apr 2019 18:56

Is it possible to cross-compile only one module?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to cross-compile only one module?

Postby Jean-Baptiste Kempf » 18 Apr 2019 20:57

yes.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: How to cross-compile only one module?

Postby mangup » 19 Apr 2019 00:45

great. How to do it?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to cross-compile only one module?

Postby Jean-Baptiste Kempf » 19 Apr 2019 07:05

The same way you compile a normal out-of-tree module, but using your cross-compiler instead of gcc
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: How to cross-compile only one module?

Postby mangup » 22 Apr 2019 21:34

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) ?

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: How to cross-compile only one module?

Postby mangup » 25 Apr 2019 12:59

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 ?

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: How to cross-compile only one module?

Postby unidan » 25 Apr 2019 15:23

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

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: How to cross-compile only one module?

Postby mangup » 25 Apr 2019 16:08

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 ?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to cross-compile only one module?

Postby Rémi Denis-Courmont » 25 Apr 2019 17:50

Those two functions are provided by the CRT.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mangup
Blank Cone
Blank Cone
Posts: 71
Joined: 12 Apr 2019 20:23

Re: How to cross-compile only one module?

Postby mangup » 25 Apr 2019 18:04

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.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 26 guests