Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1174377 > unrolled thread

Bug#1055636: ogre: Add loongarch64 support

Started bySimon McVittie <smcv@debian.org>
First post2023-11-09 15:30 +0100
Last post2023-11-09 15:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.debian.bugs.dist

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1055636: ogre: Add loongarch64 support Simon McVittie <smcv@debian.org> - 2023-11-09 15:30 +0100

#1174377 — Bug#1055636: ogre: Add loongarch64 support

FromSimon McVittie <smcv@debian.org>
Date2023-11-09 15:30 +0100
SubjectBug#1055636: ogre: Add loongarch64 support
Message-ID<HyecF-4fxe-3@gated-at.bofh.it>
Control: reassign -1 src:ogre-1.12

The newer branch ogre-1.12 seems to have the same issue. ogre-1.9 was
not included in bookworm and is not going to be included in trixie,
so I'm reassigning this to ogre-1.12 rather than cloning it. Please
consider this to be "won't fix" for ogre-1.9.

On Thu, 09 Nov 2023 at 11:54:29 +0000, JiaLing Zhang wrote:
>      /* Find the arch type */
> -#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) || defined(__arm64__) || defined(__aarch64__) || defined(__mips64) || defined(__mips64_) || (defined(__riscv) && (__riscv_xlen == 64))
> +#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) || defined(__arm64__) || defined(__aarch64__) || defined(__mips64) || defined(__mips64_) || (defined(__riscv) && (__riscv_xlen == 64)) || defined(__loongarch64)
>  #   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64
>  #else
>  #   define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32

If this is as a Debian-specific patch, gcc already gives us this
information:

#if __SIZEOF_POINTER__ == 8
#define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64
#elif __SIZEOF_POINTER__ == 4
#define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32
#else
#error Architecture word size not detected or not supported
#endif

(That assumes gcc or clang, and will not work with non-gcc-compatible
compilers like MSVC, but Debian doesn't support such compilers.)

Upstream, I think this would be better done by detecting sizeof(void *)
at build time using CMAKE_SIZEOF_VOID_P, and substituting it into
CMake/Templates/OgreBuildSettings.h.in, perhaps something like this:

#define OGRE_CONFIG_SIZEOF_POINTER @CMAKE_SIZEOF_VOID_P@

and then making use of that in OgrePlatform.h:

#if OGRE_CONFIG_SIZEOF_POINTER == 8
#define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_64
#elif OGRE_CONFIG_SIZEOF_POINTER == 4
#define OGRE_ARCH_TYPE OGRE_ARCHITECTURE_32
#else
#error Architecture word size not detected or not supported
#endif

That way, there would be no need to keep updating this list with every new
CPU architecture that is invented.

    smcv

[toc] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web