Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330067 - C++ applications break when switching compiler
Summary: C++ applications break when switching compiler
Status: RESOLVED DUPLICATE of bug 297685
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-27 12:59 UTC by Łukasz Michalik
Modified: 2010-07-27 18:24 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Michalik 2010-07-27 12:59:53 UTC
When switching compiler to a lower version, pretty much everything that uses more elaborate features break.  Example:

bianor ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-4.3.4 *
 [2] x86_64-pc-linux-gnu-4.4.3
bianor ~ # gcc-config x86_64-pc-linux-gnu-4.4.3
 * Switching native-compiler to x86_64-pc-linux-gnu-4.4.3 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                     [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile

bianor ~ # . /etc/profile
bianor ~ # cat t.cc
#include <iostream>
#include <mutex>

int main()
{
  try
    {
      throw std::lock_error();
    }
  catch (const std::exception & e)
    {
      std::cout << e.what() << std::endl;
    }
}
bianor ~ # g++ t.cc -o t -std=gnu++0x
bianor ~ # ./t 
std::lock_error
bianor ~ # gcc-config x86_64-pc-linux-gnu-4.3.4
 * Switching native-compiler to x86_64-pc-linux-gnu-4.3.4 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                     [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   # source /etc/profile

bianor ~ # . /etc/profile
bianor ~ # ./t 
./t: /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./t)
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-27 14:44:35 UTC
It's not really something we can fix, it is a very well-known phenomenon...
Comment 2 Łukasz Michalik 2010-07-27 16:04:47 UTC
(In reply to comment #1)
> It's not really something we can fix, it is a very well-known phenomenon...
> 

Well, I'm assuming it could somehow be fixed, as it is working on other distributions, notably on debian, which I can use as an example.  Using same snippet:

(#:~)- g++ -v 2>&1 | grep 'gcc version'
gcc version 4.3.2 (Debian 4.3.2-1.1) 
(#:~)- g++-4.4 t.cc -std=gnu++0x -o t
(#:~)- ./t                        
std::lock_error

As you can see, system compiler is set 4.3, but I can compile *and* run 4.4 stuff.
Comment 3 Łukasz Michalik 2010-07-27 16:06:34 UTC
Reopening, as it haven't even been assigned to appropriate team.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2010-07-27 17:30:53 UTC
I think flameeyes was speaking for the appropriate team...
Comment 5 SpanKY gentoo-dev 2010-07-27 18:24:37 UTC

*** This bug has been marked as a duplicate of bug 297685 ***