My thoughts on Slackware, life and everything

Tag: gcc (Page 2 of 4)

What if gcc 7 gives you headaches?

In Slackware-current we use version 7.1.0 of the gcc compiler suite. These advanced compilers can sometimes be quite a bit more strict about what they accept as valid code. As a consequence, you will regularly run into compilation issues with software. Not just the software made with the scripts on slackbuilds.org, but also some of the software in the Slackware core distribution requires patches in order to get them to compile.

Until now, I have been lucky to find the patches I needed in the repositories of other distributions, or else developers patched their software themselves. But there will be corner cases where solutions and patches are not readily found, or the developers will simply not support gcc 7. Pale Moon is such a piece of software where the developers recommend compiling with gcc 4.x or as a last resort, gcc 5.

Also, the latest gcc compiler suite has dropped their Java compiler, it was no longer developed. So, no more gcc-java package. However if you want to bootstrap the OpenJDK compiler software, you need to start with a Java compiler. The openjdk developers recommend an already built OpenJDK package to compile a new release. But there may still be a case where you have to bootstrap that very first OpenJDK compiler.

So I took the old sources for gcc-5.4.0 which was part of Slackware-current for a while (11 August 2016 to 4 May 2017), and re-worked my gcc-multilib.SlackBuild script:

  • I renamed the package to “gcc5” so that it can be installed alongside Slackware’s gcc 7 packages
  • The binaries were given a suffix “-5” to make them stand apart from Slackware’s default compilers
  • All except the C, C++ and Java language compilers were removed
  • Only one all-encompassing package is built by the script
  • A profile script was added – you can ‘source’ it to activate the gcc-5 compilers as preferred compilers

The result is a gcc5-5.4.0 package – for Slackware-current, both 32bit and 64bit. Get them at http://www.slackware.com/~alien/slackbuilds/gcc5/ .

The 64bit package is a multilib version, but you can install it without issues on a pure 64bit system. You will just not be able to compile 32bit programs with it.

How to use these compilers?

Simple: in your console or terminal, you ‘source’ the provided profile script, like this (there’s a c-shell compatible script as well):

source /etc/profile.d/gcc5.sh

The command “source” is equivalent to the dot command ” . “. The profile script will (re-)define the common variables that are used by make and other programs to determine which binary to run as the compiler:

export CC=gcc-5
export CPP=cpp-5
export CXX=g++-5
export AR=gcc-ar-5
export NM=gcc-nm-5
export RANLIB=gcc-ranlib-5

So, all you have to do next is run your compile job as usual, in that same console or terminal. Nothing else needs to be done after sourcing the profile script. Your program will be compiled with the binaries provided by the gcc5 package.

I did limited testing:

  • With the above instructions, I ran my palemoon.SlackBuild script and it provided a package (whereas the gcc7 compiler in Slackware-current would cause the compilation to fail)
  • The provided gcj (GNU Java Compiler) was able to bootstrap the OpenJDK 7 sourcecode into a working binary package, which I could then use to compile OpenJDK 8 on slackware-current (OpenJDK 7 is the last release that can still be bootstrapped with the gcj compiler)

Hope this helps some people!

Eric

Some thoughts on the recent updates in Slackware-current

 Last week, a new LTS kernel (4.9.26), new glibc (2.25) and a new gcc compiler suite (7.1.0) landed in Slackware-current. Note that gcc no longer contains the Java compiler (gcj): subsequently Slackware’s gcc-java package has been removed from slackware-current.
We are at the head of the herd again folks. There is not yet any other distro that ships with the gcc-7 compiler by default. This will certainly pose some challenges for people who compile their stuff themselves – the SBo team warned their community about scripts that require patches to compile against gcc-7.

I have my set of challenges myself too… until now, I have not been able to compile the multilib versions of the gcc compiler suite. That’s infuriating, I can tell you. Specifically, I have issues with brig, gnat, go and objc compilers; the 7.1.0 versions of c and c++ compilers are just fine. I hope to resolve this soon-ish… until then, you will have to wait for new multilib compilers. If you really need a gcc 7.1.0 compiler (for instance, to compile a kernel module) I suggest that you (temporarily) switch to Slackware-current’s gcc 7.1.0 packages. Running your multilib system is of course not affected by this – gcc is only needed to compile stuff. I will probably release glibc-2.25_multilib packages ahead of the problematic gcc multilib packages to give you at least something.

Another interesting addition is lame. After the last Fraunhofer MP3 patent expired on 16 April 2017, the doors were opened to enable MP3 encoding support in Slackware. Several packages have been recompiled to take advantage of the new MP3 encoding capability (cdrdao, sox, ffmpeg, MPlayer, audacious-plugins) and the gstreamer packages were updated for good measure.

I have added ‘lame’ to the ‘massconvert32.sh‘ script of my compat32-tools package and updated the set of “compat32” packages in my multilib repository.

Rebuilt multilib gcc compiler suite for slackware-current

There were many updates for Slackware-current last night. One of them was a rebuilt gcc compiler suite, and therefore an updated multilib compiler set was due as well.

