[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Question about Architecture of xbyak



Hi all!

I have a question about what I should set in the Architecture field of the xbyak[1] package.

Xbyak is a header-only library that implements a JIT assembler for x86 architectures.

Since it can be only *used* on amd64, x86 and x32, I've always set the Architecture to "any", explicitly enumerated the architectures where the package can be used.

This approach though leads to three packages which almost have the exact same contents, since there's nothing to build. The only difference is in the pkg-config and CMake config files are installed; they get installed in the arch-specific /usr/lib subdirectory:

   $ dpkg --listfiles libxbyak-dev
   /.
   /usr
   /usr/include
   /usr/include/xbyak
   /usr/include/xbyak/xbyak.h
   /usr/include/xbyak/xbyak_bin2hex.h
   /usr/include/xbyak/xbyak_mnemonic.h
   /usr/include/xbyak/xbyak_util.h
   /usr/lib
   /usr/lib/x86_64-linux-gnu
   /usr/lib/x86_64-linux-gnu/cmake
   /usr/lib/x86_64-linux-gnu/cmake/xbyak
   /usr/lib/x86_64-linux-gnu/cmake/xbyak/xbyakConfig.cmake
   /usr/lib/x86_64-linux-gnu/cmake/xbyak/xbyakConfigVersion.cmake
   /usr/lib/x86_64-linux-gnu/pkgconfig
   /usr/lib/x86_64-linux-gnu/pkgconfig/xbyak.pc
   /usr/share
   /usr/share/doc
   /usr/share/doc/libxbyak-dev
   /usr/share/doc/libxbyak-dev/changelog.Debian.gz
   /usr/share/doc/libxbyak-dev/changelog.gz
   /usr/share/doc/libxbyak-dev/copyright

Nonetheless, even the files stored in the arch-specific directories are equal across architectures:

   $ cat /usr/lib/x86_64-linux-gnu/pkgconfig/xbyak.pc
   prefix=/usr
   includedir=${prefix}/include
Name: xbyak
   Description: JIT assembler for x86(IA32), x64(AMD64, x86-64)
   URL: https://github.com/herumi/xbyak
   Version: 7.05
   Cflags: -I${includedir}

By making the package "Architecture: any-amd64 any-i386", while redundant, I can be sure that cross builds work fine and doesn't get misused. For example, if I'm on arm64 I cannot install libxbyak-dev and use it to build an arm64 binary, but I can cross build an i386 binary by installing libxbyak-dev:i386.

Would this still be the case if I made the package "Architecture: all"? I believe you could still cross-build, since the package would be valid on all architectures, but I could also use it to build an e.g. native arm64 binary, leading to build failures.

I'm asking this now because in the latest upstream releases a Fedora contributor modified the build system to install pkg-config files into the arch-independent directory, /usr/share/pkgconfig. You can find the two relevant patches (and discussion) here:

- <https://github.com/herumi/xbyak/pull/186/commits> (be sure to read the commit messages)
- <https://github.com/herumi/xbyak/pull/187>

Should I proceed with making libxbyak-dev an "Architecture: all" package, or should I revert the upstream change? If so, should I double down on this, by also installing the headers themselves in arch-specific subdirectories of /usr/include?

If you believe this discussion should be moved to another list, like debian-devel, feel free to do so :)

Bye!

[1]: https://tracker.debian.org/pkg/xbyak


Reply to: