Jump to content


Photo

Error building 2.06 x64 on Linux


  • Please log in to reply
4 replies to this topic

#1 yochananmarqos

yochananmarqos

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 15 June 2018 - 10:20 AM

Manjaro Linux

gcc  8.1.1+20180531-1

scons  3.0.1-1

m4  1.4.18-1

subversion  1.10.0-2

mesa  18.1.1-1

libxxf86vm  1.1.4-2

openal  1.18.2-2

libxext  1.3.3-2

 

scons BUILD="release" TARGET_ARCH="x64":

idlib/math/Simd_SSE2.cpp: In member function ‘virtual void idSIMD_SSE2::NormalizeTangents(idDrawVert*, int)’:
idlib/math/Simd_SSE2.cpp:897:70: error: non-constant condition for static assertion
   static_assert(OFFSETOF(idDrawVert, normal) + sizeof(vertex.normal) == OFFSETOF(idDrawVert, tangents), "Bad members offsets");
                                                                      ^
idlib/math/Simd_SSE2.cpp:897:70: error: dereferencing a null pointer in ‘*0’
idlib/math/Simd_SSE2.cpp:897:70: error: dereferencing a null pointer in ‘*0’
idlib/math/Simd_SSE2.cpp:897:70: error: ‘((((long unsigned int)((int)((uintptr_t)(&0->idDrawVert::normal)))) + 12) == ((long unsigned int)((int)((uintptr_t)(&0->idDrawVert::tangents)))))’ is not a constant expression
idlib/math/Simd_SSE2.cpp: In member function ‘virtual void idSIMD_SSE2::DeriveTangents(idPlane*, idDrawVert*, int, const int*, int)’:
idlib/math/Simd_SSE2.cpp:1010:69: error: non-constant condition for static assertion
  static_assert(OFFSETOF(idDrawVert, normal) + sizeof(verts->normal) == OFFSETOF(idDrawVert, tangents), "Bad members offsets");
                                                                     ^
idlib/math/Simd_SSE2.cpp:1010:69: error: dereferencing a null pointer in ‘*0’
idlib/math/Simd_SSE2.cpp:1010:69: error: dereferencing a null pointer in ‘*0’
idlib/math/Simd_SSE2.cpp:1010:69: error: ‘((((long unsigned int)((int)((uintptr_t)(&0->idDrawVert::normal)))) + 12) == ((long unsigned int)((int)((uintptr_t)(&0->idDrawVert::tangents)))))’ is not a constant expression
scons: *** [build/scons_x64/release/core/idlib/math/Simd_SSE2.o] Error 1
scons: building terminated because of errors.
==> ERROR: A failure occurred in package().
    Aborting...

 



#2 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1017 posts

Posted 15 June 2018 - 11:35 AM

Any suggestion about how to get offset of a member in a struct in bytes, so that it is compile-time constant?



#3 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 1606 posts

Posted 15 June 2018 - 01:58 PM

Any suggestion about how to get offset of a member in a struct in bytes, so that it is compile-time constant?

Why is the asm code being compiled in x64 at all?

Don't we use generic math there?



#4 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1017 posts

Posted 15 June 2018 - 09:52 PM

Why is the asm code being compiled in x64 at all?

Don't we use generic math there?

It is not asm, it is my code with SSE instrinsics.

 

It seems that offsetof should solve the problem.



#5 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1017 posts

Posted 15 June 2018 - 11:52 PM

Fixed in svn rev 7478.

 

Of course, you can simply comment the problematic static_assert-s as a workaround.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users