The new multilib gcc packages are now online, The set of 32-bit “compat32” packages for slackware64-current has also been refreshed. The gcc packages had to be rebuilt because of other package updates causing library version bumps, but Pat took the opportunity to add two shell scripts “c89” and “c99” that are part of POSIX standard – they call the compiler with additional compatibility parameters. This was necessitated by the fact that recent git checkouts of the VLC mediaplayer would not compile on Slackware because the VLC developers started enforcing a check on the availability of the “c99” command.

You can obtain the updated multilib packages from the URLs below or from any other mirror near you that carries copies of my repositories:

A refresher on “multilib” for new users of Slackware: if you want to use (binary-only) 32-bit software on a 64-bit Slackware installation then that is not possible out of the box, because Slackware64 is a pure 64-bit OS. You need to expand the OS with “multilib capability” so that the OS can run (and compile) 32-bit programs as well. Examples of 32-bit (closed-source) programs are Skype, Valve’s Steam Client, the WINE emulator, the Pipelight browser plugin, Citrix client etc.

Instructions on how to add or update multilib on your 64-bit Slackware can be found on the Slackware Documentation Project. Also, the slackpkg+ extension to Slackware’s own slackpkg contains the script “setupmultilib.sh” which can help you in setting up multilib properly. With slackpkg+ it is then trivial to keep your multilib installation up to date when updates occur.

Security tip:

One note on the side about last night’s Slackware -current update. The work on this update was supposed to take a while longer because Pat wants to update additional packages and a proper integration is important so that things don’t break due to library incompatibilities. But the update to the mozilla-firefox package addresses a serious and critical security issue. This security fix needed to get out to you people as fast as possible. The exploit (which was found in the wild by an attentive Firefox user and then reported to Mozilla) uses Firefox’s internal PDF viewer implementation to gain access to your local files, and uploads e.g. your ssh configuration and keys, the password file, pidgin and psi configuration files to a Russian server – pretty sensitive things.

If you have been using Firefox 38 or 39 (normal or ESR versions) on your Linux computer and visited dodgy sites recently, and you have ssh keys for accessing remote servers without a password, you may want to consider replacing these ssh keys with fresh ones.

Enjoy! Eric

Multilib gcc updated to address changes in slackware-current

slackware_multilib

In slackware-current two inter-related packages were updated yesterday: libmpc and gcc. It turns out that the update of libmpc caused a library version change. Since the gcc compiler is dynamically linked to libmpc, the gcc packages had to be recompiled in order to make it link against the new libmpc.so.3 library. Another reason for recompiling the gcc package was the missing libiberty.a file. The gcc.SlackBuild needed an additional configuration parameter to make it install into the package again.

Unfortunately that slackware-current update broke the multilib gcc packages which I have in my own repository, as several people noticed … the quick’n’dirty fix was (cd /usr/lib64 ; ln -s libmpc.so.3 libmpc.so.2).

I have recompiled the multilib gcc twice (after applying Slackware’s updates to the gcc-multilib.SlackBuild): first compilation was done with that symlink created like I just described. That resulted in the desired linkage to the new libmpc.so.3 library. Then I removed the symlink which I had created earlier and compiled the gcc packages again, just to be sure (for Slackware, this double compilation was performed as well).

The new gcc packages are now online, along with an update to the massconvert32.sh script which is part of the compat32-tools package. Also I refreshed the set of 32-bit “compat32” packages which I create from the official 32-bit Slackware package tree, because there were several updated packages in Slackware (again), and I added the libva-intel-driver-compat32 package on request.

Here is where you can find the updated packages:

If you wonder what this multilib is all about: it is needed if you want to use (binary-only) 32-bit software on 64-bit Slackware. Examples of that are Skype, Valve’s Steam Client, the WINE emulator, the Pipelight browser plugin, Citrix client etc.

Instructions on how to add or update multilib on your 64-bit Slackware can be found on the Slackware Documentation Project. Also, the slackpkg+ extension to Slackware’s own slackpkg contains the script “setupmultilib.sh” which can help you in setting up multilib properly.

 

Enjoy! Eric

PS: The nice graphic at the top was taken from the page http://gnu-linux-slackware.blogspot.nl/2013/01/switch-to-multilib-with-32-bit.html which is a Slackware related blog by Ismail.

Slackware-current – new multilib gcc compiler suite

The latest update to Slackware-current brought us a new kernel (3.14.5) and a new gcc compiler (4.8.3).

This warranted a build of new multilib gcc packages. Get them from your nearest mirror. I also refreshed the “compat32” layer of packages – this is the set of converted 32-bit Slackware packages which you’ll need at a minimum, so that you will be able to run most of the 32-bit software that is out there.

Remember, a multilib configuration is needed if you want to use binary-only 32-bit software on 64-bit Slackware – think of Valve’s Steam Client, the WINE emulator, the Pipelight browser plugin, Citrix client etc.

If you are looking for instructions on how to add or update multilib on your 64-bit Slackware, check out our Slackware Documentation Project which has this information and much more.

Cheers, Eric

 

« Older posts Newer posts »

© 2024 Alien Pastures

Theme by Anders NorenUp ↑