How can I cross-build CMake for a 32-bit Linux distribution? - cmake

I want to run a new version of CMake on a 32-bit Linux distribution; but - I need to build it from source, since Kitware no longer provides 32-bit builds (of recent versions). I have access both to 64-bit Linux distros and to the target machine.
What do I need to do in order to perform and deploy the cross-build?

Related

Buildroot toolchain for BBB: gclib version error

I was trying to cross-compile from a Debian PC for a BeagleBone Black, and i was able to build an "hello-world" sample, and build the wxWidgets, but when i compiled a wxWidgets app (the "minimal" sample) i failed, 'cause i've not been able to find how to get and link the needed libraries for armhf (GTK+, X11, etc... see my question here)
I've found a page explaining how to use BuildRoot to compile for a Raspberry, so i took that route and i was able to configure and make a "host" which compiled the wxWidgets first, and the "minimal" sample app next.
Problem is that on my BBB it does'nt run 'cause different gclib version
debian#beaglebone:~$ ./minimal
./minimal: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ./minimal)
debian#beaglebone:~$ ldd --version
ldd (Debian GLIBC 2.24-11+deb9u3) 2.24
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
So, i'm again bashing my head against a wall.
What options should i use in BuildRoot to be able to use the same gcc (and all the required libraries, which i don't know to what should i look) that are present in my BBB?
Linux version 4.9.88-ti-r111 (root#b9-am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP PREEMPT Sun Apr 22 08:04:34 UTC 2018
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
It sounds like you are building with one environment and running in a different environment.
That's akin to compiling on one distro and trying to run on another distro.
Or even compiling on one distro release and using another to run - e.g. Debian Jessie vs. Stretch.
Further evidence is that you mention:
BuildRoot as your build environment
debian#beaglebone and ldd (Debian GLIBC 2.24-11+deb9u3) 2.24
The fundamental version conflict is that BuildRoot and Debian 9 use different versions of libc (and other libraries)
The proper way to address this is by building inside a matching environment. In this case that would be Debian 9 - either as distro proper or at least as a chroot. The package that you should install is: crossbuild-essential-armhf
That will get you the necessary tool-chains and dependencies.

Are statically linked binaries built with gcc on Windows Linux Subsystem portable to all Windows systems?

I have Windows 10 with the Ubuntu userspace based on Windows Linux Subsystem, with the gcc package installed. Using gcc -static, I built a statically linked binary, hello, that the usual utilities describe as follows:
$ ldd hello
not a dynamic executable
$ file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=xxx, not stripped
If I take this executable to a random Windows system that doesn't have the Linux-supporting subsystem installed, will it still run?
No. It requires WSL to map Linux Kernel calls to Windows. Second it needs bash to load it since it's an ELF executable not a Windows one.

Linux or Windows version of a library in Cygwin?

I have developed some codes in Linux which use boost::serialization library. Now I want to copy my files into Cygwin and compile them to produce executable for Windows. I know that I should use Mingw-64 g++ compiler. But how about boost library? Should I download the Windows version or the Linux version of this library?
In Cygwin, you install Boost libraries as per Unix/Linux. From the documentation
Getting Started on Windows
A note to Cygwin and MinGW users
If you plan to use your tools from the Windows command prompt, you're in the right place.
If you plan to build from the Cygwin bash shell, you're actually running on a POSIX
platform and should follow the instructions for getting started on Unix variants.
Other command shells, such as MinGW's MSYS, are not supported—they may or may not work.

QT 5.7 linux 32 bit download

I have linux ubuntu 12.04 32bit version installed on my system. I wanted to installed QT 5.7. But I am not able to find any download link for linux 32 bit version of QT5.7.
Where can I find QT5.7 32bit download?
Starting from Qt 5.6.0, pre-built binaries for Linux 32bit is not provided anymore. You need to compile it yourself.
Source: https://blog.qt.io/blog/2016/02/23/qt-5-6-0-release-candidate-available/#comment-1197215

How to decide library install path on different linux systems?

Fedora have dynamic libs on /usr/lib64 and /usr/lib, for 64-bit and 32-bit libs separately; while 64-bit Debian install some 64-bit libraries on /usr/lib/x86_64-linux-gnu, but seems some 64-bit libs are still in /usr/lib.
This looks pretty messy. So when I write a cmake file for my project, how to decide the place for installing the compiled libs?
use GNUInstallDirs, it will do everything for you.