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

请教一个入门问题,如何编译 32 位的 bin ? 🤣 #38

Open
LYingSiMon opened this issue Jun 21, 2023 · 1 comment
Open

Comments

@LYingSiMon
Copy link

我尝试使用如下命令编译了 9.0.1

git clone -b llvm-9.0.1 https://github.com/heroims/obfuscator
cd obfuscator
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ../
mingw32-make.exe -j7

经过测试他是工作的,但我希望得到 32位的文件,而不是 64位的,请问我该如何修改?
我尝试了使用 cmake 的 set(CMAKE_C_FLAGS "-m32"),set(CMAKE_CXX_FLAGS "-m32") 但这会导致 build 的时候失败:

... (省略)
-- Version: 0.0.0
Performing Test HAVE_CXX_FLAG_STD_CXX11
Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
Performing Test HAVE_CXX_FLAG_WALL
Performing Test HAVE_CXX_FLAG_WALL - Success
Performing Test HAVE_CXX_FLAG_WEXTRA
Performing Test HAVE_CXX_FLAG_WEXTRA - Success
Performing Test HAVE_CXX_FLAG_WSHADOW
Performing Test HAVE_CXX_FLAG_WSHADOW - Success
Performing Test HAVE_CXX_FLAG_PEDANTIC
Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS
Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS - Success
Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
Performing Test HAVE_CXX_FLAG_WD654
Performing Test HAVE_CXX_FLAG_WD654 - Failed
Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY研究造福
Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
Performing Test HAVE_CXX_FLAG_COVERAGE恢复提议
Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
CMake Warning at utils/benchmark/CMakeLists.txt:244 (message):
  Using std::regex with exceptions disabled is not fully supported

之后我又尝试了使用 -DCMAKE_GENERATOR_PLATFORM=x86 强制修改平台,但 cmake 会报错:

Generator

    MinGW Makefiles

  does not support platform specification, but platform

    x86

  was specified.

希望得到您的帮助 ,感谢 🙃

@kahotv
Copy link

kahotv commented Apr 10, 2024

环境:Win10,vs2022+clang编译器,cmake
分支:llvm-13.x
代码路径:d:\obfuscator_32
生成32位vs的solution:
①开始菜单里搜索2022,找到"Developer Command Prompt for VS 2022",打开
cd /d d:\obfuscator_32
cmake -G "Visual Studio 17 2022" -A Win32 -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release -DLLVM_INCLUDE_TESTS=OFF -DLLVM_ENABLE_NEW_PASS_MANAGER=OFF ./llvm

参考Windows环境下编译OLLVM源码(VS2022)_llvm源码编译 windows-CSDN博客

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

No branches or pull requests

2 participants