Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on Debian/m68k due to alignment issues #157

Closed
glaubitz opened this issue Oct 5, 2021 · 0 comments
Closed

Fails to build on Debian/m68k due to alignment issues #157

glaubitz opened this issue Oct 5, 2021 · 0 comments

Comments

@glaubitz
Copy link

glaubitz commented Oct 5, 2021

The zimg package fails to build on the m68k architecture in Debian due to the fact that the native alignment of this target is 16 bits despite being a 32 bits architecture.

Tail of build log:

libtool: compile:  g++ -DPACKAGE_NAME=\"zimg\" -DPACKAGE_TARNAME=\"zimg\" -DPACKAGE_VERSION=\"3.0.3\" "-DPACKAGE_STRING=\"zimg 3.0.3\"" -DPACKAGE_BUGREPORT=\"https://github.com/sekrit-twc/zimg/pulls\" -DPACKAGE_URL=\"https://github.com/sekrit-twc/zimg\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -I. -I./src/zimg -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -O2 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DNDEBUG -fvisibility=hidden -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -c src/zimg/depth/dither.cpp  -fPIC -DPIC -o src/zimg/depth/.libs/libzimg_internal_la-dither.o
libtool: compile:  g++ -DPACKAGE_NAME=\"zimg\" -DPACKAGE_TARNAME=\"zimg\" -DPACKAGE_VERSION=\"3.0.3\" "-DPACKAGE_STRING=\"zimg 3.0.3\"" -DPACKAGE_BUGREPORT=\"https://github.com/sekrit-twc/zimg/pulls\" -DPACKAGE_URL=\"https://github.com/sekrit-twc/zimg\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -I. -I./src/zimg -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -O2 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DNDEBUG -fvisibility=hidden -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -c src/zimg/depth/depth.cpp -o src/zimg/depth/libzimg_internal_la-depth.o >/dev/null 2>&1
src/zimg/depth/dither.cpp: In member function ‘virtual std::tuple<const float*, unsigned int, unsigned int> zimg::depth::{anonymous}::NoneDitherTable::get_dither_coeffs(unsigned int, unsigned int) const’:
src/zimg/depth/dither.cpp:177:76: error: requested alignment ‘12’ is not a positive power of 2
  177 |   static constexpr float table alignas(ALIGNMENT)[AlignmentOf<float>::value] = {};
      | 

Full log available here: https://buildd.debian.org/status/fetch.php?pkg=zimg&arch=m68k&ver=3.0.3%2Bds1-1&stamp=1631269317&raw=0

I haven't had the time yet to start looking into the issue, but a proper alignas() at the right place would certainly fix the issue. If you want to have a look at the issue yourself, see below for instructions on getting an emulated Debian/m68k environment.

To set up a QEMU-based m68k system, see: https://wiki.debian.org/M68k/QemuSystemM68k

To use an m68k qemu-user chroot, see: https://wiki.debian.org/M68k/sbuildQEMU

Ichunjo pushed a commit to Varde-s-Forks/zimg that referenced this issue Jan 4, 2022
sekrit-twc pushed a commit that referenced this issue Feb 25, 2022
Fix #157

(cherry picked from commit 6dcda35)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant