fails to build on Big Endian 64 bit machines #714

Closed
LocutusOfBorg opened this Issue Jun 3, 2016 · 4 comments

Comments

Projects
None yet
2 participants

LocutusOfBorg commented Jun 3, 2016

Hi, as said, seems that

uint64_t finalcount = qFromLittleEndian( count << 3 );

on ripemd.cc is not available on 64 bit BE machines

build/ripemd.o: In function `unsigned long qFromLittleEndian<unsigned 
long>(unsigned long)':
/usr/include/qt4/QtCore/qendian.h:344: undefined reference to `unsigned long 
qbswap<unsigned long>(unsigned long)'
collect2: error: ld returned 1 exit status
Makefile:424: recipe for target 'goldendict' failed

can you please help? Note: this is preventing Debian and Ubuntu from having in stable the latest release/snapshot

LocutusOfBorg added a commit to LocutusOfBorg/goldendict that referenced this issue Jun 3, 2016

Fix Big Endian 64 bit machines build failures. (Closes: #714)
This should fix the s390x and sparc64 build failures
 Code inspired from av_bswap64 libavutil function
 Thanks Adam Conrad for the help!

build/ripemd.o: In function `unsigned long qFromLittleEndian<unsigned long>(unsigned long)':
/usr/include/qt4/QtCore/qendian.h:344: undefined reference to `unsigned long qbswap<unsigned long>(unsigned long)'
collect2: error: ld returned 1 exit status

Abs62 added a commit to Abs62/goldendict that referenced this issue Jun 3, 2016

Member

Abs62 commented Jun 3, 2016

Try to buid now.

LocutusOfBorg commented Jun 3, 2016

Hi, how can your solution work?

-  uint64_t finalcount = qFromLittleEndian( count << 3 );
+  quint64 finalcount = qFromLittleEndian( count << 3 ); 

the problem is that qFromLittleEndian doesn't take a 64byte parameter.
Do you want me to test your commit?

Member

Abs62 commented Jun 3, 2016

the problem is that qFromLittleEndian doesn't take a 64byte parameter

qendian.h have qbswap template for quint64 (defined as "unsigned long long" in qglobal.h) parameter but haven't it for uint64_t (defined as "unsigned long" on UNIX-like systems).

Do you want me to test your commit?

Yes.

working flawlessly!
the build has finished a few seconds ago. thanks!

@Abs62 Abs62 closed this Jun 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment