Skip to content

bgfx compile fail,for missing cstdint in SpvBuilder.h and other problem #8200

@Casinius

Description

@Casinius

Xmake 版本

v3.0.3+20250922

操作系统版本和架构

Artix Linux x86_64

描述问题

在xrepo install bgfx的时候出现编译失败

期待的结果

期望:xrepo install bgfx能完美编译安装成功

工程配置

无,仅控制台xrepo install bgfx

附加信息和错误日志

make: Entering directory '/home/cyan/.xmake/cache/packages/2509/b/bgfx/8752/source/bgfx/.build/projects/gmake-linux'
==== Building bx (release64) ====
==== Building fcpp (release64) ====
==== Building glsl-optimizer (release64) ====
==== Building glslang (release64) ====
==== Building spirv-opt (release64) ====
==== Building spirv-cross (release64) ====
Creating ../../linux64_gcc/obj/x64/Release/bx
Creating ../../linux64_gcc/obj/x64/Release/bx/resources/bx/bx.git/src
Creating ../../linux64_gcc/obj/x64/Release/fcpp
Creating ../../linux64_gcc/bin
Creating ../../linux64_gcc/obj/x64/Release/spirv-cross
Creating ../../linux64_gcc/obj/x64/Release/fcpp/3rdparty/fcpp
Creating ../../linux64_gcc/bin
Creating ../../linux64_gcc/obj/x64/Release/spirv-cross/3rdparty/spirv-cross
Creating ../../linux64_gcc/obj/x64/Release/glslang
Creating ../../linux64_gcc/bin
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/SPIRV
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer/3rdparty/glsl-optimizer/src/glsl
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer/3rdparty/glsl-optimizer/src/glsl/glcpp
cpp1.c
allocator.cpp
bounds.cpp
cpp2.c
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer/3rdparty/glsl-optimizer/src/mesa/main
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/SPIRV/CInterface
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer/3rdparty/glsl-optimizer/src/mesa/program
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/CInterface
commandline.cpp
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/GenericCodeGen
spirv_cfg.cpp
bx.cpp
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt
spirv_cpp.cpp
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt/3rdparty/spirv-tools/source
Creating ../../linux64_gcc/obj/x64/Release/glsl-optimizer/3rdparty/glsl-optimizer/src/util
cpp3.c
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/HLSL
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/MachineIndependent
cpp4.c
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt/3rdparty/spirv-tools/source/opt
cpp5.c
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/MachineIndependent/preprocessor
ast_array_index.cpp
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt/3rdparty/spirv-tools/source/reduce
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/OSDependent/Unix
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt/3rdparty/spirv-tools/source/util
Creating ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/glslang/ResourceLimits
Creating ../../linux64_gcc/obj/x64/Release/spirv-opt/3rdparty/spirv-tools/source/val
assembly_grammar.cpp
spirv_c_interface.cpp
../../../3rdparty/fcpp/cpp2.c: In function ‘fpp_openinclude’:
../../../3rdparty/fcpp/cpp2.c:677:38: warning: ‘%s’ directive writing up to 65535 bytes into a region of size between 1 and 65536 [-Wformat-overflow=]
  677 |                 sprintf( tmpname, "%s%s", *incptr, filename );
      |                                      ^~
../../../3rdparty/fcpp/cpp2.c:677:17: note: ‘sprintf’ output between 1 and 131071 bytes into a destination of size 65536
  677 |                 sprintf( tmpname, "%s%s", *incptr, filename );
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../3rdparty/fcpp/cpp2.c:675:39: warning: ‘%s’ directive writing up to 65535 bytes into a region of size between 0 and 65535 [-Wformat-overflow=]
  675 |                 sprintf( tmpname, "%s/%s", *incptr, filename );
      |                                       ^~
../../../3rdparty/fcpp/cpp2.c:675:17: note: ‘sprintf’ output between 2 and 131072 bytes into a destination of size 65536
  675 |                 sprintf( tmpname, "%s/%s", *incptr, filename );
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spirv_cross.cpp
At top level:
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
spirv_cross_parsed_ir.cpp
ast_expr.cpp
crtnone.cpp
debug.cpp
GlslangToSpv.cpp
cpp6.c
dtoa.cpp
ast_function.cpp
ast_to_hir.cpp
Archiving fcpp
easing.cpp
binary.cpp
spirv_cross_util.cpp
InReadableOrder.cpp
In file included from ../../../3rdparty/glslang/SPIRV/GlslangToSpv.cpp:45:
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:247:30: error: ‘uint32_t’ has not been declared
  247 |     Id makeDebugLexicalBlock(uint32_t line);
      |                              ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:64:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   63 | #include <stack>
  +++ |+#include <cstdint>
   64 | #include <unordered_map>
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: error: ‘uint32_t’ has not been declared
  444 |     void enterLexicalBlock(uint32_t line);
      |                            ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
ast_type.cpp
builtin_functions.cpp
../../../3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp:65:9: warning: ‘M_PIf’ redefined
   65 | #define M_PIf   ((float) M_PI)
      |         ^~~~~
In file included from /usr/include/c++/15.2.1/cmath:55,
                 from /usr/include/c++/15.2.1/math.h:36,
                 from ../../../3rdparty/glsl-optimizer/src/mesa/main/compiler.h:39,
                 from ../../../3rdparty/glsl-optimizer/src/mesa/main/core.h:43,
                 from ../../../3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp:58:
/usr/include/math.h:1138:10: note: this is the location of the previous definition
 1138 | # define M_PIf          3.14159265358979323846f /* pi */
      |          ^~~~~
../../../3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp:66:9: warning: ‘M_PI_2f’ redefined
   66 | #define M_PI_2f ((float) M_PI_2)
      |         ^~~~~~~
/usr/include/math.h:1139:10: note: this is the location of the previous definition
 1139 | # define M_PI_2f        1.57079632679489661923f /* pi/2 */
      |          ^~~~~~~
../../../3rdparty/glsl-optimizer/src/glsl/builtin_functions.cpp:67:9: warning: ‘M_PI_4f’ redefined
   67 | #define M_PI_4f ((float) M_PI_4)
      |         ^~~~~~~
/usr/include/math.h:1140:10: note: this is the location of the previous definition
 1140 | # define M_PI_4f        0.78539816339744830962f /* pi/4 */
      |          ^~~~~~~
Logger.cpp
SPVRemapper.cpp
spirv_glsl.cpp
diagnostic.cpp
SpvBuilder.cpp
file.cpp
SpvPostProcess.cpp
builtin_types.cpp
In file included from ../../../3rdparty/glslang/SPIRV/SpvBuilder.cpp:48:
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:247:30: error: ‘uint32_t’ has not been declared
  247 |     Id makeDebugLexicalBlock(uint32_t line);
      |                              ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:64:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   63 | #include <stack>
  +++ |+#include <cstdint>
   64 | #include <unordered_map>
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: error: ‘uint32_t’ has not been declared
  444 |     void enterLexicalBlock(uint32_t line);
      |                            ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
../../../3rdparty/glslang/SPIRV/SpvBuilder.cpp:2262:4: error: no declaration matches ‘spv::Id spv::Builder::makeDebugLexicalBlock(uint32_t)’
 2262 | Id Builder::makeDebugLexicalBlock(uint32_t line) {
      |    ^~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:247:8: note: candidate is: ‘spv::Id spv::Builder::makeDebugLexicalBlock(int)’
  247 |     Id makeDebugLexicalBlock(uint32_t line);
      |        ^~~~~~~~~~~~~~~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:78:7: note: ‘class spv::Builder’ defined here
   78 | class Builder {
      |       ^~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.cpp:2305:6: error: no declaration matches ‘void spv::Builder::enterLexicalBlock(uint32_t)’
 2305 | void Builder::enterLexicalBlock(uint32_t line)
      |      ^~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:10: note: candidate is: ‘void spv::Builder::enterLexicalBlock(int)’
  444 |     void enterLexicalBlock(uint32_t line);
      |          ^~~~~~~~~~~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:78:7: note: ‘class spv::Builder’ defined here
   78 | class Builder {
      |       ^~~~~~~
disassemble.cpp
In file included from ../../../3rdparty/glslang/SPIRV/SpvPostProcess.cpp:46:
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:247:30: error: ‘uint32_t’ has not been declared
  247 |     Id makeDebugLexicalBlock(uint32_t line);
      |                              ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:64:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   63 | #include <stack>
  +++ |+#include <cstdint>
   64 | #include <unordered_map>
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: error: ‘uint32_t’ has not been declared
  444 |     void enterLexicalBlock(uint32_t line);
      |                            ^~~~~~~~
../../../3rdparty/glslang/SPIRV/SpvBuilder.h:444:28: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
spirv_hlsl.cpp
SpvTools.cpp
make[1]: *** [glslang.make:643: ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/SPIRV/SpvBuilder.o] Error 1
make[1]: *** Waiting for unfinished jobs....
enum_string_mapping.cpp
filepath.cpp
make[1]: *** [glslang.make:647: ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/SPIRV/SpvPostProcess.o] Error 1
spirv_msl.cpp
builtin_variables.cpp
make[1]: *** [glslang.make:627: ../../linux64_gcc/obj/x64/Release/glslang/3rdparty/glslang/SPIRV/GlslangToSpv.o] Error 1
hash.cpp
math.cpp
spirv_parser.cpp
ext_inst.cpp
mutex.cpp
glcpp-lex.c
spirv_reflect.cpp
os.cpp
process.cpp
extensions.cpp
glcpp-parse.c
semaphore.cpp
libspirv.cpp
settings.cpp
name_mapper.cpp
pp.c
sort.cpp
string.cpp
thread.cpp
glsl_lexer.cpp
glsl_optimizer.cpp
opcode.cpp
make: *** [Makefile:53: glslang] Error 2
make: *** Waiting for unfinished jobs....
glsl_parser.cpp
operand.cpp
timer.cpp
glsl_parser_extras.cpp
url.cpp
aggressive_dead_code_elim_pass.cpp
glsl_symbol_table.cpp
glsl_types.cpp
Archiving bx
amd_ext_to_khr.cpp
analyze_live_input_pass.cpp
hir_field_selection.cpp
ir.cpp
basic_block.cpp
block_merge_pass.cpp
ir_basic_block.cpp
ir_builder.cpp
block_merge_util.cpp
build_module.cpp
ir_clone.cpp
ccp_pass.cpp
ir_constant_expression.cpp
cfg.cpp
ir_equals.cpp
cfg_cleanup_pass.cpp
ir_expression_flattening.cpp
ir_function.cpp
ir_function_can_inline.cpp
code_sink.cpp
ir_function_detect_recursion.cpp
combine_access_chains.cpp
ir_hierarchical_visitor.cpp
compact_ids_pass.cpp
ir_hv_accept.cpp
ir_import_prototypes.cpp
ir_print_glsl_visitor.cpp
composite.cpp
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp: In member function ‘virtual void ir_print_glsl_visitor::visit(ir_texture*)’:
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp:927:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  927 |     if (ir->offset != NULL)
      |     ^~
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp:930:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  930 |         if (state->es_shader)
      |         ^~
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp: In member function ‘bool ir_print_glsl_visitor::emit_canonical_for(ir_loop*)’:
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp:1595:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
 1595 |     if (!can_emit_canonical_for(ls))
      |     ^~
../../../3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp:1598:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 1598 |         hash_table* terminator_hash = hash_table_ctor(0, hash_table_pointer_hash, hash_table_pointer_compare);
      |         ^~~~~~~~~~
const_folding_rules.cpp
ir_print_metal_visitor.cpp
ir_print_visitor.cpp
constants.cpp
ir_rvalue_visitor.cpp
control_dependence.cpp
convert_to_half_pass.cpp
ir_stats.cpp
convert_to_sampled_image_pass.cpp
ir_unused_structs.cpp
copy_prop_arrays.cpp
ir_validate.cpp
ir_variable_refcount.cpp
link_atomics.cpp
dataflow.cpp
....(lots of cpp that compiled sussessfully)
Archiving spirv-opt
make: Leaving directory '/home/cyan/.xmake/cache/packages/2509/b/bgfx/8752/source/bgfx/.build/projects/gmake-linux'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions