Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mumble should set a specific -std=c++XX instead of relying on the compiler default #2494

Closed
mkrautz opened this issue Aug 6, 2016 · 5 comments
Labels
build Everything related to compiling/building the code
Milestone

Comments

@mkrautz
Copy link
Contributor

mkrautz commented Aug 6, 2016

See also:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831184

@mkrautz mkrautz modified the milestones: 1.2.17, 1.3.0 Aug 6, 2016
@mkrautz
Copy link
Contributor Author

mkrautz commented Aug 6, 2016

Needs a 1.2.17 backport as well.

@davidebeatrici davidebeatrici added the build Everything related to compiling/building the code label Aug 6, 2016
@davidebeatrici
Copy link
Member

In MumblePAHelper I added CONFIG += c++11 in the project file.

@hacst
Copy link
Contributor

hacst commented Aug 6, 2016

So uh. Can we actually do c++11 for 1.3 now? I mean it has been quite a few years so maybe Linux isn't holding us back from that anymore. I think last time I checked we should be ok to do so on paper but I'm not sure if those compiler versions actually support C++11 in a non-broken way. I remember the first gcc versions saying they have "full support" shipping with quite broken library implementations....I don't remember the versions though.

EDIT: I take that back. I guess I was thinking about the experimental c++0x flag.
https://gcc.gnu.org/projects/cxx-status.html#cxx11 says GCC 4.8.1 was the first feature complete version with c++11. rhel 6 ships with 4.4.7, ubuntu 12.04 ships with 4.6.3 . I guess if we want to keep building on those it's c++03 for a few more years. No problem. rhel 6 is only supported till the end of 2020 /s .

TL;DR: I think we have to stick to c++03 for the time being. Imho at least till 12.04 LTS is no longer supported which is april next year.

@hacst
Copy link
Contributor

hacst commented Oct 21, 2016

I guess this would be resolved with #2582 ?

@mkrautz
Copy link
Contributor Author

mkrautz commented Oct 21, 2016

Yes

mkrautz added a commit to mkrautz/mumble that referenced this issue Oct 21, 2016
This is an offshoot of Debian bug #831184.
(See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831184)

Basically, G++6 now defaults to C++11 (or greater) mode.
We haven't explicitly passed a C++ standard C(XX)FLAG, so
until now, we've built against the g++/clang's default, which
until now was C++98 or C++03.

Now, Mumble itself doesn't really care what C++ mode it's built in.
We build fine in C++11 mode.

However, on Debian/Ubuntu, libraries such as ZeroC Ice
provide separate C++11 and C++03 .so's with different ABIs.
The default version in system's lib dir is the C++03 version,
but the ABI that is targeted when building with "g++ -lIce [...]"
(that is, without explicitly specifying a default C++ mode)
is the C++11 variant -- because G++6 defaults to C++11 mode.

This puts us in a situation where we have to *know* which C++
version we're built against, to be able to select the correct
Ice libraries on Debian/Ubuntu.

Debian's C++11 Ice libraries live in `/usr/lib/$TRIPLE/c++11`,
and the C++03 versions live in `/usr/lib/$TRIPLE/`.

(Actually, the C+11 libraries in `/usr/lib/$TRIPLE/c++11` are
symlinks to .so files in /usr/lib/$TRIPLE with a '++11'
suffix. Which makes sense: this way, /usr/lib/$TRIPLE/c++11 is
only a developer detail, and not part of the default library
search path of the system.)

This commit does a few things to patch things up:

 - We now explicitly pass a `-std=` flag to the compiler.
 - By default, we build with `-std=c++03`, but if
   CONFIG(c++11) is specified (either by being the default
   in modern Qt 5 versions, or explicitly via user action),
   we use `-std=c++11`.
 - When CONFIG(c++11) is specified, we ensure QMAKE_LIBDIR
   includes `/usr/lib/$TRIPLE/c++11` such that we link against
   the correct libraries.

Fixes mumble-voip#2494
mkrautz added a commit to mkrautz/mumble that referenced this issue Oct 22, 2016
This is an offshoot of Debian bug #831184.
(See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831184)

Basically, G++6 now defaults to C++11 (or greater) mode.
We haven't explicitly passed a C++ standard C(XX)FLAG, so
until now, we've built against the g++/clang's default, which
until now was C++98 or C++03.

Now, Mumble itself doesn't really care what C++ mode it's built in.
We build fine in C++11 mode.

However, on Debian/Ubuntu, libraries such as ZeroC Ice
provide separate C++11 and C++03 .so's with different ABIs.
The default version in system's lib dir is the C++03 version,
but the ABI that is targeted when building with "g++ -lIce [...]"
(that is, without explicitly specifying a default C++ mode)
is the C++11 variant -- because G++6 defaults to C++11 mode.

This puts us in a situation where we have to *know* which C++
version we're built against, to be able to select the correct
Ice libraries on Debian/Ubuntu.

Debian's C++11 Ice libraries live in `/usr/lib/$TRIPLE/c++11`,
and the C++03 versions live in `/usr/lib/$TRIPLE/`.

(Actually, the C+11 libraries in `/usr/lib/$TRIPLE/c++11` are
symlinks to .so files in /usr/lib/$TRIPLE with a '++11'
suffix. Which makes sense: this way, /usr/lib/$TRIPLE/c++11 is
only a developer detail, and not part of the default library
search path of the system.)

This commit does a few things to patch things up:

 - We now explicitly pass a `-std=` flag to the compiler.
 - By default, we build with `-std=c++03`, but if
   CONFIG(c++11) is specified (either by being the default
   in modern Qt 5 versions, or explicitly via user action),
   we use `-std=c++11`.
 - When CONFIG(c++11) is specified, we ensure QMAKE_LIBDIR
   includes `/usr/lib/$TRIPLE/c++11` such that we link against
   the correct libraries.

Fixes mumble-voip#2494

[Backported from master e99b0c9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Everything related to compiling/building the code
Projects
None yet
Development

No branches or pull requests

3 participants