日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

Windows环境下利用VS和mingw编译LLVM

發布時間:2025/3/21 windows 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows环境下利用VS和mingw编译LLVM 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

致敬

昨日山河齊慟震,今朝兩星自九州

國士無雙,先生千古

袁爺爺,吳爺爺,一路走好,謝謝兩位爺爺的辛苦付出,未來交在我們手里吧,您們放心吧

文章目錄

    • 致敬
    • 昨日山河齊慟震,今朝兩星自九州
    • 國士無雙,先生千古
    • 袁爺爺,吳爺爺,一路走好,謝謝兩位爺爺的辛苦付出,未來交在我們手里吧,您們放心吧
    • Windows環境
      • Visual studio
        • 所需環境:
        • 總結:
      • mingw
        • 所需環境:
      • 注意點

Windows環境

Visual studio

所需環境:

  • LLVM源碼;
  • visual studio
  • cmake
  • CLang源碼
  • C:\Users\ASUS>e:E:\>cd LLVM\buildE:\LLVM\build>E:\LLVM\cmake-3.20.2-windows-x86_64\cmake-3.20.2-windows-x86_64\bin\cmake -G "Visual Studio 16" -Thost=x64 E:\LLVM\llvm-6.0.0.src\llvm-6.0.0.src CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):The OLD behavior for policy CMP0051 will be removed from a future versionof CMake.The cmake-policies(7) manual explains that the OLD behaviors of allpolicies are deprecated and that a policy should be set to OLD only underspecific short-term circumstances. Projects should be ported to the NEWbehavior and not rely on setting a policy to OLD.-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363. -- The C compiler identification is MSVC 19.28.29915.0 -- The CXX compiler identification is MSVC 19.28.29915.0 -- The ASM compiler identification is MSVC -- Found assembler: F:/visual stido IDE/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: F:/visual stido IDE/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: F:/visual stido IDE/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for dirent.h -- Looking for dirent.h - not found -- Looking for dlfcn.h -- Looking for dlfcn.h - not found -- Looking for errno.h -- Looking for errno.h - found -- Looking for fcntl.h -- Looking for fcntl.h - found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for link.h -- Looking for link.h - not found -- Looking for malloc.h -- Looking for malloc.h - found -- Looking for malloc/malloc.h -- Looking for malloc/malloc.h - not found -- Looking for ndir.h -- Looking for ndir.h - not found -- Looking for signal.h -- Looking for signal.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for sys/dir.h -- Looking for sys/dir.h - not found -- Looking for sys/ioctl.h -- Looking for sys/ioctl.h - not found -- Looking for sys/mman.h -- Looking for sys/mman.h - not found -- Looking for sys/ndir.h -- Looking for sys/ndir.h - not found -- Looking for sys/param.h -- Looking for sys/param.h - not found -- Looking for sys/resource.h -- Looking for sys/resource.h - not found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/time.h -- Looking for sys/time.h - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for sys/uio.h -- Looking for sys/uio.h - not found -- Looking for termios.h -- Looking for termios.h - not found -- Looking for unistd.h -- Looking for unistd.h - not found -- Looking for valgrind/valgrind.h -- Looking for valgrind/valgrind.h - not found -- Looking for zlib.h -- Looking for zlib.h - not found -- Looking for fenv.h -- Looking for fenv.h - found -- Looking for FE_ALL_EXCEPT -- Looking for FE_ALL_EXCEPT - found -- Looking for FE_INEXACT -- Looking for FE_INEXACT - found -- Looking for mach/mach.h -- Looking for mach/mach.h - not found -- Looking for histedit.h -- Looking for histedit.h - not found -- Looking for CrashReporterClient.h -- Looking for CrashReporterClient.h - not found -- Looking for compress2 in z -- Looking for compress2 in z - not found -- Looking for compress2 in zlib_static -- Looking for compress2 in zlib_static - not found -- Looking for compress2 in zlib -- Looking for compress2 in zlib - not found -- Looking for xar_open in xar -- Looking for xar_open in xar - not found -- Looking for arc4random -- Looking for arc4random - not found -- Looking for backtrace -- Looking for backtrace - not found -- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR) -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed -- Looking for _Unwind_Backtrace -- Looking for _Unwind_Backtrace - not found -- Looking for getpagesize -- Looking for getpagesize - not found -- Looking for sysconf -- Looking for sysconf - not found -- Looking for getrusage -- Looking for getrusage - not found -- Looking for setrlimit -- Looking for setrlimit - not found -- Looking for isatty -- Looking for isatty - not found -- Looking for futimens -- Looking for futimens - not found -- Looking for futimes -- Looking for futimes - not found -- Looking for posix_fallocate -- Looking for posix_fallocate - not found -- Looking for sigaltstack -- Looking for sigaltstack - not found -- Looking for lseek64 -- Looking for lseek64 - not found -- Looking for mallctl -- Looking for mallctl - not found -- Looking for mallinfo -- Looking for mallinfo - not found -- Looking for malloc_zone_statistics -- Looking for malloc_zone_statistics - not found -- Looking for mkdtemp -- Looking for mkdtemp - not found -- Looking for mkstemp -- Looking for mkstemp - not found -- Looking for mktemp -- Looking for mktemp - not found -- Looking for getcwd -- Looking for getcwd - not found -- Looking for gettimeofday -- Looking for gettimeofday - not found -- Looking for getrlimit -- Looking for getrlimit - not found -- Looking for posix_spawn -- Looking for posix_spawn - not found -- Looking for pread -- Looking for pread - not found -- Looking for realpath -- Looking for realpath - not found -- Looking for sbrk -- Looking for sbrk - not found -- Looking for strtoll -- Looking for strtoll - found -- Looking for strerror -- Looking for strerror - found -- Looking for strerror_r -- Looking for strerror_r - not found -- Looking for strerror_s -- Looking for strerror_s - found -- Looking for setenv -- Looking for setenv - not found -- Looking for _chsize_s -- Looking for _chsize_s - found -- Looking for _alloca -- Looking for _alloca - not found -- Looking for __alloca -- Looking for __alloca - not found -- Looking for __chkstk -- Looking for __chkstk - found -- Looking for __chkstk_ms -- Looking for __chkstk_ms - not found -- Looking for ___chkstk -- Looking for ___chkstk - not found -- Looking for ___chkstk_ms -- Looking for ___chkstk_ms - not found -- Looking for __ashldi3 -- Looking for __ashldi3 - not found -- Looking for __ashrdi3 -- Looking for __ashrdi3 - not found -- Looking for __divdi3 -- Looking for __divdi3 - not found -- Looking for __fixdfdi -- Looking for __fixdfdi - not found -- Looking for __fixsfdi -- Looking for __fixsfdi - not found -- Looking for __floatdidf -- Looking for __floatdidf - not found -- Looking for __lshrdi3 -- Looking for __lshrdi3 - not found -- Looking for __moddi3 -- Looking for __moddi3 - not found -- Looking for __udivdi3 -- Looking for __udivdi3 - not found -- Looking for __umoddi3 -- Looking for __umoddi3 - not found -- Looking for __main -- Looking for __main - not found -- Looking for __cmpdi2 -- Looking for __cmpdi2 - not found -- Looking for __GLIBC__ -- Looking for __GLIBC__ - not found -- Looking for sched_getaffinity -- Looking for sched_getaffinity - not found -- Looking for CPU_COUNT -- Looking for CPU_COUNT - not found -- Performing Test HAVE_INT64_T -- Performing Test HAVE_INT64_T - Success -- Performing Test HAVE_UINT64_T -- Performing Test HAVE_UINT64_T - Success -- Performing Test HAVE_U_INT64_T -- Performing Test HAVE_U_INT64_T - Failed -- Performing Test LLVM_HAS_ATOMICS -- Performing Test LLVM_HAS_ATOMICS - Success -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Failed -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed -- Native target architecture is X86 -- Threads enabled. -- Doxygen disabled. -- Go bindings disabled. -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) -- OCaml bindings disabled. -- Could NOT find Python module pygments -- Could NOT find Python module pygments.lexers.c_cpp -- Could NOT find Python module yaml -- LLVM host triple: x86_64-pc-win32 -- LLVM default target triple: x86_64-pc-win32 -- Using Debug VC++ CRT: MDd -- Using Release VC++ CRT: MD -- Using MinSizeRel VC++ CRT: MD -- Using RelWithDebInfo VC++ CRT: MD -- Found PythonInterp: G:/python3.7.6-64/python.exe (found version "3.7.6") -- Constructing LLVMBuild project information -- LLVMHello ignored -- Loadable modules not supported on this platform. -- Targeting AArch64 -- Targeting AMDGPU -- Targeting ARM -- Targeting BPF -- Targeting Hexagon -- Targeting Lanai -- Targeting Mips -- Targeting MSP430 -- Targeting NVPTX -- Targeting PowerPC -- Targeting Sparc -- Targeting SystemZ -- Targeting X86 -- Targeting XCore -- BugpointPasses ignored -- Loadable modules not supported on this platform. -- Configuring done -- Generating done -- Build files have been written to: E:/LLVM/build


    然后生成一個LLVM.sln,用visual studio打開它

    然后找到ALL_BUILD,鼠標右鍵,進行生成………………


    最后生成的時候,就是找不到clang.exe

    總結:

    學長所說VS編譯他就沒見過成功的,所以我成功地失敗了

    mingw

    所需環境:

  • LLVM+obf集成包;
  • mingw編譯器
  • cmake
  • 記得把mingw和cmake添加環境變量(MinGW 下載下來后需在環境變量的PATH里加一下。CMake如果是ZIP的話最好也加到PATH里,方便使用。配置方法不難,不再詳談。)
  • cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\obfuscator-llvm-4.0\obfuscator-llvm-4.0\ mingw32-make -j7


    注意點

    mingw編譯器版本不要太低,否則當用make指令的時候,就會出現如下圖所示這種報錯

    其實這里不能怪make指令,只能說camke的時候就已經錯了一堆了,然后make自然不通,總結為mingw編譯器版本太低

    總結

    以上是生活随笔為你收集整理的Windows环境下利用VS和mingw编译LLVM的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。