Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x11 dependency in sources also if NEED_UI = 0 #69

Closed
MaxPayne86 opened this issue Jan 15, 2020 · 32 comments
Closed

x11 dependency in sources also if NEED_UI = 0 #69

MaxPayne86 opened this issue Jan 15, 2020 · 32 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MaxPayne86
Copy link

Hello, first of all, thanks for this impressive collection of plugins. I've tried to compile lsp to a target which has no x11 support, since in my project it's not needed. I said, ok, I need to build with

make build_ladspa BUILD_PROFILE=aarch64

I also inserted some prints in src/Makefile to check the statuses of the flags

Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 build_ladspa BUILD_PROFILE=aarch64
| Package x11 was not found in the pkg-config search path.
| Perhaps you should add the directory containing x11.pc' | to the PKG_CONFIG_PATH environment variable | No package 'x11' found | Package cairo was not found in the pkg-config search path. | Perhaps you should add the directory containing cairo.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'cairo' found
| Package x11 was not found in the pkg-config search path.
| Perhaps you should add the directory containing x11.pc' | to the PKG_CONFIG_PATH environment variable | No package 'x11' found | Package cairo was not found in the pkg-config search path. | Perhaps you should add the directory containing cairo.pc'
| to the PKG_CONFIG_PATH environment variable

No package 'cairo' found
Building binaries
target architecture : aarch64
target platform : Linux
target system : Linux
compiler : aarch64-poky-linux-gcc (GCC) 7.3.0
modules : ladspa
3D rendering : glx
build directory : /localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build
-------------------------------------------------------------------------------
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Makefile:41: NEED_PLUGINS is 1
Makefile:42: NEED_UI is 0
Building core
Building metadata
Building dsp
Building rendering
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot expander.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot dsp.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot base_backend.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot stdlib/stdio.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot spectrum_analyzer.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot ICanvas.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot bits.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot native.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot glx/backend.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot impulse_reverb.cpp
aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot KVTDispatcher.cpp
In file included from glx/backend.cpp:16:0:
/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/include/rendering/glx/backend.h:12:10: fatal error: X11/X.h: No such file or directory
#include <X11/X.h>
^~~~~~~~~
compilation terminated.
@sadko4u sadko4u added the discuss Discussing the issue label Jan 15, 2020
@sadko4u
Copy link
Collaborator

sadko4u commented Jan 15, 2020

Currently there is no option to build plugins without UI support.
As a workaround, you may currently just install related X11 and cairo headers for building.
This won't stop LV2/VST plugin working if you will not ask them for the UI.
Or what kind of plugin format are you using?

@sadko4u
Copy link
Collaborator

sadko4u commented Jan 15, 2020

Ah, I see, you need LADSPA only.

@sadko4u
Copy link
Collaborator

sadko4u commented Jan 15, 2020

Yes, it seems that it tries to build GLX modules. I'll try to fix it.

@sadko4u
Copy link
Collaborator

sadko4u commented Jan 15, 2020

This commit should fix your problem: 66f95fc
Please try.

@sadko4u sadko4u self-assigned this Jan 15, 2020
@sadko4u sadko4u added this to the 1.1.14 milestone Jan 15, 2020
@sadko4u sadko4u added bug Something isn't working and removed discuss Discussing the issue labels Jan 15, 2020
@MaxPayne86
Copy link
Author

Hello, I've tried but I still get errors. I need plugins in lv2 format, so I've modified src/Makefile
to contains your modifications (exclude rendering) plus mine, just for test

ifeq ($(findstring ladspa,$(BUILD_MODULES)),ladspa)
NEED_PLUGINS = 1
endif
ifeq ($(findstring lv2,$(BUILD_MODULES)),lv2)
NEED_PLUGINS = 1
endif

so that NEED_UI is not present in lv2 mode. Below the output log

| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot interpolation.cpp
| aarch64-poky-linux-ld --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot core.o
| Building utils
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot resource_gen.cpp
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot lv2_genttl.cpp
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot gen_resources.exe
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot lv2_genttl.exe
| Building container
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot CairoCanvas.cpp
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot lv2.cpp
| aarch64-poky-linux-g++ --sysroot=/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/recipe-sysroot lsp-plugins-lv2.so
| aarch64-poky-linux-g++: error: /localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/ui_core.o: No such file or directory
| aarch64-poky-linux-g++: error: /localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/res_core.o: No such file or directory
| Makefile:55: recipe for target '/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/lsp-plugins-lv2.so' failed
| make[2]: *** [/localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/lsp-plugins-lv2.so] Error 1
| Makefile:61: recipe for target 'container' failed
| make[1]: *** [container] Error 2
| Makefile:165: recipe for target 'compile' failed
| make: *** [compile] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

I will try to build ladspa container asap...

You said "Currently there is no option to build plugins without UI support."

Is it confirmed or not?

@MaxPayne86
Copy link
Author

UPDATE: with build_ladspa + your modifications builds successfully on my build environment (yocto). Just one thing, I had to modify ladspa.cpp line 17 (Linux case) to search for include in

#include <3rdparty/ladspa/ladspa.h>

since no ladspa.h is present in the sysroot for this package.

Hope this helps

@sadko4u
Copy link
Collaborator

sadko4u commented Jan 16, 2020

@MaxPayne86 or you just could install ladspa-devel or ladspa-dev package on your system.
<ladspa.h> was just added for better portability with Windows system (and possible other OSes).

Currently there is no option to build plugins without UI support
This is related to VST, LV2 and JACK versions. For LADSPA it is not required.

@sadko4u sadko4u added the PENDING FOR RELEASE This issue will be added to the nearest upcoming release label Jan 16, 2020
@sadko4u
Copy link
Collaborator

sadko4u commented Jan 16, 2020

Merged changes into devel branch: f52608e
Removed github-issue-69 branch.

@MaxPayne86
Copy link
Author

@sadko4u thanks for your support. Is the removal of UI dependencies for LV2 container in plan? I think it's makes a lot of sense, but I cannot estimate the effort needed, maybe is worth to be discussed. Cairo can be builded with no x11 support. I've seen your ui has cairo dependencies...calf studio suite has the same problem (in terms of cairo dependencies) but builds just fine in my env.

@sadko4u
Copy link
Collaborator

sadko4u commented Jan 16, 2020

Cairo is required for LV2's inline display feature.
It is possible to make LV2 buildable without the UI but due to huge set of controls some plugins like samplers won't work without utilizing Atom protocol. Same is true for VST.

@MaxPayne86
Copy link
Author

MaxPayne86 commented Mar 7, 2020

Hello, I'm applying the following patches

diff --git a/src/Makefile b/src/Makefile
index 2142a23a..e2e93f83 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -19,7 +19,6 @@ ifneq ($(LSP_TESTING),1)
     NEED_PLUGINS            = 1
   endif
   ifeq ($(findstring lv2,$(BUILD_MODULES)),lv2)
-    NEED_UI                 = 1
     NEED_PLUGINS            = 1
   endif
   ifeq ($(findstring vst,$(BUILD_MODULES)),vst)
diff --git a/src/container/Makefile b/src/container/Makefile
index 1f78f131..cd49256a 100644
--- a/src/container/Makefile
+++ b/src/container/Makefile
@@ -51,11 +51,11 @@ $(LIB_LADSPA):
 	@echo "  $(CXX) $(notdir $(LIB_LADSPA))"
 	@$(CXX) -o $(LIB_LADSPA) $(OBJDIR)/ladspa.o $(OBJFILES) $(SO_FLAGS) $(LIBS)
 
-$(LIB_LV2): $(OBJ_HELPERS)
+$(LIB_LV2):
 	@echo "  $(CXX) lv2.cpp"
-	@$(CXX) -o $(OBJDIR)/lv2.o -c lv2.cpp -fPIC $(CPPFLAGS) $(CXXFLAGS) $(INCLUDE) $(CAIRO_HEADERS)
+	@$(CXX) -o $(OBJDIR)/lv2.o -c lv2.cpp -fPIC $(CPPFLAGS) $(CXXFLAGS) $(INCLUDE)
 	@echo "  $(CXX) $(notdir $(LIB_LV2))"
-	@$(CXX) -o $(LIB_LV2) $(OBJDIR)/lv2.o $(OBJ_HELPERS) $(UI_OBJFILES) $(SO_FLAGS) $(UI_LIBS)
+	@$(CXX) -o $(LIB_LV2) $(OBJDIR)/lv2.o $(OBJFILES) $(SO_FLAGS) $(LIBS)
 
 $(LIB_VST):
 	@echo "  $(CXX) vst.cpp"

I can now do

make build_lv2 BUILD_PLATFORM=Linux BUILD_PROFILE=aarch64

and compile without errors, however when loading an lv2 plugin on target I'm encountering this issue:

lilv_lib_open(): error: Failed to open library /home/root/.lv2plugins/lsp-plugins.lv2/lsp-plugins-lv2.so (/home/root/.lv2plugins/lsp-plugins.lv2/lsp-plugins-lv2.so: undefined symbol: _ZN3lsp3ctl7CtlPort5writeEPKvm)
can't get lilv instance

What I'm trying to do here? It's really just a test, to make LV2 buildable without the UI. Hope this helps

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 7, 2020

You can't do that simple with LV2 since LV2 plugin wrapper uses both UI and DSP code.
According to your patches, you've just removed the UI part from linkage and got inconsistent *.so file because of missing UI-related functions in the binary.

@MaxPayne86
Copy link
Author

MaxPayne86 commented Mar 17, 2020

Thanks @sadko4u, that was just a test but it's now clear that to make this plugin suite working with an lv2 host on a headless system then the lv2 wrapper (container source code) need to be modified. Unfortunately I cannot do that at the moment, hope that my tests will be useful for someone else...

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 17, 2020

@MaxPayne86 please don't get sad. Maybe I'll have some time to add UI removal for LV2 plugins for the 1.1.14 release.

@falkTX
Copy link

falkTX commented Mar 18, 2020

FYI I was able to build lsp-plugins without UI, and only needed to modify lv2 code (removing lv2ui stuff).
I used this command to build:

make BUILD_MODULES=lv2 BUILD_R3D_BACKENDS= OBJ_UI_CORE= XLIB_HEADERS= XLIB_LIBS=

And here's a patch to disable the lv2ui stuff:

diff --git a/src/container/lv2.cpp b/src/container/lv2.cpp
index 4b94aeb..b00b15b 100644
--- a/src/container/lv2.cpp
+++ b/src/container/lv2.cpp
@@ -11,15 +11,19 @@
 
 #include <data/cvector.h>
 
+#if 0
 #include <ui/ui.h>
+#endif
 
 #include <container/lv2/extensions.h>
 #include <container/lv2/types.h>
 #include <container/lv2/ports.h>
 #include <container/lv2/executor.h>
 #include <container/lv2/wrapper.h>
+#if 0
 #include <container/lv2/ui_ports.h>
 #include <container/lv2/ui_wrapper.h>
+#endif
 
 namespace lsp
 {
@@ -279,6 +283,7 @@ namespace lsp
 
     static StaticFinalizer lv2_finalizer(lv2_drop_descriptors);
 
+#if 0
     //--------------------------------------------------------------------------------------
     // LV2UI routines
 
@@ -418,6 +423,7 @@ namespace lsp
     };
 
     static StaticFinalizer lv2ui_finalizer(lv2ui_drop_descriptors);
+#endif
 }
 
 #ifdef __cplusplus
@@ -435,6 +441,7 @@ extern "C"
         return (index < lv2_descriptors_count) ? &lv2_descriptors[index] : NULL;
     }
 
