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

Fix LTO with GCC 4.9 #337

Merged
merged 1 commit into from Jun 7, 2014
Merged

Fix LTO with GCC 4.9 #337

merged 1 commit into from Jun 7, 2014

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented May 3, 2014

For LTO to work, GCC 4.9 requires using the wrappers gcc-ar and gcc-ranlibs:
http://gcc.gnu.org/gcc-4.9/changes.html

CMake doesn't account for this yet:
http://public.kitware.com/pipermail/cmake-developers/2014-January/009344.html

For LTO to work, GCC 4.9 requires using the wrappers gcc-ar and gcc-ranlibs:
http://gcc.gnu.org/gcc-4.9/changes.html

CMake doesn't account for this yet:
http://public.kitware.com/pipermail/cmake-developers/2014-January/009344.html
@magumagu
Copy link
Contributor

magumagu commented May 3, 2014

Do we need to check the gcc version?

@Tilka
Copy link
Member Author

Tilka commented May 3, 2014

No, unless you want to support GCC versions older than 4.7. I usually take Debian stable as a baseline (see Debian buildslave).

@magumagu
Copy link
Contributor

magumagu commented May 3, 2014

Okay; just wanted to make sure you considered it.

@Sonicadvance1
Copy link
Contributor

Causes build to fail with GCC 4.8.1

@Tilka
Copy link
Member Author

Tilka commented May 11, 2014

As discussed on IRC:

Ubuntu saucy's gcc package doesn't add a gcc-ar --> gcc-ar-4.x symlink. My response would be to just accept the fact that LTO is (currently) broken on saucy (it's fixed in trusty).

@Sonicadvance1
Copy link
Contributor

If it's Ubuntu failing then I have no reason to not say LGTM.

@Tilka
Copy link
Member Author

Tilka commented May 18, 2014

@sheepdestroyer: Does it compile without ccache or with an empty cache? Either way, can you compile with make -j1 V=1 so we can see the command line that fails? Please paste that somewhere to keep this PR readable (I shortened your comment a bit).

@sheepdestroyer
Copy link

[sheepdestroyer@sheepora Build]$ ccache -C
Cleared cache
[sheepdestroyer@sheepora Build]$ make -j 1 V=1
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_decode.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_groups.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/resolve.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/syntax.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/PowerPCDisasm.cpp.o
Linking CXX static library libbdisasm.a
/usr/bin/ar terminated with signal 11 [Segmentation fault], core dumped
make[2]: *** [Externals/Bochs_disasm/libbdisasm.a] Error 1
make[1]: *** [Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/all] Error 2
make: *** [all] Error 2
[sheepdestroyer@sheepora Build]$ 

@Tilka
Copy link
Member Author

Tilka commented May 18, 2014

What happens when you don't use ccache but use GCC directly?

@sheepdestroyer
Copy link

[sheepdestroyer@sheepora Build]$ export CCACHE_DISABLE=1
[sheepdestroyer@sheepora Build]$ ccache -C
Cleared cache
[sheepdestroyer@sheepora Build]$ make clean
[sheepdestroyer@sheepora Build]$ CCACHE_DISABLE=1 make -j 1 V=1
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_decode.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_groups.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/resolve.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/syntax.cpp.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/PowerPCDisasm.cpp.o
Linking CXX static library libbdisasm.a
/usr/bin/ar terminated with signal 11 [Segmentation fault], core dumped
make[2]: *** [Externals/Bochs_disasm/libbdisasm.a] Error 1
make[1]: *** [Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/all] Error 2
make: *** [all] Error 2

is there a better way to do it?

@Tilka
Copy link
Member Author

Tilka commented May 18, 2014

Sorry, it's make -j1 VERBOSE=1. Can you try again?

@sheepdestroyer
Copy link

@Tilka
Copy link
Member Author

Tilka commented Jun 3, 2014

@sheepdestroyer: No idea, have you tried it completely without ccache? Just use a different build directory.

Native CMake support is kinda stalled: http://public.kitware.com/pipermail/cmake-developers/2014-January/009344.html

@sheepdestroyer
Copy link

ran it again from a new folder with CCACHE_DISABLE=1 make -j1 VERBOSE=1 but with same result :
http://pastebin.com/2mNFqNeK

@Tilka
Copy link
Member Author

Tilka commented Jun 4, 2014

@sheepdestroyer You're still calling ccache, you probably need to unset CC; unset CXX.

@sheepdestroyer
Copy link

It was not ccache but a bug with binutils, this post from someone with a similar error put me on it :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53831

My system originally had binutils 2.24.14 and after building binutils 2.24.51 from git I can now successfully build and run dolphin with gcc 4.9 and lto

Sonicadvance1 added a commit that referenced this pull request Jun 7, 2014
@Sonicadvance1 Sonicadvance1 merged commit b7519fd into dolphin-emu:master Jun 7, 2014
@Tilka Tilka deleted the lto branch June 7, 2014 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants