godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.79k stars 21.13k forks source link

Cannot build with `use_llvm=yes` #66864

Closed atirut-w closed 2 years ago

atirut-w commented 2 years ago

Godot version

4b52c6caef8a9e5d940ce0977d5c467296ac5805

System information

Arch Linux

Issue description

Building the master branch with the said settings causes a bunch of standard libs to go missing.

scons: Reading SConscript files ...
Automatically detected platform: linuxbsd
Warning: Speech Dispatcher development libraries not found. Disabling Text-to-Speech support.
Building for platform "linuxbsd", architecture "x86_64", target "editor".
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[  1%] Compiling platform/linuxbsd/godot_linuxbsd.cpp ...
[  1%] Compiling platform/linuxbsd/crash_handler_linuxbsd.cpp ...
platform/linuxbsd/godot_linuxbsd.cpp:32:10: fatal error: 'locale.h' file not found
#include <locale.h>
         ^~~~~~~~~~
In file included from platform/linuxbsd/crash_handler_linuxbsd.cpp:33:
In file included from ./core/config/project_settings.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:34:
./core/extension/gdnative_interface.h:40:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
[  2%] Compiling platform/linuxbsd/os_linuxbsd.cpp ...
In file included from platform/linuxbsd/os_linuxbsd.cpp:31:
In file included from platform/linuxbsd/os_linuxbsd.h:34:
In file included from ./core/input/input.h:34:
In file included from ./core/input/input_event.h:35:
In file included from ./core/io/resource.h:34:
In file included from ./core/io/resource_uid.h:34:
In file included from ./core/object/ref_counted.h:34:
In file included from ./core/object/class_db.h:34:
In file included from ./core/object/method_bind.h:34:
In file included from ./core/variant/binder_common.h:35:
In file included from ./core/object/object.h:34:
./core/extension/gdnative_interface.h:40:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
scons: *** [platform/linuxbsd/crash_handler_linuxbsd.linuxbsd.editor.x86_64.llvm.o] Error 1
1 error generated.
scons: *** [platform/linuxbsd/godot_linuxbsd.linuxbsd.editor.x86_64.llvm.o] Error 1
1 error generated.
scons: *** [platform/linuxbsd/os_linuxbsd.linuxbsd.editor.x86_64.llvm.o] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:00:03.940]

Steps to reproduce

scons -j 3 use_llvm=yes

Minimal reproduction project

No response

akien-mga commented 2 years ago

Do you have glibc installed? It should include /usr/include/locale.h and /usr/include is a standard path so either you are missing a libc implementation, or your clang someone doesn't search for includes in standard paths.

atirut-w commented 2 years ago

I checked it and realised I had a fork of clang in my path. I'll adjust my path and see if it works.

atirut-w commented 2 years ago

Yep. I moved the clang fork to after the main path and now it works. Guess I'll have to note this down.