LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-08-2020, 06:13 AM   #1
reclusivewriter
Member
 
Registered: Jun 2014
Location: Midwest, USA
Distribution: Slackware
Posts: 80

Rep: Reputation: 55
GCC 9.2 for Slack 14.2


I don't know if anyone else will find this useful, but I thought it was cool.

I play correspondence chess on the ICCF, and for that, the latest tools are a must. SBo only has Stockfish 11 because 12 won't build with 14.2's toolchain, and while I could just use the binaries provided by the project, and I was for a while, I decided I wanted to build it optimized for my system. I had just decided to upgrade to current when I tripped over this:

https://mirror.math.princeton.edu/pu...lackware-14.2/

Binaries and source/SlackBuilds for GCC 9.2! I figured why not and upgraded with those packages and voila! Stockfish 12 built like a dream. Scid 4.7 (the original, not Scid_vs_PC) was another program in the same boat, so I tested it with that and voila again!

I'm sure there's a good reason why this isn't a good idea, but for what I needed it for it worked a treat. So if there's anyone else that needs to build a newer version of a program that won't build on stock 14.2, maybe this will hold you over until we get Slack 15.

The usual YMMV and no warranties expressed or implied, and maybe everyone else already knew this, but I'm always the last one to know.
 
Old 10-08-2020, 06:33 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
I use these GCC 9.2.0 compilers on Slackware 14.2 a lot, every time when I need to compile new Chromium or LibreOffice packages.
Note that your resulting binaries may inherit a dependency on the GCC 9 runtime, which means you can not run your self-compiled program on a Slackware computer that still has the default GCC 5 runtime installed.
For LibreOffice I solved this problem by shipping a copy of the GCC 9.x runtime libraries inside the libreoffice package and ensured that LibreOffice prefers these over the defaults on the Slackware 14.2 system.
Chromium does not have that dependency on GCC runtime.
 
5 members found this post helpful.
Old 10-09-2020, 02:39 AM   #3
zakame
Member
 
Registered: Apr 2012
Location: Philippines
Distribution: Debian, Ubuntu, Slackware
Posts: 295

Rep: Reputation: 181Reputation: 181
Another option for getting a newer gcc might be to use Nix for alternate environments (which also comes with its own later glibc and other tools.) OTOH this might be too foreign for most Slackers to be comfortable with, but could still be useful if you don't want to resort to containers or VMs:

Code:
[zakame:~] % gcc -v                   
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/5.5.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/5.5.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../gcc-5.5.0/configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,go,java,lto,objc --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --with-python-dir=/lib64/python2.7/site-packages --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=gcc4-compatible --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --disable-install-libiberty --with-gnu-ld --verbose --enable-java-home --with-java-home=/usr/lib64/jvm/jre --with-jvm-root-dir=/usr/lib64/jvm --with-jvm-jar-dir=/usr/lib64/jvm/jvm-exports --with-arch-directory=amd64 --with-antlr-jar=/tmp/slackware64-14.2/gcc/antlr-runtime-3.4.jar --enable-java-awt=gtk --disable-gtktest --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
gcc version 5.5.0 (GCC) 

[zakame:~] % nix-shell -p stdenv

[zakame:~] % gcc -v     # this is a new sub-shell using Nix toolchain
Using built-in specs.
COLLECT_GCC=/nix/store/rclksjxdjgp6y6qkxyl9m4dx4b9d45zk-gcc-9.3.0/bin/gcc
COLLECT_LTO_WRAPPER=/nix/store/rclksjxdjgp6y6qkxyl9m4dx4b9d45zk-gcc-9.3.0/libexec/gcc/x86_64-unknown-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: 
Thread model: posix
gcc version 9.3.0 (GCC)

[zakame:~] % exit       # back to Slackware 14.2's toolchain
[zakame:~] %
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
step 5.10 gcc/limitx.h gcc/glimits.h gcc/limity.h no such file or directory iambrj Linux From Scratch 7 08-07-2018 11:22 AM
LXer: GCC 4.9 vs. GCC 5.1 vs. GCC 6.0 SVN Compiler Benchmarks LXer Syndicated Linux News 0 06-08-2015 01:00 PM
[SOLVED] SEGMENTATION FAULT using gcc 4.4.4 -O2 , works with gcc 4.1.0 -O2 or gcc 4.4.4 -O1 amir1981 Programming 36 07-26-2010 06:07 PM
Installing GCC 3.1 over GCC 2.96...? aaronluke Linux - General 3 09-27-2002 05:28 AM
Need to go from gcc-2.96-xx to gcc-2.95.2 Borkowski Linux - Software 4 09-24-2001 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration