Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

use newer GCC without building it from source

Programming languages, Coding, Executables, Package Creation, and Scripting.
Message
Author
YaronCT
Posts: 17
Joined: 2016-01-28 08:49

use newer GCC without building it from source

#1 Post by YaronCT »

Hi,

I use Debian stable, and the newest GCC it seems to provide is 4.9. Is there any way I can use a newer one, even 5.3, without building it from source? For various reasons, I don't feel comfortable with building it from source. The only solution I've found so far is using GCC from Arch Linux in a virtual machine.

Plus, Is there any reason Debian doesn't provide newer GCC in its official stable repositories (even backports)? I understand it'll be less stable than 4.9, but if I understand it and willing to take the risk, it's important for me e.g. to use newer language or library features available only in newer GCC.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: use newer GCC without building it from source

#2 Post by dasein »

GCC is a compiler, a tool that is used to build software from source, which is something you say you're not comfortable doing.

Image

Since your question is a bit murky, here's a general tip: given that you're a fan of trendy software, Debian is absolutely the wrong distro for you. Arch FTW.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: use newer GCC without building it from source

#3 Post by tomazzi »

YaronCT wrote: Plus, Is there any reason Debian doesn't provide newer GCC in its official stable repositories (even backports)? I understand it'll be less stable than 4.9, but if I understand it and willing to take the risk, it's important for me e.g. to use newer language or library features available only in newer GCC.
Your knowledge about compilers is at best ... not sufficient (saying gently...)
There's at least one reason which is preventing stable operating system from switching to a newer version of a compiler: name mangling scheme for object-oriented languages. If You change the compiler version, then there's a high risk of breaking the compatibility between newly compiled programs and the existing dynamic libraries.

For this single reason (but there are much more other reasons) it would be extremely stupid to change the default compiler for a stable OS.

Should I say "Regards" in this case?
Odi profanum vulgus

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: use newer GCC without building it from source

#4 Post by stevepusser »

If you want Debian with gcc 5, run testing in that VM instead of Arch.
MX Linux packager and developer

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#5 Post by YaronCT »

tomazzi: who said anything about changing the default compiler? You can provide a newer compiler than can be installed along-side the default one. For example, if I'm not mistaken, Ubuntu 14.04 LTS's default compiler is GCC 4 but it also as GCC 5 in its repositories. I can't see how this can "break" the system.

dasein:

I know how to do "./configure && make && sudo make install" but GCC has many dependencies and configuration options, and a GCC I build myself is not something I'd feel comfortable to use for production build.

I don't want Arch because I want a stable basic system. I care little about the version of the kernel or Mate that I use. But I'm interested in new versions of some programs, mainly GCC.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: use newer GCC without building it from source

#6 Post by tomazzi »

YaronCT wrote:tomazzi: who said anything about changing the default compiler? You can provide a newer compiler than can be installed along-side the default one. For example, if I'm not mistaken, Ubuntu 14.04 LTS's default compiler is GCC 4 but it also as GCC 5 in its repositories. I can't see how this can "break" the system.
You said that - You want to use unstable compiler (instead of the default one) on a stable system, what will lead to unexpected bugs and undefined behaviour of various components.
Perhaps You need a newer gcc toolchain, f.e. to cross compile something in a virtualized environment (chroot)? - but that's a completely different story - and indeed You didn't said that.

Ubuntu is a mix of unstable, testing, stable and 3rd-party untested software - to be honest, I don't care about it. But You may of course install the so called "LTS" version - and there You are - problem solved.
YaronCT wrote:I know how to do "./configure && make && sudo make install" but GCC has many dependencies and configuration options, and a GCC I build myself is not something I'd feel comfortable to use for production build.
Oh really?
First check the list of bugs and regression in gcc 5.x, then tell me a story of how have You achieved production-class stable builds using an unstable compiler.
That would be really interresting...
Odi profanum vulgus

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#7 Post by YaronCT »

tomazzi: Debian stable currently uses GCC 4.9 by default, but also provides GCC 4.8 in its repositories. Can I understand from your arguments that the "extra" GCC 4.8 provided by Debian stable can't be considered stable because this system was built using, and was built to use, GCC 4.9?

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: use newer GCC without building it from source

#8 Post by tomazzi »

YaronCT wrote:tomazzi: Debian stable currently uses GCC 4.9 by default, but also provides GCC 4.8 in its repositories. Can I understand from your arguments that the "extra" GCC 4.8 provided by Debian stable can't be considered stable because this system was built using, and was built to use, GCC 4.9?
4.9 is essentially a bugfix release for 4.8 - they are fully compatible. Gcc 5.x is a new generation of this compiler - added support for many new features, what have caused a lot of critical regressions and many new bugs, but foremost, the binary interface of some gcc-supporting libs have changed.
Read the changelogs, bug reports or better mailing lists and don't play the fool.
Odi profanum vulgus

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: use newer GCC without building it from source

#9 Post by stevepusser »

For example, if I'm not mistaken, Ubuntu 14.04 LTS's default compiler is GCC 4 but it also as GCC 5 in its repositories.
A quick search can't find it: http://packages.ubuntu.com/search?keywo ... ection=all
MX Linux packager and developer

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#10 Post by YaronCT »

stevepusser: you're right, some1 has told me it was, and seems like he was mistaken. Sorry I hadn't checked it. However, seems like it does exists here (even GCC 5.3). It's not an official repository, but still I guess it's better than to build it yourself..

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: use newer GCC without building it from source

#11 Post by stevepusser »

You can experiment with adding that PPA, but I'd backup the system first, or do it in a sacrificial install. You'd be on your own concerning any problems that come up, since I really doubt that anyone else is going to duplicate your setup.
MX Linux packager and developer

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#12 Post by YaronCT »

stevepusser: How could installing it possibly damange my system? It's not as if I'd be upgrading an existing package to some unstable package. This package installs gcc-5 alongside the default gcc that comes with Ubuntu 14.04 LTS, it doesn't replace it. So I understand if using this compiler wouldn't produce a result as stable as the default compiler, but how can installing it possibly damange my system or its stability?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: use newer GCC without building it from source

#13 Post by GarryRicketson »

stevepusser: How could installing it possibly damange my system?
All though the question is addressed to "stevepusser".
And I can't come close to explaining the technical side of "how", it could:

https://wiki.debian.org/DontBreakDebian

"could" is not the same as deffinately will, but steves advice to back up everything that is important to you, is sound, good advice. It might not break your system imediately either, but from my own experience, using a package from another distro was not a good idea, in fact similar to you, I got the package from the ubuntu repos, I thought I was being real smart, ...Ok, before I switched to Debian, I had been using a software package, the name is not important, but it was on Xubunu (ubuntu), and when I switched to Debian, I discovered that particular package was not available in the Debian repos,.. so I added the url for the xubuntu repos, and was able to get the package, it seemed to install just fine, and worked ok, for a few weeks, then when some updates/upgrades for Debian were available, and I accepted them,..that is when everything "fell down", my "sand castle" fell down,... later when I came to this forum annd learned a little more about Debian, I have come to understand and know better.
In a nut shell , it is because all the packages "tie" together in many ways, the packages designed for Debian and a Debian system are put together in a way to install and run on Debian, and for the most part work fine. The packages designed and put together for Ubuntu, the same, everything is writtten in a way that is compatible with ubuntu, and usually install and work fine, on a Ubuntu system, Debian is not Ubuntu, Ubuntu is not Debian. A very advanced linux programmer perhaps can make the changes needed in for example, a ubuntu PPA or package, since the source code is available, and if the programmer understands and knows how things "tie" together in a Debian system,the libraries and all the depndencies, yes it is possible to modify the packages and make them work on any linux distro. Are you that advanced ?
Using a compiler, and compiling your own programs is interesting, and quite worth learning, but there is all ways the risk of the program "crashing" the entire system later on down the road, and more so when the programmer does not know much about the inner workings of the distro or particular system.
Installing the compiler might not damge the system, but the programs it compiles might,
"might" is "maybe",..not the same as deffinately or will, "stevepusser" is just saying it would be a good idea to make backups, and probably best to try this in a "safe" enviroment, like a VM, or on a separate computer, one that does not have anything important.
This is why I pretty much stay away from most of the stuff on "sourceforge" and other sites, there are to many "hot shot" programmers, that think they know everything, compile junk, try it on the same machine they compiled it on, then make it avialable , claiming "Oh yea, it works on any linux system " ," bla , bla"...and then it turns out it also works very well to crash a Debian system, or some other linux based distro system , and that is why it is best to stick with the repos for your specific distro.

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#14 Post by YaronCT »

tomazzi: Well, if you think I play the fool, I conclude from that that You don't think I'm really a fool, so I'll take that as a compliment.

For some reason I had the feeling you'd claim that GCC 4 to GCC 5 is a major jump so it's not possible. So let's look at history a bit. Old stable's default compiler is GCC 4.7. It also provides GCC 4.6 and 4.4, but not GCC > 4.7. Old old stable's default compiler is GCC 4.4. It also provides GCC 4.3, 4.2 and 4.1, but not GCC > 4.4. But, I guess, now you'll claim that GCC 4.7 is essentially a bugfix release of GCC 4.6, which is essentially a bugfix release of GCC 4.5, which is essentially a bugfix release of GCC 4.4, which is essentially a bugfix release of GCC 4.3, which is essentially a bugfix release of GCC 4.2, which is essentially a bugfix release of GCC 4.1, But even if all that were true, there's no reason why old old stable wouldn't provide GCC 4.5 / 4.6. So, I'm very sorry, but it seems like not providing a GCC newer then the default has been a Debian policy for a long time. What I'm trying to do here is change that policy, or b convinced that there's something here I'm missing, and that this is a bad idea. I understand that providing it in the official Debian repositories is problematic, but at least in an unofficial Debian repository.

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#15 Post by YaronCT »

Or in backports..

User avatar
thanatos_incarnate
Posts: 717
Joined: 2012-11-04 20:36

Re: use newer GCC without building it from source

#16 Post by thanatos_incarnate »

The safest bet would be a chroot environment with e.g. Testing or Unstable. That way you can log into a new sandboxed environment with all the new stuff you need without affecting the stable system or dual booting.
https://wiki.debian.org/chroot

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#17 Post by YaronCT »

GarryRicketson, stevepusser : I wasn't refering to using this Ubuntu repository in Debian, but to using it in Ubuntu. As u can see, there's a GCC 5.3 package there that was built especially for Ubuntu 14.04 LTS, so I don't see why installing it in this specific Ubuntu version should cause any problems. Of course, I take into account that an unofficial repository is less tested, but essentialy I think it should work without breaking the system.

So. what I'm saying is, I still don't see a reason why there shouldn't be a repository with newer GCC-s for Debian, and the fact that Ubuntu has such a repository strengthens my belief that it is indeed possible.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: use newer GCC without building it from source

#18 Post by GarryRicketson »

I wasn't refering to using this Ubuntu repository in Debian, but to using it in Ubuntu. As u can see, there's a GCC 5.3 package there that was built especially for Ubuntu 14.04 LTS, so I don't see why installing it in this specific Ubuntu version should cause any problems.
Oh, I thought you were using Debian, I think that is what steve thought also,.. being that this is "Debian User Forums".
Anyway, if your using Ubuntu, obviously there shouldn't be any problem using the packages and PPAs from their repos, but you might want to double check that on a Ubuntu forum, I don't know.

YaronCT
Posts: 17
Joined: 2016-01-28 08:49

Re: use newer GCC without building it from source

#19 Post by YaronCT »

GarryRicketson: No, acutlaly I do use Debian and I like it the best, and currently not considering switching to Ubuntu or any other (I've been there, and came back to Debian crawling..). I just brought Ubuntu as an example, and perhaps convince u ppl to have a similar repository for Debian..

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: use newer GCC without building it from source

#20 Post by Head_on_a_Stick »

YaronCT wrote:perhaps convince u ppl to have a similar repository for Debian..
Who is "u ppl"?

There are no Debian developers who visit this forum (AFAIK), hence the "Debian User Forums" ;)
deadbang

Post Reply