Hi Andreas, Am 02.01.2017 um 17:11 schrieb Andreas Färber:
Hi Stefan,
Am 02.01.2017 um 10:53 schrieb Stefan Seyfried:
On 02.01.2017 10:43, Roger Oberholtzer wrote:
On Mon, Jan 2, 2017 at 10:00 AM, Stefan Seyfried <stefan.seyfried@googlemail.com> wrote:
If you want to cross-compile easily, use a distribution that's designed to do so -- I can heartily recommend openembedded / The Yocto Project.
Let's be very clear that Yocto is _not_ a distribution but a toolkit for building your own distribution.
That's technically true, however, for all practical uses this distinction does not matter too much. It's like referring to gentoo as "_not_ a distribution but a toolset".
Which we should not be advertising on an opensuse-* mailinglist, as all benefits of our distro that users may rely on then vanish.
I'll comment on this in the next (similar) paragraph.
And the killerfeature of openembedded for me: you can easily build a reloacatable SDK which allows for easy and painless crosscompilation, targeted for your exact target configuration.
Please remember the original question, cross-compiling userspace software (for openSUSE).
Obviously I'm reading the original question in a different way than you do. openSUSE was not really mentioned.
Advising people against using openSUSE is not a solution to that question and highly questionable on an openSUSE mailing list!
Even though this is an openSUSE mailing list, I'm not going to suggest or even advocate that people use inferior tools, just because they happen to be delivered with openSUSE. I'm almost always advising people to use the best available tools for the given job. I'm advising debian users to run a SUSE VM / container if they want to package using the OBS / osc, even though there are osc packages for debian available. Why? Because it's the best thing to get the job done. The only time i'm sometimes advising to use inferior tools is when (IMHO) the inferior tool is e.g. much easier to use. And exactly the same I'm doing here. I'm advising to use an openembedded-built SDK for cross compiling because it is the most simple to use tool if you want to get the job (cross-compiling your software to a binary you can test on the target quickly) done.
I will also add that I published a paper on why openSUSE can be a better option for not too constrained embedded systems compared to Yocto or BuildRoot. They may seem more convenient at first, but they are either insecure if done lazily or quite work-intensive if done responsibly.
(Side note: quite often I get security fixes much faster from the Yocto project than from openSUSE. I could also publish a paper on that.) This is not about running the code later. Once the development is done, and the code is working, it can be built for openSUSE using the OBS easily and run in an openSUSE environment. But to develop the stuff, cross-compiling etc. is a major PITA on openSUSE compared to using an openembedded-built SDK. Been there, done that for a long time. I even maintained cross-compilers for PPC and ARM in my OBS home project. Finally took the (quite frightening) hurdle to start using OE/Yocto and never looked back. And don't get me wrong: this is not because openSUSE is technically inferior (it isn't), but because the scope of the projects is totally different. The SDK is a core feature of OE. Of course it would be possible to build a cross SDK for openSUSE, but it is a lot of work. Given there is a near perfect solution for developers, I personally just use the OE SDK instead of spending valuable time on reinventing the wheel, considering that it is a very special wheel used by only very few people.
So cross-compiling is possible theoretically, but ...
...a major PITA, unless you use the proper tools.
Probably the easiest / most reliable way to do this.
Native or qemu-linux-user are the two build options we recommend,
Now if you develop slightly larger pieces of software, qemu-linux-user is not really an option (simply because it is very slow and time does matter) and native is slightly faster (if you have at least a Raspberry pi 3 class machine), but given that you can get lots of Intel x64 build power dirt cheap with many gigabytes of RAM and blazing fast storage, I'd go for cross compiling.
cross-compiling is mainly used for kernels.
Ever asked yourself why kernels are not compiled with qemu-linux-user? Cross-compiling kernels is pretty trivial though, the kernel is pretty self contained so you have very little problems with host->target contamination, no pkg-config search path confusion, include path problems, you name it. Try to cross-compile a large C++ project, or cross-build some python bindings if you want to have "Fun". -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org