Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559472 - dev-games/ogre-1.9.0 does not build with gcc-5.2.0
Summary: dev-games/ogre-1.9.0 does not build with gcc-5.2.0
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
Depends on:
Blocks: gcc-5
  Show dependency tree
Reported: 2015-09-03 05:15 UTC by Sven Eden
Modified: 2015-09-03 18:33 UTC (History)
1 user (show)

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

Move the definition of the offending template to the header. (1.9.0-03_move_stowed_template_func.patch,2.48 KB, patch)
2015-09-03 05:15 UTC, Sven Eden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Eden 2015-09-03 05:15:09 UTC
Created attachment 410902 [details, diff]
Move the definition of the offending template to the header.

The build fails with:

cd /home/portage/dev-games/ogre-1.9.0-r1/work/ogre-1.9.0_build/Tools/MeshUpgrader && /usr/bin/cmake -E cmake_link_script CMakeFiles/OgreMeshUpgrader.dir/link.txt -
/usr/bin/x86_64-pc-linux-gnu-g++   -march=native -pipe -ggdb -O2 -ftree-vectorize  -msse -Wall -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wshadow -Wno-missing-field-initializers -Wno-long-long -Wno-unused-but-set-parameter   -Wl,-O1 -Wl,--as-needed CMakeFiles/OgreMeshUpgrader.dir/src/main.cpp.o  -o ../../bin/OgreMeshUpgrader  -L/usr/lib64/x86_64-linux-gnu -rdynamic ../../lib/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ -lpthread -ldl /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ /usr/lib64/x86_64-linux-gnu/ -lz -latomic -Wl,-rpath,/home/portage/dev-games/ogre-1.9.0-r1/work/ogre-1.9.0_build/lib:/usr/lib64/x86_64-linux-gnu: 
../../lib/ undefined reference to `void Ogre::ProgressiveMeshGenerator::addIndexDataImpl<unsigned short>(unsigned short*, unsigned short const*, std::vector<Ogre::ProgressiveMeshGenerator::PMVertex*, Ogre::STLAllocator<Ogre::ProgressiveMeshGenerator::PMVertex*, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > >&, unsigned short)'
collect2: error: ld returned 1 exit status
Tools/MeshUpgrader/CMakeFiles/OgreMeshUpgrader.dir/build.make:96: recipe for target 'bin/OgreMeshUpgrader' failed
make[2]: *** [bin/OgreMeshUpgrader] Error 1

The reason is, that the ProgressiveMeshGenerator::addIndexDataImpl() template is only declared in the header, but defined in the compilation unit.

Normally this would be fine, but the instantiations (one for short int, one for int) are used in the compilation unit for the QueuedProgressiveMeshGenerator, which is no longer legal.

Each instantiation must be done in place, so the definition must be moved to the header.

I have created a patch to build ogre-1.9.0 successfully on gentoo. It simply covers the definition in OgreMain/src/OgreProgressiveMeshGenerator.cpp with #if 0/#endif and adds the definition to OgreMain/include/OgreProgressiveMeshGenerator.h so it becomes visible to OgreMain/src/OgreQueuedProgressiveMeshGenerator.cpp.

The attached patch fixes this.

I have applied the patch to my ebuild dev-games/ogre-1.9.0-r3 - available from my overlay 'seden' via layman.
Comment 1 Sven Eden 2015-09-03 05:29:26 UTC
I have reported this upstream:
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2015-09-03 18:33:35 UTC
in portage.  thanks for the bug report and patch.