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

Cannot build for ppc64le #56448

Closed
bkeys opened this issue Jan 2, 2022 · 20 comments · Fixed by #78325
Closed

Cannot build for ppc64le #56448

bkeys opened this issue Jan 2, 2022 · 20 comments · Fixed by #78325

Comments

@bkeys
Copy link
Contributor

bkeys commented Jan 2, 2022

Godot version

3.4

System information

Fedora, ppc64le

Issue description

I tried to build godot on this platform, and I get the following error, I can replicate this on version 3.4.2 as well:

[bkeys@great-fox godot]$ scons use_llvm=yes target=release_debug p=linuxbsd
scons: Reading SConscript files ...
Platform "linuxbsd" is still called "x11" in Godot 3.x. Building for platform "x11".
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[ 29%] Compiling ==> thirdparty/embree/common/sys/sysinfo.cpp
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:17:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/mmintrin.h:31:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error                                                                         \
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:22:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/xmmintrin.h:31:2: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:22:
In file included from /usr/lib64/clang/13.0.0/include/ppc_wrappers/xmmintrin.h:56:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/mmintrin.h:31:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error                                                                         \
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:27:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/emmintrin.h:32:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:27:
In file included from /usr/lib64/clang/13.0.0/include/ppc_wrappers/emmintrin.h:43:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/xmmintrin.h:31:2: error: "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above. Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:32:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/pmmintrin.h:35:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this warning."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this warning."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:32:
In file included from /usr/lib64/clang/13.0.0/include/ppc_wrappers/pmmintrin.h:44:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/emmintrin.h:32:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:37:
In file included from /usr/lib64/clang/13.0.0/include/ppc_wrappers/tmmintrin.h:33:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/pmmintrin.h:35:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this warning."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this warning."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:42:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/smmintrin.h:25:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error                                                                         \
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:42:
In file included from /usr/lib64/clang/13.0.0/include/ppc_wrappers/smmintrin.h:35:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/emmintrin.h:32:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:47:
In file included from /usr/lib64/clang/13.0.0/include/wmmintrin.h:13:
/usr/lib64/clang/13.0.0/include/ppc_wrappers/emmintrin.h:32:2: error: "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
#error "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this error."
 ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:47:
In file included from /usr/lib64/clang/13.0.0/include/wmmintrin.h:15:
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:37:19: error: use of undeclared identifier '__builtin_ia32_aesenc128'
  return (__m128i)__builtin_ia32_aesenc128((__v2di)__V, (__v2di)__R);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:57:19: error: use of undeclared identifier '__builtin_ia32_aesenclast128'
  return (__m128i)__builtin_ia32_aesenclast128((__v2di)__V, (__v2di)__R);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:77:19: error: use of undeclared identifier '__builtin_ia32_aesdec128'
  return (__m128i)__builtin_ia32_aesdec128((__v2di)__V, (__v2di)__R);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:97:19: error: use of undeclared identifier '__builtin_ia32_aesdeclast128'
  return (__m128i)__builtin_ia32_aesdeclast128((__v2di)__V, (__v2di)__R);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:114:19: error: use of undeclared identifier '__builtin_ia32_aesimc128'; did you mean '__builtin_asinf128'?
  return (__m128i)__builtin_ia32_aesimc128((__v2di)__V);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:37:19: note: '__builtin_asinf128' declared here
  return (__m128i)__builtin_ia32_aesenc128((__v2di)__V, (__v2di)__R);
                  ^
/usr/lib64/clang/13.0.0/include/__wmmintrin_aes.h:114:44: error: cannot initialize a parameter of type '__float128' with an rvalue of type '__v2di' (vector of 2 'long long' values)
  return (__m128i)__builtin_ia32_aesimc128((__v2di)__V);
                                           ^~~~~~~~~~~
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:52:
/usr/lib64/clang/13.0.0/include/clflushoptintrin.h:22:3: error: use of undeclared identifier '__builtin_ia32_clflushopt'
  __builtin_ia32_clflushopt(__m);
  ^
In file included from thirdparty/embree/common/sys/sysinfo.cpp:5:
In file included from thirdparty/embree/common/sys/intrinsics.h:15:
In file included from /usr/lib64/clang/13.0.0/include/immintrin.h:57:
/usr/lib64/clang/13.0.0/include/clwbintrin.h:33:3: error: use of undeclared identifier '__builtin_ia32_clwb'
  __builtin_ia32_clwb(__p);
  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
scons: *** [thirdparty/embree/common/sys/sysinfo.x11.opt.tools.64.llvm.o] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:00:10.933]

It looks like it is trying to use x86 specific instructions.

Steps to reproduce

clone the godot repo, and check into the 3.4 branch, run the following command:
scons use_llvm=yes target=release_debug p=linuxbsd

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Jan 2, 2022

Related to #49225 and #55192.

This happens because the version of Embree, OpenImageDenoise and WebM used in Godot are x86-only. Adding module_embree_enabled=no module_raycast_enabled=no module_webm_enabled=no to the SCons command line should make it possible to build Godot on ARM and PowerPC.

@bkeys
Copy link
Contributor Author

bkeys commented Jan 3, 2022

Now the build is successful, but the linker fails with:
/usr/bin/ld: drivers/libdrivers.x11.opt.tools.64.llvm.a(pngrutil.x11.opt.tools.64.llvm.o): in function `png_init_filter_functions': /home/bkeys/Devel/Software/godot/thirdparty/libpng/pngrutil.c:4304: undefined reference to `png_init_filter_functions_vsx'
At which point I question if that is a ppc64le/arm specific issue

@aaronfranke
Copy link
Member

aaronfranke commented Jan 3, 2022

@bkeys Did you try adding arch=ppc64 in the scons command?

It should auto-detect the architecture from this list but since your filename contains .64. then it looks like it's not detecting it. What is the output of import platform then platform.machine() in Python on your system?

@bkeys
Copy link
Contributor Author

bkeys commented Jan 4, 2022

Yes I did a clean build and scons gave me the same linker error from before.
As for python, it gave me the output of 'ppc64le'

@aaronfranke
Copy link
Member

@bkeys Sorry for sending you on a wild goose chase, I've figured out the problem. It's in 3.5 but not 3.4.

@bkeys
Copy link
Contributor Author

bkeys commented Jan 4, 2022

Well I have tried to build on master and I still get the error about the undefined reference to libpng, so what are the next steps for me to try to build Godot?

@aaronfranke
Copy link
Member

@q66

@q66
Copy link
Contributor

q66 commented Jan 4, 2022

if you want a patch for stable releases: https://github.com/void-linux/void-packages/blob/master/srcpkgs/godot/patches/ppc.patch

the current workaround for libpng issues is to build with system libpng, another workaround is to get -DPNG_POWERPC_VSX_OPT=0 into your compiler flags

actual out of box solution would be to import the vsx intrinsics sources from https://github.com/glennrp/libpng/tree/libpng16/powerpc into the bundled libpng and add them into the build

@bkeys
Copy link
Contributor Author

bkeys commented Jan 5, 2022

How do I go about using the system libpng?

@q66
Copy link
Contributor

q66 commented Jan 5, 2022

builtin_libpng=false?

@bkeys
Copy link
Contributor Author

bkeys commented Jan 5, 2022

I get the same linker error, I even went into SConstruct and changed it, the error persists

@akien-mga
Copy link
Member

You should do a clean build (or at least remove .o and .a files in drivers/png and thirdparty/libpng). Note that freetype depends on libpng so if you use system libpng, it's advised to also use system freetype (and system zlib).

@bkeys
Copy link
Contributor Author

bkeys commented Jan 5, 2022

@akien-mga I removed the .a and .o files in those directories and I got the same linker error.

@bkeys
Copy link
Contributor Author

bkeys commented Jan 5, 2022

I did a complete rebuild making png, zlib, and freetype all system and I got a successful build.

@aaronfranke
Copy link
Member

@bkeys Is this resolved then? If so, we can close this issue.

@bkeys
Copy link
Contributor Author

bkeys commented Apr 21, 2022

I tried a fresh build with the current alpha and got the following error

[100%] Linking Program bin/godot.linuxbsd.opt.tools.ppc64.llvm ...
platform/linuxbsd/libudev-so_wrap.linuxbsd.opt.tools.ppc64.llvm.o: file not recognized: file format not recognized
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

Not sure if you wanna keep this issue open or not.

@bkeys
Copy link
Contributor Author

bkeys commented Apr 10, 2023

This issue has resurfaced into the 4.0 version of Godot. Any advice on getting it built with ppc64le?

@aaronfranke
Copy link
Member

@bkeys @q66 What are you using to run Godot on PowerPC? Physical hardware? VMs? If VM, what software, Qemu? What's the correct setup to get graphics support in Qemu PPC? If hardware, is it something cheap I could buy?

@bkeys
Copy link
Contributor Author

bkeys commented Jun 26, 2023

@aaronfranke I am using a Talos workstation available from raptorcs. Unfortunately it is not cheap hardware at all.
I have an amdgpu in here, with a mainline Fedora installation. It's nothing too special other than the fact it's ppc64le.

@akien-mga akien-mga added this to the 4.2 milestone Aug 4, 2023
@akien-mga
Copy link
Member

Fixed by #78325.

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

Successfully merging a pull request may close this issue.

5 participants