Whether it would be fair to expect, that the Debian libc6-dev package work, on an ARM-64 CPU-based device.

One of the facts which I had posted about before was, that I had installed Debian 10 / Buster on a Google Pixel C Tablet, not because that tablet has any special properties, but just to document that with that one specific configuration, the solution ‘works’. And I had gotten to the subject of wanting to install ‘libc6-dev’, which would normally install Development Libraries, on top of Run-Time Libraries, with the ultimate intention of being able to compile or custom-compile C or C++, from in front of this ARM-64 -CPU Device, for use on the same device. And even one major Debian Update later, from 10.0 to 10.1, this facility still doesn’t work.

What I’d like to comment is the idea, that this is not a fair expectation, and that the naming of these packages cannot always be expected to remain canonical. What this expectation would assume is that the general-purpose GNU Compiler will work, even though that compiler is highly optimized for targeting code that runs, either on ‘amd64′ or ‘i386′ architecture, in that order.

If the goal really was, to compile code from in front of an ARM-64 -based machine, to run on it, then a compiler would need to be selected which is meant to target the ARM-64 CPU, and this might involve installing the correct cross-compiler, even though it’s to be executed on an ARM-64. The fact that an ARM-64 version of ‘libc6-dev’ is available, really just stems from the rather nonsensical idea, that the compiler using it should run on an ARM-64, but that the linked code should not.

And then, if one has installed the correct cross-compilers, because those packages are available in ‘arm64′ versions, they will run in spite of being named cross-compilers, and then installing them will also pull in the correct development libraries. Only then, in order actually to compile anything, one would need to specify yay-long commands from the command-line. And the main reason I’ll have none of this, is the simple fact that entering many non-standard ASCII characters using an Android-oriented keyboard, does not appeal to me for the moment.

This is similar to why I don’t install ‘Web-development software’, that is compiled and available from the repositories, but that would require a long sequence of special characters to be typed in, in order to allow any sort of Web-development. And it remains consistent with having LibreOffice installed, where what gets typed, is consistent with the English language, just as what the Google Pixel C’s OEM Keyboard offers, is…

There’s an added level of weirdness that would result, if somebody was just to write and compile C or C++ to run on an ARM-64 CPU in that way: The resulting binary wouldn’t be Android-compatible. It would assume that the O/S is Linux, but with an ARM-64 CPU, just like the Guest System. Writing Android-compatible code would require, that the ‘Android Development Kit’ be installed. Due to cross-compiling by the Debian package maintainers, there just might be ‘arm64′ packages of that available, but again, with no further guarantee that it all works…


 

(Update 9/08/2019, 10h20 : )

Unfortunately, this recognition does not negate the fact, that the way certain packages have been compiled to run on an ARM-64 CPU, still contain a bug…

Continue reading Whether it would be fair to expect, that the Debian libc6-dev package work, on an ARM-64 CPU-based device.

Compatibility GCC Installed

One of the more frustrating facts about Debian / Stretch is that its maintainers have broken with tradition, by no longer providing any compatibility versions of the main compilers, GCC, CPP and C++, which provide CC and C++ -language support, useful in 90% (+) of all programming that takes place. Instead, Debian / Stretch provides GCC / CPP / C++ version 6.3 alone. What I had already written about was, that the version of the CUDA Run-Time and Toolkit available from the standard repositories, has remained v8.0.44 for the time being. This CUDA Version does not support CC or C++ version 6 because version 6 of these compilers is too high!

One way in which power-users could try to remedy this situation would be, to install some sort of compatibility version of CC / C++, even though none is offered in the standard repositories. But, when we try to custom-compile let’s say, GCC v5.3, which would already be low enough for CUDA 8.0.44 to support, we find that GCC 6.3 is just plain unable to compile GCC 5.3, no matter what.

And so another way to solve the same problem can be, to add the old Debian Jessie / Oldstable repositories to our sources list, and then just to install from there.

I find this to be an extremely bad idea.

First of all, Debian differs from Ubuntu, in that Debian never provided GCC 5.3. In Debian / Jessie, what we got was GCC 4.8, or maybe even v4.9. But more importantly, simply sandwiching two incompatible repositories together can create a fatal set of problems.

What I was finally able to do, was just to download roughly a dozen packages as binaries, from the Debian Repository Web-site, which finally provided GCC, CPP and C++ v4.8. The path I took required that I run into the error message numerous times that dependencies could not be satisfied, because under Debian, neither ‘/usr/bin/gcc’ nor ‘/usr/bin/c++’ are provided by a single, binary package. Each is provided by packages, that depend uniquely on other packages, that are also not in the repositories.

Further, once the power-user has in fact installed binaries, after making sure that none of their file-names overlap, he must also create a system of Debian Alternatives, that allow him to switch between compilers easily. The problem with that is the fact that because, under Debian / Stretch, no provision was ever made by Package Maintainers for alternatives to exist, automatic mechanisms have also not been provided, to install ‘Link Groups’. The Link Groups ‘cc’, ‘cpp’ and ‘c++’ exist, but only in such a way as to provide one executable each.

As I was doing my best to install the Link Groups, I made a mistake, which simply over-wrote ‘/usr/bin/gcc’ with a different symlink, and which therefore forced me to (1) delete the link-group, and (2) reinstall GCC 6.3 from the package manager. After that, a new attempt to set up the link-groups succeeded:

 


dirk@Phosphene:~$ su
Password: 
root@Phosphene:/home/dirk# update-alternatives --config cc
There are 2 choices for the alternative cc (providing /usr/bin/cc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-6     20        auto mode
  1            /usr/bin/gcc-4.8   10        manual mode
  2            /usr/bin/gcc-6     20        manual mode

Press  to keep the current choice[*], or type selection number: 
root@Phosphene:/home/dirk# update-alternatives --config cpp
There are 2 choices for the alternative cpp (providing /usr/bin/cpp).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/cpp-6     20        auto mode
  1            /usr/bin/cpp-4.8   10        manual mode
  2            /usr/bin/cpp-6     20        manual mode

Press  to keep the current choice[*], or type selection number: 
root@Phosphene:/home/dirk# update-alternatives --config c++
There are 2 choices for the alternative c++ (providing /usr/bin/c++).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/g++-6     20        auto mode
  1            /usr/bin/g++-4.8   10        manual mode
  2            /usr/bin/g++-6     20        manual mode

Press  to keep the current choice[*], or type selection number: 
root@Phosphene:/home/dirk# exit
exit
dirk@Phosphene:~$ 

 

Note: The first link above, named ‘cc’, has a corresponding slave-link named ‘gcc’, thereby forming the only real ‘Link Group’. The others are just plain Links.

I am reasonably certain that none of these link-groups are broken. But what my reader should be able to infer from what I’ve written, is that It would be a hare-brained attempt, to duplicate what I’ve done, entirely based on this blog posting.

(Edit 5/03/2019, 11h45 : )

Just to prove how hare-brained this idea really is, I just uninstalled the alternative compilers, and replaced them with the GCC / CPP / C++ tool-chain, version 4.9, and made that part of the update-alternatives system as above! :-) (:3)

(End of Edit.)

So what does this provide me with (hopefully)?

(Updated 5/02/2019, 12h15 … )

Continue reading Compatibility GCC Installed