cross-development – openSUSE Lizards https://lizards.opensuse.org Blogs and Ramblings of the openSUSE Members Fri, 06 Mar 2020 11:29:40 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.5 openSUSE and GCC part 1: getting started https://lizards.opensuse.org/2013/10/07/opensuse-and-gcc-part1/ Mon, 07 Oct 2013 08:41:01 +0000 http://lizards.opensuse.org/?p=9978 I try to explain in this series of blog entries how to install gcc (GNU C-Compiler) and what to do with it. I  also try to explain little make and CMake/Autotools. This is not very generic tutorial because I like to promote openSUSE as coding platform. Most of the tips goes just fine with every distro. For the first words I like to say one thing: openSUSE is excellent platform for C-coding. Though, you can choose your programming language  but this time I like to talk about GCC and specially C-Compiler. I’ll try to how to get there with these writings because I have noticed that this substance is getting less attention that it needs. Also noted that GCC anf GNU is 30 years and I have used it almost 15 so time to share some information.

openSUSE and Linux

This is for first timers with openSUSE and GCC not people who know how to use YaST and openSUSE. If you understand openSUSE is Linux-kernel based RPM application distribution in common language openSUSE is Linux operating system you shouldn’t be reading this it’s just waste of your time. If you are still reading you should understand  in deep openSUSE is GNU/Linux based operating system but let’s not get in to that battle.
So One can think Google Android as Google/Linux distribution (It’s also Linux say what you want). They took some tools from normal Linux distributions (there are common tools like GCC) and made rest from the scratch. Is it better or worst you have to choose that from you point of view.
If you come from BSD world for example Mac OS X or FreeBSD and have done some object-C or C (with or without command-line) you don’t have to forget everything just keep your mind open. If you popped just from Microsoft Windows world thought ‘hey I’ll start developing Linux/Android/Cross-platform apps.’ you REALLY have to keep you mind open. Hey I was on Windows decade a go and I’m still alive in Linux world in base Microsoft Windows is POSIX standard compliant like Linux.

Command-line (CLI) and Graphical User Interface (GUI)

All I’ll cover in these blog posts are Command-line examples. If you want to use IDE (Eclipse or such) go a head but I’ll like one to understand how everything really works. You don’t have to dream like those machines about cosmic electric sheeps to understand command-line. You can get there also in Microsoft Windows world and you don’t have to ever get there in Linux if you don’t want to. I’ll just feel little bit safer if you or me understand how to install and compile applications on Linux with command line. I won’t explain to you what is command-line (CLI) and how to get there from GUI (Graphical User Interface) where you probably are reading this from you browser please surf to read the Wikipedia article about it. If you didn’t understand anything what I just said you can blame me and take a break.

Install GCC on openSUSE

I assume that you have installed openSUSE. If not download and install version that have GUI. Do it if you aren’t PRO or have some very very very very good reason (like running it on virtual machine top of Windows then VMWare and Virtualbox are you way to go. Qemu works but you have be again very open minded).
But now you have running openSUSE system with nice KDE/Gnome/XFCE4/LXDE GUI look and If you were hacker you installed all you needed stuff when you installed openSUSE to hard drive. If you like me and didn’t keep reading. In openSUSE you can manage everything with YaST or you can choose the red pill and see the true world.

YaST way

open YaST from application menu. You find it there just look for Yast2Logo under settings. Type in root password. Choose ‘Software Management’. Now you can just type ‘gcc’ in ‘Find:‘ box. I’ll just assume you install ‘gcc‘ by clicking box (there comes green right mark) front of it and then push Apply. It’s easy as that. Now you have C-compiler (no C++ or ADA) but no auto-tools or make (or Cmake/Scons).

If you are on CLI you see NCurses based YaST:

gcc-blog1 gcc-blog2

pure CLI way without YaST

Go to CLI (Konsole/Gnome-terminal/xterm or in to real CLI). You have to be use ‘root’ or have sudo rights to do any wizardry that is explained here. So I assume you just are root just type

zypper install gcc

and answer ‘y’ after it asks. It does the same as YaST.

That is that for first blog. If everything went right Now you have Gnu C-Compiler available. next time I’ll explain what you can do with it.

Disclaimer: All the stuff here are my own opinions not openSUSE nor Linux community. I'm have used openSUSE or SuSE something over 10 years. I have made professionally many years of development with openSUSE so I know somethings but I don't know everything and I just try to get you along.

 

]]>
openSUSE@ARM/GSoC: Cross-compilation & speedup https://lizards.opensuse.org/2009/06/16/opensusearmgsoc-cross-compilation-speedup/ https://lizards.opensuse.org/2009/06/16/opensusearmgsoc-cross-compilation-speedup/#comments Tue, 16 Jun 2009 14:13:04 +0000 http://lizards.opensuse.org/?p=1282 This weeks topic was the integration of the cross-compilation mode into the build environment. But it’s more than just a cross-toolchain – it’s a speed-boost for our ARM build environment. As of today, the source is deployed in the repository Base:build:arm:cross. It’s not fully bootstrapped because of the current high load and the upcoming downtime – so watch out for changes there and in Base:build:arm.

But what are these “speedup’s” ? First, you’ve to know that in our build environment the ARM binaries are executed through an emulation-layer. This works on the cost of speed. The goal is now, to exchange some key parts in a transparent manner with native x86 binaries: no emulation, no slowdown. Sounds reasonable, but is it easily possible ?
I had to take care not to mix stuff too much because the environment would break. But now I’ve to say:  WOW, this worked incredibly well  😉 .

The distinctive feature of our approach in comparison to usual cross-build environments is that we use the best of native environment emulation and the speed of cross-compilation. Because of this combination we don’t have to patch the individual packages to make them cross-compilation ready. This is a new way of cross-compiling suitable also for large number of packages. A detailed overview about the different crossbuild types can be found on this page.
Another feature to note is that the exchanged binaries (replacing ARM with x86 in the build environment) also don’t need heavy patching and there’s no need to compile them as static binaries. All of them are normal distribution packages.

A switch in the project enables/disables the new features. With the new changes in place, the speed could be vastly increased. Some figures:
* package rpm
* package glibc w/o locales

Build time in minutes
x86 native armv5tel native armv5tel cross factor native factor cross
rpm 8 107 17 13,38 2,13
glibc 33 505 63 15,3 1,91

overview cross-environment

Thats a drop from about x15 to x2 in comparison to the native x86 build-time !! See it yourself when the “crosscompiled” repo in Base:build:arm is up and running.

In other words: “Warp 5, Mr. Sulu !” 😉

]]>
https://lizards.opensuse.org/2009/06/16/opensusearmgsoc-cross-compilation-speedup/feed/ 2