+#if 0
     LV2_SYMBOL_EXPORT
     const LV2UI_Descriptor *lv2ui_descriptor(uint32_t index)
     {
@@ -444,6 +451,7 @@ extern "C"
         lv2ui_gen_descriptors();
         return (index < lv2ui_descriptors_count) ? &lv2ui_descriptors[index] : NULL;
     }
+#endif
 
 #ifdef __cplusplus
 }

@falkTX
Copy link

falkTX commented Mar 18, 2020

Oh, this might be useful to apply in the project:

diff --git a/scripts/make/tools.mk b/scripts/make/tools.mk
index bd6e01f..3be175a 100644
--- a/scripts/make/tools.mk
+++ b/scripts/make/tools.mk
@@ -27,7 +27,7 @@ LD                       ?= $(TOOL_LD)
 MAKE_OPTS                 = -s
 CFLAGS                   += $(CC_ARCH) $(FLAG_CTUNE) $(CC_FLAGS) $(FLAG_VERSION)
 CXXFLAGS                 += $(CC_ARCH) $(FLAG_CTUNE) $(CC_FLAGS) $(FLAG_VERSION)
-SO_FLAGS                  = $(CC_ARCH) $(FLAG_RELRO) -Wl,--gc-sections -shared -Llibrary -lc -fPIC
+SO_FLAGS                  = $(CC_ARCH) $(FLAG_RELRO) -Wl,--gc-sections -Wl,--no-undefined -shared -Llibrary -lc -fPIC
 MERGE_FLAGS               = $(LD_ARCH) -r
 EXE_TEST_FLAGS            = $(LDFLAGS) $(CC_ARCH)
 EXE_FLAGS                 = $(LDFLAGS) $(CC_ARCH) $(FLAG_RELRO) -Wl,--gc-sections

I added -Wl,--no-undefined so that shared libraries (plugins) fail in the linking stage if there are missing symbols

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 19, 2020

Please try the github-issue-69 branch. Now it's possible to specify the following additional options:

make BUILD_MODULES=lv2,vst,ladspa LV2_UI=0 VST_UI=0

@falkTX thanks for linker flag, added it to build files.

@falkTX
Copy link

falkTX commented Mar 19, 2020

LV2 build succeeds now without any patching, thanks!
I used BUILD_MODULES=lv2 LV2_UI=0

Still, a few notes:

  1. BUILD_R3D_BACKENDS= is needed during make install otherwise it fails with:
Installing LV2 plugins to /home/falktx/mod-workdir/modduox/target/usr/lib/lv2/lsp-plugins.lv2
install: cannot stat '/home/falktx/mod-workdir/modduox/build/lsp-plugins-0c1fac8937456571caec0d0964e6202d2f3a753f/.build/lsp-plugins-r3d*.so': No such file or directory
Makefile:214: recipe for target 'install_lv2' failed
  1. x11 pkg-config is still in use, so XLIB_HEADERS= XLIB_LIBS= make params are still needed to silence those warnings.
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable

@falkTX
Copy link

falkTX commented Mar 19, 2020

For reference, my full make args are:

BUILD_MODULES=lv2
BUILD_PROFILE=$(LSP_PLUGINS_BUILD_PROFILE)
BUILD_R3D_BACKENDS= 
LV2_UI=0
PREFIX=/usr
XLIB_HEADERS=
XLIB_LIBS=

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

@falkTX FYI: '-Wl,-no-undefined' doesn't work on FreeBSD if you use some POSIX variables like environ:

/usr/local/bin/ld: /usr/home/sadko/git/lsp-plugins/.test/core.o: in function `lsp::ipc::Process::copy_env()':
/usr/home/sadko/git/lsp-plugins/src/core/ipc/Process.cpp:1493: undefined reference to `environ'
collect2: error: ld returned 1 exit status
gmake[2]: *** [Makefile:86: /usr/home/sadko/git/lsp-plugins/.test/lsp-plugins-jack-core-1.1.13.so] Error 1
gmake[1]: *** [Makefile:71: container] Error 2
gmake: *** [Makefile:180: test_compile] Error 2

@falkTX
Copy link

falkTX commented Mar 20, 2020

Then you are missing a library to link against in FreeBSD

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

Then you are missing a library to link against in FreeBSD

No, that's some FreeBSD magic. Removing the flag for FreeBSD solved linkage issue and all works pretty fine.

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

Not only LSP has such issues with FreeBSD:
image

On FreeBSD, this variable is defined as a common symbol in the object file
/usr/lib/crt1.o, which is injected into the final application by the
compiler. This means when linking any library, 'environ' cannot be found
and we can't use -Wl,-no-undefined on FreeBSD.

I don't know why this wasn't caught before. Most likely, we failed to
pass the linker flag until some recent change to the buildsystem.

qprocess_unix.cpp:279: undefined reference to `environ'

@falkTX
Copy link

falkTX commented Mar 20, 2020

That is so weird though... very hackish.
So it means standalones get that symbol, but shared libraries do not, making it impossible to know if a shared library has other missing symbols or not. :(

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

Merged changes into devel branch

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

Removed github-issue-69 branch.

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 20, 2020

Changes available in 1.1.14 release!

@sadko4u sadko4u closed this as completed Mar 20, 2020
@sadko4u sadko4u removed the PENDING FOR RELEASE This issue will be added to the nearest upcoming release label Mar 20, 2020
@MaxPayne86
Copy link
Author

Hi @sadko4u @falkTX thanks for the help. I still have a problem with

@$(UTL_RESGEN) $(OBJDIR)/res/builtin_resource.cpp $(BASEDIR)/res/ui $(BASEDIR)/res/presets $(BASEDIR)/res/models

| /localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/gen_resources.exe: 1: /localdisk/massimo/Work/NanoPiNEO2/build/tmp/work/aarch64-poky-linux/lsp-plugins/1.0-r0/git/.build/gen_resources.exe: Syntax error: word unexpected (expecting ")")

I'm cross-compiling on x86_64 host for aarch64 target and with your current Makefile .build/gen_resources.exe is compiled as target (arm executable). As you can imagine it will not run on the host build machine, failing the compilation step.
I think this is a "native" tool not something you want on the target. I'm missing something?

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 24, 2020

The problem is, that all source files in 'utils' are supplementary utilities that mostly generate additional resources (like TTL files and built-in resources) and are required to be executed on the host architecture. But they also reuse object files which are built for target architecture in your case. So it's not easy to split host from target in this case.

According to what I've just described I don't think that cross-compilation is currently possible at all. I would probably recommend to issue the complete build on the virtual machine that emulates the target architecture.

I especially use real Raspberry Pi's for LSP releases, so binaries are built in real environment.

@falkTX
Copy link

falkTX commented Mar 24, 2020

cross-compilation works fine if we setup binfmt and qemu-static, in a way that allows us to run arm/aarch64 binaries (that is the case for MOD anyway).
See https://github.com/moddevices/mod-plugin-builder/blob/master/docker/Dockerfile for how this is setup under debian-based distros.

@MaxPayne86
Copy link
Author

Hey guys, I'm using yocto for building this package, I don't think it's possible to emulate the final target architecture during the build of a package. The reason behind is to avoid host(native)-target contamination during build. As a simple solution, could work to generate builtin_resource.cpp during standard x86_64 and then use it to generate the required objects during cross compilation in your op? builtin_resource.cpp is strongly dependant on architecture? If that's the case then I'll compile everything on aarch64 and steal the builtin_resource.cpp file...:S

@$(CXX) -o $(OBJ_RES_CORE) -c $(OBJDIR)/res/builtin_resource.cpp -fPIC $(CPPFLAGS) $(CXXFLAGS) $(INCLUDE)

@sadko4u
Copy link
Collaborator

sadko4u commented Mar 24, 2020

builtin_resource is self-containing, it can be just thrown into the tree of target architecture's build. What about TTL generator? I suppose since you'll build plugins on the host first, you also can use it, too because TTL files are platform-independent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants