2025-06-20 13:33 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002415Spring engineGeneralpublic2011-05-09 19:37
Reporterjandd 
Assigned Toabma 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version0.82.7.1 
Target VersionFixed in Version 
Summary0002415: spring 0.82.7.1 fails to build with gcc 4.6.0
DescriptionHello,

Debian unstable uses g++ 4.6.0 to provide default g++ since April 29th. Apparently spring fails to build from source using this g++ version. Are you already working on support for g++ 4.6.0?
Additional Informationhttp://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625097
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon ftbfs-fix-625097.patch (1,775 bytes) 2011-05-03 18:06 -
    From: Jan Dittberner <jandd@debian.org>
    Subject: Patch for FTBFS with g++ 4.6.0
    Bug-Debian: http://bugs.debian.org/625097
    Bug: http://springrts.com/mantis/view.php?id=2415
    --- a/AI/Skirmish/E323AI/AAStar.h
    +++ b/AI/Skirmish/E323AI/AAStar.h
    @@ -4,6 +4,7 @@
     #include <queue>
     #include <vector>
     #include <list>
    +#include <cstddef> // for NULL
     
     class AAStar {
     	public:
    --- a/rts/Rendering/ShadowHandler.cpp
    +++ b/rts/Rendering/ShadowHandler.cpp
    @@ -318,6 +318,11 @@
     	xmid = 1.0f - (sqrt(fabs(x2)) / (sqrt(fabs(x2)) + sqrt(fabs(x1))));
     	ymid = 1.0f - (sqrt(fabs(y2)) / (sqrt(fabs(y2)) + sqrt(fabs(y1))));
     
    +	shadowParams.x = xmid;
    +	shadowParams.y = ymid;
    +	shadowParams.z = p17;
    +	shadowParams.w = p18;
    +
     	shadowMatrix[ 0] =   cross1.x / maxLengthX;
     	shadowMatrix[ 4] =   cross1.y / maxLengthX;
     	shadowMatrix[ 8] =   cross1.z / maxLengthX;
    --- a/rts/Rendering/ShadowHandler.h
    +++ b/rts/Rendering/ShadowHandler.h
    @@ -38,7 +38,7 @@
     	CMatrix44f shadowMatrix;
     	void CalcMinMaxView(void);
     
    -	const float4 GetShadowParams() const { return float4(xmid, ymid, p17, p18); }
    +	const float4& GetShadowParams() const { return shadowParams; }
     
     	enum ShadowGenProgram {
     		SHADOWGEN_PROGRAM_MODEL      = 0,
    @@ -76,6 +76,7 @@
     	//! to write the (FBO) depth-buffer texture
     	std::vector<Shader::IProgramObject*> shadowGenProgs;
     
    +	float4 shadowParams;
     	float x1, x2, y1, y2;
     	float xmid, ymid;
     	float p17, p18;
    --- a/rts/Rendering/GLContext.cpp
    +++ b/rts/Rendering/GLContext.cpp
    @@ -9,6 +9,7 @@
     #include "GLContext.h"
     
     #include <list>
    +#include <cstddef>  // for NULL
     
     
     using namespace std;
    --- a/rts/System/MemPool.h
    +++ b/rts/System/MemPool.h
    @@ -4,6 +4,7 @@
     #define _MEM_POOL_H_
     
     #include <new>
    +#include <cstddef> // for NULL
     
     const size_t MAX_MEM_SIZE=200;
     
    
    patch file icon ftbfs-fix-625097.patch (1,775 bytes) 2011-05-03 18:06 +

-Relationships
+Relationships

-Notes

~0006582

abma (administrator)

i reported this upstream: https://github.com/Error323/E323AI/issues/52

(as error is while compiling an ai not in the spring repo)

~0006583

hoijui (reporter)

i (most likely) fixed this, but...
it looks like it stopped compiling after the first file with errors, is that the case?
if so, it would be nice to have a compile log that would continue, to make sure there is not more that would fail to compile.

~0006584

abma (administrator)

http://springrts.com/phpbb/viewtopic.php?f=11&t=25885

~0006585

abma (administrator)

Last edited: 2011-05-03 10:01

i tried myself with gcc 4.6, engine compiles fine, but now i get these linker errors:

http://pastebin.com/JCTzW5xe

any idea about that? can't see an error here...

~0006586

hoijui (reporter)

Google search for LuaOpenGLUtils finds practically nothing:
http://www.google.com/#sclient=psy&hl=de&site=&source=hp&q=LuaOpenGLUtils&aq=&aqi=&aql=&oq=&pbx=1&fp=e26f07571d801bb9&biw=1164&bih=657

It is also not in spring source.

rts/Lua/LuaOpenGL.cpp:4369
there is a static, global function GetNamedMatrix. your linker seems to be missing a LuaOpenGLUtils::GetNamedMatrix ... no idea where it gets that class-name or namespace LuaOpenGLUtils from :/

It looks like AssParser.cpp is missing:
#include "3DModelLog.h"

~0006587

abma (administrator)

doh! after a clean build it worked... sorry

~0006588

jandd (reporter)

build continues with hoijui's patch but fails later:

Building CXX object rts/builds/default/CMakeFiles/engine-default.dir/__/__/Lua/LuaMaterial.cpp.o
cd /tmp/buildd/spring-0.82.7.1+dfsg1/obj-x86_64-linux-gnu/rts/builds/default && /usr/bin/g++ -DSYNCCHECK -DSPRING_DATADIR=\"/usr/share/games/spring:/usr/lib/spring\" -DSTREFLOP_SSE -g -O2 -msse -mfpmath=sse -fsingle-precision-constant -frounding-math -mieee-fp -pipe -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pthread -O2 -DNDEBUG -g -I/tmp/buildd/spring-0.82.7.1+dfsg1/rts/lib/lua/include -I/usr/include/SDL -I/tmp/buildd/spring-0.82.7.1+dfsg1/rts -I/tmp/buildd/spring-0.82.7.1+dfsg1/rts/System -I/usr/include/AL -I/usr/include/freetype2 -o CMakeFiles/engine-default.dir/__/__/Lua/LuaMaterial.cpp.o -c /tmp/buildd/spring-0.82.7.1+dfsg1/rts/Lua/LuaMaterial.cpp
/tmp/buildd/spring-0.82.7.1+dfsg1/rts/Lua/LuaMaterial.cpp: In member function 'void LuaMaterial::Execute(const LuaMaterial&) const':
/tmp/buildd/spring-0.82.7.1+dfsg1/rts/Lua/LuaMaterial.cpp:383:91: error: taking address of temporary [-fpermissive]

the build is done in a clean chroot containing just the build dependencies. According to https://bugs.launchpad.net/unity/+bug/745392 this seems to be related to new behaviour in g++ 4.6.0

~0006589

jandd (reporter)

seems to be related to http://springrts.com/phpbb/viewtopic.php?f=12&t=25559

~0006590

jandd (reporter)

I applied the attached patch to the 0.87.2.1 sources and could build a Debian package with g++ 4.6.0 in a clean Debian sid chroot.

~0006591

abma (administrator)

looks like i'm a bit confused these days, didn't see that you tried to compile the stable version.

@hoijui:
is it worth to apply that to 0.82.7.1? imo not...

~0006592

hoijui (reporter)

we would add this patch/commit it if we would do an other 0.82 release, which is unlikely. no need to add it now.

jandd... i guess, this LuaMaterial.cpp:383 error was only the next one, and it stopped compiling again after that?
i (most likely) fixed that one too now, but it would really be nice if you could get me the list of all errors, instead of one by one!

~0006594

jandd (reporter)

the LUAMaterial issue was fixed by the (rebased) patch in http://springrts.com/phpbb/viewtopic.php?f=12&t=25559

There were two more missing #include <cstddef> in rts/Rendering/GLContext.cpp and rts/System/MemPool.h

After these fixes (all included in my attached patch) the build went fine.

~0006623

hoijui (reporter)

i think spring master should now be fine for gcc 4.6.0.
could someone please check?

if so, i would say we can close this report, or would we have to do something about the patched 0.82.7.1 code as well, jandd?

~0006628

jandd (reporter)

I think it is sufficient if master is working fine so that I can drop the Debian patch for the next upstream release.

The full patch for 0.82.7.1 is available in our Debian git repo at http://git.debian.org/?p=pkg-games/spring.git;a=blob_plain;f=debian/patches/ftbfs-fix-625097.patch;hb=HEAD and everone who needs it can pull it from there.

I think it is not necessary to release a new 0.82.7.x version because of this issue.

~0006630

abma (administrator)

compiling spring/master works well with gcc 4.6

as noted, it won't be fixed in current stable.
+Notes

-Issue History
Date Modified Username Field Change
2011-05-02 15:35 jandd New Issue
2011-05-02 19:54 abma Note Added: 0006582
2011-05-02 20:44 hoijui Note Added: 0006583
2011-05-03 09:33 abma Note Added: 0006584
2011-05-03 09:48 abma Note Added: 0006585
2011-05-03 09:48 abma Note Edited: 0006585
2011-05-03 10:01 abma Note Edited: 0006585
2011-05-03 10:16 hoijui Note Added: 0006586
2011-05-03 10:27 abma Note Added: 0006587
2011-05-03 10:27 abma Status new => resolved
2011-05-03 10:27 abma Resolution open => fixed
2011-05-03 10:27 abma Assigned To => abma
2011-05-03 13:30 jandd Note Added: 0006588
2011-05-03 13:30 jandd Status resolved => assigned
2011-05-03 13:30 jandd Resolution fixed => reopened
2011-05-03 13:39 jandd Note Added: 0006589
2011-05-03 18:06 jandd Note Added: 0006590
2011-05-03 18:06 jandd File Added: ftbfs-fix-625097.patch
2011-05-03 18:45 abma Note Added: 0006591
2011-05-03 20:25 hoijui Note Added: 0006592
2011-05-03 20:34 abma Status assigned => confirmed
2011-05-03 20:34 abma Resolution reopened => open
2011-05-03 20:34 abma Summary spring fails to build from source using g++ 4.6.0 => spring 0.82.7.1 fails to build with gcc 4.6.0
2011-05-03 20:34 abma Assigned To abma =>
2011-05-03 21:08 jandd Note Added: 0006594
2011-05-09 11:54 hoijui Note Added: 0006623
2011-05-09 14:25 jandd Note Added: 0006628
2011-05-09 19:37 abma Note Added: 0006630
2011-05-09 19:37 abma Status confirmed => resolved
2011-05-09 19:37 abma Resolution open => fixed
2011-05-09 19:37 abma Assigned To => abma
+Issue History