Build of -m32 fossilize terminating with errors

未关闭
#229 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cmake, cpp
领域
build-system, cli

调研方向

从 cli/cli_parser.cpp 开始,重点查看 next_sint()、next_uint() 和 next_double(),然后使用 CFLAGS=-m32 CXXFLAGS=-m32 cmake .. 和 cmake --build .. 重现失败。检查数值解析调用是否与日志中显示的 char* 参数类型一致;当 32 位构建成功完成时即表示完成。

由索引模型根据 Issue 内容生成。

描述

build log
❯ mkdir build32 && cd build32 && CFLAGS=-m32 CXXFLAGS=-m32 cmake .. && CFLAGS=-m32 CXXFLAGS=-m32 cmake --build .
-- The CXX compiler identification is GNU 13.2.1
-- The C compiler identification is GNU 13.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at cli/SPIRV-Tools/CMakeLists.txt:15 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- No build type selected, default to Debug
CMake Warning (dev) at cli/SPIRV-Tools/CMakeLists.txt:240 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

Call Stack (most recent call first):
  cli/SPIRV-Tools/CMakeLists.txt:250 (find_host_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.12", minimum required is "3") 
-- Did not find googletest, tests will not be built. To enable tests place googletest in '<spirv-dir>/external/googletest'.
CMake Deprecation Warning at cli/SPIRV-Cross/CMakeLists.txt:22 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- Found Git: /usr/bin/git (found version "2.41.0") 
-- SPIRV-Cross: Git hash: 210a8001
CMake Warning (dev) at cli/SPIRV-Cross/CMakeLists.txt:462 (find_package):
  Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  are removed.  Run "cmake --help-policy CMP0148" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PythonInterp: /usr/bin/python3 (found version "3.12") 
SPIRV-Cross:  Testing will be disabled for SPIRV-Cross. Could not find glslang or SPIRV-Tools build under external/. To enable testing, run ./checkout_glslang_spirv_tools.sh and ./build_glslang_spirv_tools.sh first.
-- Configuring done (1.4s)
-- Generating done (0.3s)
-- Build files have been written to: /home/mikhail/packaging-work/git/Fossilize/build32
[  1%] Building C object CMakeFiles/miniz.dir/miniz/miniz.c.o
[  1%] Linking C static library libminiz.a
[  1%] Built target miniz
[  1%] Building CXX object CMakeFiles/fossilize.dir/fossilize.cpp.o
[  1%] Building CXX object CMakeFiles/fossilize.dir/fossilize_application_filter.cpp.o
[  2%] Building CXX object CMakeFiles/fossilize.dir/varint.cpp.o
[  2%] Building CXX object CMakeFiles/fossilize.dir/fossilize_db.cpp.o
[  2%] Building CXX object CMakeFiles/fossilize.dir/path.cpp.o
[  2%] Building CXX object CMakeFiles/fossilize.dir/fossilize_external_replayer.cpp.o
[  4%] Linking CXX static library libfossilize.a
[  4%] Built target fossilize
[  4%] Building CXX object layer/CMakeFiles/VkLayer_fossilize.dir/device.cpp.o
[  4%] Building CXX object layer/CMakeFiles/VkLayer_fossilize.dir/instance.cpp.o
[  4%] Building CXX object layer/CMakeFiles/VkLayer_fossilize.dir/dispatch.cpp.o
[  5%] Building CXX object layer/CMakeFiles/VkLayer_fossilize.dir/dispatch_helper.cpp.o
[  5%] Linking CXX shared library libVkLayer_fossilize.so
[  5%] Built target VkLayer_fossilize
[  5%] Building C object cli/CMakeFiles/volk.dir/volk/volk.c.o
[  7%] Linking C static library libvolk.a
[  7%] Built target volk
[  8%] Building CXX object cli/CMakeFiles/cli-utils.dir/cli_parser.cpp.o
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp: In member function ‘int Fossilize::CLIParser::next_sint()’:
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp:83:25: error: invalid initialization of reference of type ‘const std::wstring&’ {aka ‘const std::__cxx11::basic_string<wchar_t>&’} from expression of type ‘char*’
   83 |         auto val = stol(*argv);
      |                         ^~~~~
In file included from /usr/include/c++/13/string:54,
                 from /home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.hpp:26,
                 from /home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp:23:
/usr/include/c++/13/bits/basic_string.h:4265:23: note: in passing argument 1 of ‘long int std::__cxx11::stol(const std::wstring&, std::size_t*, int)’
 4265 |   stol(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp: In member function ‘unsigned int Fossilize::CLIParser::next_uint()’:
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp:104:26: error: invalid initialization of reference of type ‘const std::wstring&’ {aka ‘const std::__cxx11::basic_string<wchar_t>&’} from expression of type ‘char*’
  104 |         auto val = stoul(*argv);
      |                          ^~~~~
/usr/include/c++/13/bits/basic_string.h:4270:24: note: in passing argument 1 of ‘long unsigned int std::__cxx11::stoul(const std::wstring&, std::size_t*, int)’
 4270 |   stoul(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |         ~~~~~~~~~~~~~~~^~~~~
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp: In member function ‘double Fossilize::CLIParser::next_double()’:
/home/mikhail/packaging-work/git/Fossilize/cli/cli_parser.cpp:125:27: error: invalid initialization of reference of type ‘const std::wstring&’ {aka ‘const std::__cxx11::basic_string<wchar_t>&’} from expression of type ‘char*’
  125 |         double val = stod(*argv);
      |                           ^~~~~
/usr/include/c++/13/bits/basic_string.h:4290:23: note: in passing argument 1 of ‘double std::__cxx11::stod(const std::wstring&, std::size_t*)’
 4290 |   stod(const wstring& __str, size_t* __idx = 0)
      |        ~~~~~~~~~~~~~~~^~~~~
gmake[2]: *** [cli/CMakeFiles/cli-utils.dir/build.make:76: cli/CMakeFiles/cli-utils.dir/cli_parser.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:830: cli/CMakeFiles/cli-utils.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
主要语言
C++
星标
800
派生
82
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ValveSoftware/Fossilize 的其他 Issue

查看 ValveSoftware/Fossilize 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。