gogglesmm icon indicating copy to clipboard operation
gogglesmm copied to clipboard

Gogglemm does not compile on big endian architectures

Open C0RD opened this issue 1 year ago • 3 comments

Hello, during the build of gogglesmm for Debian I found that it is not compiling on all architectures that are supported by Debian.

On these core architectures it failed:

  • armel https://buildd.debian.org/status/logs.php?pkg=gogglesmm&ver=1.2.5-1&arch=armel
  • s390x https://buildd.debian.org/status/logs.php?pkg=gogglesmm&ver=1.2.5-1&arch=s390x

All Builds can be found via the page https://buildd.debian.org/status/package.php?p=gogglesmm

C0RD avatar May 05 '24 19:05 C0RD

as i found that the build on these architectures failed when compiling libmad0 support I disabled it and came over a new error:

https://buildd.debian.org/status/fetch.php?pkg=gogglesmm&arch=s390x&ver=1.2.5-3%7Eexperimental2

  29 | #define MSB_UINT(data) (data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24)
      |                             ^
/<<PKGBUILDDIR>>/src/GMCover.cpp:66:26: note: in expansion of macro ‘MSB_UINT’
   66 |         info.width     = MSB_UINT(chunk+8);
      |                          ^~~~~~~~
compilation terminated due to -Wfatal-errors.
make[3]: *** [src/CMakeFiles/gogglesmm.dir/build.make:207: src/CMakeFiles/gogglesmm.dir/GMCover.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-s390x-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:434: src/CMakeFiles/gogglesmm.dir/all] Error 2
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-s390x-linux-gnu'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-s390x-linux-gnu'
dh_auto_build: error: cd obj-s390x-linux-gnu && make -j2 "INSTALL=install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:23: binary-arch] Error 25

all build logs can be found here: https://buildd.debian.org/status/package.php?p=gogglesmm&suite=experimental

C0RD avatar May 19 '24 19:05 C0RD

armel is building with LDFLAGS+=-Wl,--copy-dt-needed-entries will try that for sh4 architecture too.

The other build-failures seem to be related to Big Endian Architectures, so updating the title.

C0RD avatar May 20 '24 09:05 C0RD

I found a fix for Bigendian Builds on https://git.fern.garden/fern/void-packages/commit/18691bd7d2b7e3c8e67d9fbbc254a20cffb4b19d

--- a/src/GMCover.cpp
+++ b/src/GMCover.cpp
@@ -26,8 +26,8 @@
 #define MSB_UINT(x) ((x)[3]) | ((x)[2]<<8) | ((x)[1]<<16) | ((x)[0]<<24)
 #define MSB_SHORT(x) ((x)[0]<<8) | ((x)[1])
 #else
-#define MSB_UINT(data) (data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24)
-#define MSB_SHORT(data) (data[1]<<8) | (data[0])
+#define MSB_UINT(x) ((x)[0]) | ((x)[1]<<8) | ((x)[2]<<16) | ((x)[3]<<24)
+#define MSB_SHORT(x) ((x)[1]<<8) | ((x)[0])
 #endif

additionally the package needs to build without MAD.

C0RD avatar May 24 '24 15:05 C0RD