โซลูชันโอเพ่นซอร์สเต็มรูปแบบสำหรับการดัดแปลงและการสร้างซอร์สโค้ด C ++ ลดจำนวนรหัสหม้อไอน้ำในโครงการ C ++ ของคุณ
หน้าโครงการหลัก: https://blockspacer.github.io/flex_docs/
ทดสอบบน Ubuntu 20.04.2 Lts
อาจทำงานบนแพลตฟอร์มอื่น ๆ ที่มีการดัดแปลงเล็กน้อย
เพื่อให้สามารถเพิ่มรายการรีโมทการพึ่งพาได้โปรดพิมพ์คำสั่งต่อไปนี้:
cmake -E time conan config install conan/remotes/
# OR:
# cmake -E time conan config install conan/remotes_disabled_ssl/ คู่มือการติดตั้ง
แพ็คเกจโคนัน
หมายเหตุ: ยึดด้วย LLVM Build อาจใช้เวลาสองสามชั่วโมง
คำสั่งด้านล่างใช้ --profile clang12_compiler12_compiler
ตัวอย่างโปรไฟล์โคนัน ~/.conan/profiles/clang :
[ settings ]
# We are building in Ubuntu Linux
os_build=Linux
os=Linux
arch_build=x86_64
arch=x86_64
compiler=clang
compiler.version=10
compiler.libcxx=libstdc++11
[ env ]
CC=/usr/bin/clang-10
CXX=/usr/bin/clang++-10
[ build_requires ]
cmake_installer/3.15.5@conan/stableสร้างโปรไฟล์ Clang12_compiler:
[settings]
# We are building in Ubuntu Linux
os_build=Linux
os=Linux
arch_build=x86_64
arch=x86_64
compiler=clang
compiler.version=12
compiler.libcxx=libstdc++11
compiler.cppstd=17
llvm_9:build_type=Release
[env]
CC=/usr/bin/clang-12
CXX=/usr/bin/clang++-12
[build_requires]
cmake_installer/3.15.5@conan/stableก่อนที่จะสร้างไฟล์โปรไฟล์โคนันดู: https://docs.conan.io/en/latest/using_packages/using_profiles.html
เราใช้ .cmake script เพื่อดาวน์โหลดและติดตั้งแพ็คเกจ Conan
git clone https://github.com/blockspacer/conan_github_downloader.git ~ /conan_github_downloader
cmake
-DSCRIPT_PATH= " $PWD /get_conan_dependencies.cmake "
-DENABLE_CLING=TRUE
-DENABLE_LLVM=TRUE
-DENABLE_LLVM_INSTALLER=FALSE
-DEXTRA_CONAN_OPTS= " --profile;clang12_compiler
;-s;build_type=Debug
;-s;cling_conan:build_type=Release
;-s;llvm_12:build_type=Release
;--build;missing "
-P ~ /conan_github_downloader/conan_github_downloader.cmake
# clean build cache
conan remove " * " --build --force หากคุณต้องการติดตั้ง flextool และปลั๊กอินในคำสั่งเดียวให้เปลี่ยนตัวเลือกที่ให้เป็น tools/buildConanThirdparty.cmake
หมายเหตุ: tools/buildConanThirdparty.cmake จะทำการสร้างใหม่เต็มรูปแบบ; อาจใช้เวลาสองสามชั่วโมง
คำสั่งด้านล่างใช้ --profile clang12_compiler12_compiler ก่อนที่จะสร้างไฟล์โปรไฟล์โคนันดู: https://docs.conan.io/en/latest/using_packages/using_profiles.html
เราใช้สคริปต์ buildConanThirdparty.cmake เพื่อดาวน์โหลดและติดตั้งแพ็คเกจ Conan
หมายเหตุ: set -DENABLE_CLING=FALSE ถ้าคุณติดตั้งติดอยู่แล้วโดยใช้ tools/buildConanThirdparty.cmake ด้านบน
git clone https://github.com/blockspacer/conan_github_downloader.git ~ /conan_github_downloader
cmake
-DSCRIPT_PATH= " $PWD /get_conan_dependencies.cmake "
-DENABLE_CLING=TRUE
-DENABLE_LLVM=TRUE
-DENABLE_LLVM_INSTALLER=FALSE
-DENABLE_FLEXTOOL=TRUE
-DENABLE_BASIS_PLUGIN_HELPER=TRUE
-DENABLE_FLEX_REFLECT_PLUGIN=TRUE
-DENABLE_SQUARETS=TRUE
-DENABLE_FLEX_SQUARETS_PLUGIN=TRUE
-DENABLE_FLEX_PIMPL_PLUGIN=TRUE
-DENABLE_FLEX_TYPECLASS_PLUGIN=TRUE
-DENABLE_FLEX_META_PLUGIN=TRUE
-DENABLE_FLEX_META_DEMO=TRUE
-DEXTRA_CONAN_OPTS= " --profile;clang12_compiler
;-s;build_type=Debug
;-s;cling_conan:build_type=Release
;-s;llvm_12:build_type=Release
;--build;missing "
-P ~ /conan_github_downloader/conan_github_downloader.cmake
# clean build cache
conan remove " * " --build --forceใช้คำสั่งด้านล่างเพื่อสร้าง flextool ใหม่ (ต้องติดตั้งปลั๊กอินแยกต่างหาก)
คำสั่งด้านล่างใช้ --profile clang12_compiler12_compiler ก่อนที่จะสร้างไฟล์โปรไฟล์โคนันดู: https://docs.conan.io/en/latest/using_packages/using_profiles.html
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
# NOTE: change `build_type=Debug` to `build_type=Release` in production
# NOTE: use --build=missing if you got error `ERROR: Missing prebuilt package`
cmake -E time
conan create . conan/stable
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
--profile clang12_compiler
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
# clean build cache
conan remove " * " --build --forcecompile_commands.jsonปิดใช้งานการสร้างฐานข้อมูลการรวบรวมเมื่อคุณใช้ Flextool
หากคุณใช้ cmake ให้ตั้งค่า CMAKE_EXPORT_COMPILE_COMMANDS เป็น FALSE
หาก compile_commands.json มีอยู่ในโฟลเดอร์สร้าง (หรือในโฟลเดอร์หลัก) flextool อาจล้มเหลว
โครงการนี้เป็นไปได้เนื่องจาก autoprogrammer ของ Flexferrum
บทความเกี่ยวกับ autoprogrammer ของ Flexferrum ในสื่อ:
find . -type f -name " *_buildflags.h " -exec rm {} ;
find . -type f -name " *_buildflags.tmp " -exec rm {} ;
(rm -rf local_build || true)
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
export PKG_NAME=flextool/master@conan/stable
(CONAN_REVISIONS_ENABLED=1
conan remove --force $PKG_NAME || true)
# NOTE: use --build=missing if you got error `ERROR: Missing prebuilt package`
cmake -E time
conan install .
--install-folder local_build
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_12:build_type=Release
-o openssl:shared=True
-e basis:enable_tests=True
-o chromium_base:shared=True
-e chromium_base:enable_tests=True
-o perfetto:is_hermetic_clang=False
--profile clang12_compiler
-e flexlib:enable_tests=True
-o flexlib:shared=False
-o perfetto:is_hermetic_clang=False
-o flexlib:enable_cling=True
-e flextool:enable_tests=True
-o flextool:enable_cling=True
(rm local_build/CMakeCache.txt || true)
cmake -E time
conan source .
--source-folder .
--install-folder local_build
# You can use `cmake --build . -- -j14` on second run.
cmake -E time
conan build .
--build-folder local_build
--source-folder .
--install-folder local_build
conan package .
--build-folder local_build
--package-folder local_build/package_dir
--source-folder .
--install-folder local_build
cmake -E time
conan export-pkg . conan/stable
--package-folder local_build/package_dir
-s build_type=Debug
--force
-s cling_conan:build_type=Release
-s llvm_12:build_type=Release
-o openssl:shared=True
-e basis:enable_tests=True
-o chromium_base:shared=True
-e chromium_base:enable_tests=True
-o perfetto:is_hermetic_clang=False
--profile clang12_compiler
-e flexlib:enable_tests=True
-o flexlib:shared=False
-o perfetto:is_hermetic_clang=False
-o flexlib:enable_cling=True
-e flextool:enable_tests=True
-o flextool:enable_cling=True
cmake -E time
conan test test_package
flextool/master@conan/stable
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_12:build_type=Release
-o openssl:shared=True
-e basis:enable_tests=True
-o chromium_base:shared=True
-e chromium_base:enable_tests=True
-o perfetto:is_hermetic_clang=False
--profile clang12_compiler
-e flexlib:enable_tests=True
-o flexlib:shared=False
-o perfetto:is_hermetic_clang=False
-o flexlib:enable_cling=True
-e flextool:enable_tests=True
-o flextool:enable_cling=True ด้วยแพ็คเกจที่สามารถแก้ไขได้คุณสามารถบอกโคนันได้ที่ไหนที่จะหาส่วนหัวและสิ่งประดิษฐ์พร้อมสำหรับการบริโภคในไดเรกทอรีการทำงานในพื้นที่ของคุณ ไม่จำเป็นต้องเรียกใช้ conan create หรือ conan export-pkg
สำหรับรายละเอียดโปรดดู: https://docs.conan.io/en/latest/developing_packages/editable_packages.html
สร้างในพื้นที่:
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
cmake -E time
conan install .
--install-folder local_build
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
--profile clang12_compiler
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
cmake -E time
conan source .
--source-folder local_build
--install-folder local_build
conan build .
--build-folder local_build
--source-folder local_build
--install-folder local_build
conan package .
--build-folder local_build
--package-folder local_build/package_dir
--source-folder local_build
--install-folder local_buildตั้งค่าแพ็คเกจเป็นโหมดแก้ไขได้:
conan editable add local_build/package_dir
flextool/master@conan/stable โปรดทราบว่า conanfile.py ได้รับการแก้ไขเพื่อตรวจจับการสร้างท้องถิ่นผ่าน self.in_local_cache
หลังจากเปลี่ยนแหล่งที่มาในโฟลเดอร์ local_build (เรียกใช้คำสั่งในโฟลเดอร์แพ็คเกจต้นทาง):
conan build .
--build-folder local_build
--source-folder local_build
--install-folder local_build
conan package .
--build-folder local_build
--package-folder local_build/package_dir
--source-folder local_build
--install-folder local_build
สร้างโครงการทดสอบของคุณ
เพื่อที่จะเปลี่ยนโหมดแก้ไขได้เพียงลบลิงก์โดยใช้:
conan editable remove
flextool/master@conan/stable อนุญาตให้สร้างหลายโครงการพร้อมกัน มันเพียงแค่สร้าง CMakeLists.txt ด้วย add_subdirectory ชี้ไปที่แต่ละโฟลเดอร์แพ็คเกจ
หมายเหตุ: คุณสามารถเปิดพื้นที่ทำงานใน IDE ตามโครงการ CMAKE ตามปกติ (เปลี่ยนไดเรกทอรี Build เป็นเส้นทาง WorksPaceProject)!
สำหรับรายละเอียดโปรดดู: https://docs.conan.io/en/latest/developing_packages/workspaces.html
ตัวอย่างเช่นเราต้องการสร้างทั้ง Flextool และ Flexlib ในเวลาเดียวกัน (Flextool ต้องการ Flexlib)
# change ~ to desired build folder
cd ~
# Replace paths to yours!
# Make sure each project in NOT in editable mode!
cat << EOF > ~/conanws.yml
editables:
flexlib/master@conan/stable:
path: /......../flexlib
flextool/master@conan/stable:
path: /......../flextool
layout: layout_flex
workspace_generator: cmake
root:
- flextool/master@conan/stable
EOF
cat << EOF > ~/layout_flex
# This helps to define the location of CMakeLists.txt within package
[source_folder]
.
# This defines where the conanbuildinfo.cmake will be written to
[build_folder]
build/{{settings.build_type}}
EOF mkdir build_flex
cd build_flex
cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(WorkspaceProject)
include( $ {CMAKE_BINARY_DIR}/conanworkspace.cmake)
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flexlib_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flextool_SRC}/cmake")
conan_workspace_subdirectories()
add_dependencies(flextool flexlib)
EOF
# must contain `include(${CMAKE_BINARY_DIR}/conanworkspace.cmake)` without slash `` (slash added for bash cat command)
cat CMakeLists.txt
# combines options from all projects
conan workspace install
../conanws.yml
--profile=clang
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
-o openssl:shared=True
-o chromium_base:shared=True
-e basis:enable_tests=True
-e abseil:enable_llvm_tools=True
-o chromium_base:use_alloc_shim=True
-o chromium_tcmalloc:use_alloc_shim=True
-o perfetto:is_hermetic_clang=False
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
-o flexlib:shared=False
-o flexlib:enable_clang_from_conan=False
-e flexlib:enable_tests=True สร้างเป็นโฟลเดอร์ที่สร้างโดย conan workspace install :
# NOTE: change `build_type=Debug` to `build_type=Release` in production
export build_type=Debug
# optional
# remove old CMakeCache
(rm CMakeCache.txt || true)
# configure via cmake
cmake -E time cmake .
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DENABLE_TESTS=TRUE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=ON
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE= ${build_type}
# remove generated files
# change paths to yours
# rm ~/flex_typeclass_plugin/build/Debug/*generated*
# build code
cmake -E time cmake --build .
--config ${build_type}
-- -j8
# run unit tests for flexlib
cmake -E time cmake --build .
--config ${build_type}
--target flexlib_run_all_tests
# run unit tests for flextool
cmake -E time cmake --build .
--config ${build_type}
--target flextool_run_all_testsพื้นที่ทำงานช่วยให้สามารถเปลี่ยนแปลงไฟล์ต้นฉบับที่มีอยู่ได้อย่างรวดเร็ว
เราใช้ self.in_local_cache เพื่อตรวจจับโหมดแก้ไขได้ของ Conan:
# Local build
# see https://docs.conan.io/en/latest/developing_packages/editable_packages.html
if not self . in_local_cache :
self . copy ( "conanfile.py" , dst = "." , keep_path = False )ตรวจสอบให้แน่ใจว่าเป้าหมายทั้งหมดมีชื่อที่ไม่ซ้ำกันทั่วโลก
ตัวอย่างเช่น: คุณไม่สามารถมีเป้าหมายในแต่ละโครงการที่มีชื่อเดียวกันเช่น "ทดสอบ" คุณสามารถแก้ปัญหานั้นได้โดยการเพิ่มคำนำหน้าเฉพาะโครงการลงในชื่อของแต่ละเป้าหมายเช่น "$ {root_project_name} -test_main_gtest"
เนื่องจาก CMAKE_BINARY_DIR จะชี้ไปที่โฟลเดอร์ที่สร้างโดย conan workspace install ตรวจสอบให้แน่ใจว่าคุณชอบ CMAKE_CURRENT_BINARY_DIR เป็น CMAKE_BINARY_DIR ฯลฯ
ก่อนการติดตั้ง: ปลั๊กอินต้องใช้ flextool ที่สร้างไว้ล่วงหน้า (ในพื้นที่ทำงานเดียวกัน) คุณต้องสร้างพื้นที่ทำงานโดยไม่มีปลั๊กอิน จากนั้นคุณจะสามารถสร้างใหม่ด้วยปลั๊กอิน
เพิ่มปลั๊กอินลงในไฟล์ YML:
editables :
chromium_base/master@conan/stable :
path : /........./chromium_base
basis/master@conan/stable :
path : /........./basis
flex_support_headers/master@conan/stable :
path : /........./flex_support_headers
flexlib/master@conan/stable :
path : /........./flexlib
flextool/master@conan/stable :
path : /........./flextool
flex_reflect_plugin/master@conan/stable :
path : /........./flex_reflect_plugin
squarets/master@conan/stable :
path : /........./squarets
flex_squarets_plugin/master@conan/stable :
path : /........./flex_squarets_plugin
flex_typeclass_plugin/master@conan/stable :
path : /........./flex_typeclass_plugin
flex_pimpl_plugin/master@conan/stable :
path : /........./flex_pimpl_plugin
flex_meta_plugin/master@conan/stable :
path : /........./flex_meta_plugin
flex_meta_demo/master@conan/stable :
path : /........./flex_meta_demo
layout : layout_flex
workspace_generator : cmake
root :
- flex_reflect_plugin/master@conan/stable
- squarets/master@conan/stable
- flex_squarets_plugin/master@conan/stable
- flex_typeclass_plugin/master@conan/stable
- flex_pimpl_plugin/master@conan/stable
- flex_meta_plugin/master@conan/stable
- flex_meta_demo/master@conan/stable ใช้ add_dependencies ใน CMakeLists.txt :
mkdir build_flex
cd build_flex
cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(WorkspaceProject)
include( $ {CMAKE_BINARY_DIR}/conanworkspace.cmake)
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_chromium_base_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_basis_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_support_headers_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flexlib_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_reflect_plugin_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_squarets_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_squarets_plugin_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_typeclass_plugin_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_meta_plugin_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_meta_demo_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flex_pimpl_plugin_SRC}/cmake")
list(PREPEND CMAKE_MODULE_PATH " $ {PACKAGE_flextool_SRC}/cmake")
conan_workspace_subdirectories()
add_dependencies(basis chromium_base-static)
add_dependencies(flexlib basis)
add_dependencies(flextool flexlib basis flex_support_headers)
add_dependencies(flex_reflect_plugin flextool)
add_dependencies(flex_squarets_plugin squarets)
add_dependencies(flex_squarets_plugin flextool)
add_dependencies(flex_pimpl_plugin flextool)
add_dependencies(flex_pimpl_plugin flex_reflect_plugin)
add_dependencies(flex_pimpl_plugin flex_squarets_plugin)
add_dependencies(flex_typeclass_plugin flextool)
add_dependencies(flex_typeclass_plugin flex_squarets_plugin)
add_dependencies(flex_meta_demo flex_meta_plugin)
add_dependencies(flex_meta_demo flex_typeclass_plugin)
add_dependencies(flex_meta_demo flex_pimpl_plugin)
add_dependencies(flex_meta_demo flex_squarets_plugin)
EOF เพิ่มตัวเลือกปลั๊กอินลงใน conan workspace install :
# combines options from all projects
conan workspace install
../conanws.yml
--profile=clang
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
-e basis:enable_tests=True
-o openssl:shared=True
-o chromium_base:shared=True
-o chromium_base:use_alloc_shim=True
-o perfetto:is_hermetic_clang=False
-o chromium_tcmalloc:use_alloc_shim=True
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
-o flexlib:shared=False
-o flexlib:enable_clang_from_conan=False
-e flexlib:enable_tests=True
-o flex_reflect_plugin:shared=True
-o flex_reflect_plugin:enable_clang_from_conan=False
-e flex_reflect_plugin:enable_tests=True
-o squarets:shared=False
-o squarets:enable_clang_from_conan=False
-e squarets:enable_tests=True
-o flex_squarets_plugin:shared=False
-o flex_squarets_plugin:enable_clang_from_conan=False
-e flex_squarets_plugin:enable_tests=True
-o flex_meta_plugin:shared=False
-o flex_meta_plugin:enable_clang_from_conan=False
-e flex_meta_plugin:enable_tests=True
-o flex_typeclass_plugin:shared=False
-o flex_typeclass_plugin:enable_clang_from_conan=False
-e flex_typeclass_plugin:enable_tests=True
-o flex_pimpl_plugin:shared=False
-o flex_pimpl_plugin:enable_clang_from_conan=False
-e flex_pimpl_plugin:enable_tests=True
-o flex_meta_demo:enable_clang_from_conan=False
-e flex_meta_demo:enable_tests=Trueสร้างและทดสอบพื้นที่ทำงาน:
# NOTE: change `build_type=Debug` to `build_type=Release` in production
export build_type=Debug
# optional
# remove old CMakeCache
(rm CMakeCache.txt || true)
# configure via cmake
cmake -E time cmake .
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DENABLE_TESTS=TRUE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=ON
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE= ${build_type}
# remove generated files
# change paths to yours
# rm ~/flex_typeclass_plugin/build/Debug/*generated*
# build code
cmake -E time cmake --build .
--config ${build_type}
-- -j8
# run unit tests for flexlib
cmake -E time cmake --build .
--config ${build_type}
--target flexlib_run_all_tests
# run unit tests for flextool
cmake -E time cmake --build .
--config ${build_type}
--target flextool_run_all_tests
# run unit tests for flex_reflect_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_reflect_plugin_run_all_tests
# run unit tests for squarets
cmake -E time cmake --build .
--config ${build_type}
--target squarets_run_all_tests
# run unit tests for flex_squarets_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_squarets_plugin_run_all_tests
# run unit tests for flex_squarets_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_meta_plugin_run_all_tests
# run unit tests for flex_squarets_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_typeclass_plugin_run_all_tests
# run unit tests for flex_squarets_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_pimpl_plugin_run_all_tests
# run unit tests for flex_squarets_plugin
cmake -E time cmake --build .
--config ${build_type}
--target flex_meta_demo_run_all_tests ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
ติดตั้ง CPPCHECK ผ่าน Conan:
cd /tmp
git clone -b testing/1.90 https://github.com/bincrafters/conan-cppcheck_installer.git
cd conan-cppcheck_installer
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
# NOTE: change `build_type=Debug` to `build_type=Release` in production
# NOTE: use --build=missing if you got error `ERROR: Missing prebuilt package`
cmake -E time
conan create . conan/stable
-s build_type=Release
# clean build cache
conan remove " * " --build --force การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_CPPCHECK=ON ):
# creates local build in separate folder and runs cmake targets
# NOTE: -DCLEAN_OLD="OFF" to keep generated html report
cmake -DCPPCHECK= " ON " -DCLEAN_OLD= " OFF " -P tools/run_tool.cmake # `index.html` must exist
# find $PWD -name index.htmlเปิด 'index.html' เพื่อดูผลลัพธ์
แอปพลิเคชันเดสก์ท็อปที่ให้บริบทเดียวในการจัดการและเรียกใช้สคริปต์หลายรายการ
ลดความซับซ้อนของการตั้งค่าของสภาพแวดล้อมในท้องถิ่น สิ่งนี้หลีกเลี่ยงการเปิดขั้วเปลือกหอยจำนวนมาก
คุณสามารถเพิ่มคำสั่งที่กำหนดเองใน package.json หรือ plugin/vue-cli-plugin/ui.js :
# Before: Install Latest Node.js and NPM
# see https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/
node --version
npm --versionสร้างโครงการของคุณผ่าน NPM:
npm installsudo npm install -g @vue/cli
sudo vue ui --dev --port 8061 เปิด http://localhost:8061/
นำเข้าไดเรกทอรีโครงการ
เลือก Tasks เช่น build/test ...
งานอาจมีการเปลี่ยนแปลงใน package.json
หมายเหตุ: เราใช้ package.json สำหรับงานเท่านั้น โคนันถูกควบคุมโดยไฟล์ที่เรียกว่า conanfile.txt
ลิงค์ที่มีประโยชน์:
เราใช้ .gdbinit เพิ่ม 'add-auto-load-safe-path'
สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับ .gdbinit อ่าน: https://metricpanda.com/tips-for-productive-debugging-with-gdb
สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับ gdb อ่าน: http://www.yolinux.com/tutorials/gdb-commands.html
เซสชันการดีบัก GDB สามารถเป็นไปได้โดยอัตโนมัติเช่น:
# see https://gist.github.com/williballenthin/8bd6e29ad8504b9cb308039f675ee889
gdb
-ex " run "
-ex " set pagination off "
-ex " bt "
-ex " set confirm off "
-ex " quit "
--args
${APP_EXE}
${APP_CMD_ARGS} ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
สำหรับรายละเอียดดู:
ติดตั้ง Valgrind:
sudo apt install valgrind # Ubuntu, Debian, etc.
# OR
sudo yum install valgrind # RHEL, CentOS, Fedora, etc. หมายเหตุ: ตรวจสอบให้แน่ใจว่าคุณตั้งค่า use_alloc_shim=False และ enable_valgrind=True (ดูด้านล่าง)
เรียกใช้ valgrind ผ่าน cmake:
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
# NOTE: set `use_alloc_shim=False` and `enable_valgrind=True` for valgrind support
cmake -E time
conan install .
--install-folder local_build_valgrind
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
--profile clang12_compiler
-o flextool:enable_valgrind=True
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
-e abseil:enable_llvm_tools=True
-o chromium_base:enable_valgrind=True
-e chromium_base:enable_llvm_tools=True
-o chromium_base:use_alloc_shim=False
-o perfetto:is_hermetic_clang=False
-o basis:enable_valgrind=True
-e basis:enable_llvm_tools=True
-o flexlib:enable_valgrind=True
-e flexlib:enable_llvm_tools=True
-o flexlib:enable_clang_from_conan=False
-o chromium_tcmalloc:use_alloc_shim=False
--build chromium_base
--build chromium_tcmalloc
--build basis
--build flexlib
cd ~ /flextool
# see section about `conan editable mode`
cd local_build_valgrind
# optional
# remove old CMakeCache
(rm CMakeCache.txt || true)
# remove old build artifacts
rm -rf flextool
rm -rf bin
find . -iname ' *.o ' -exec rm {} ;
find . -iname ' *.a ' -exec rm {} ;
find . -iname ' *.dll ' -exec rm {} ;
find . -iname ' *.lib ' -exec rm {} ;
# NOTE: -DENABLE_VALGRIND=ON
cmake ..
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DENABLE_VALGRIND=ON
-DENABLE_TESTS=TRUE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=ON
-DENABLE_VALGRIND_TESTS=TRUE
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE=Debug
# NOTE: to run some tests under valgrind
# use `-DENABLE_VALGRIND_TESTS=TRUE`
cmake -E time cmake --build .
--target flextool-gmock_run_valgrind
# Cmake will print valgrind command that was executed.
# You can copy executed command and add custom command-line arguments:
# --gtest_filter=ToolsSanityTest.DISABLED_ValgrindTest
# --gtest_also_run_disabled_tests
# search for valgrind log file
find $PWD -name * valgrind * .log ในการค้นหาการรั่วไหลคุณสามารถ seach สำหรับ definitely lost
หมายเหตุ: คุณสามารถเพิ่มการปราบปราม valgrind ใน cmake/valgrind.cfg
หมายเหตุ: โปรแกรมรวบรวมด้วยธงดีบั๊กเพื่อทำงานภายใต้ Valgrind
หมายเหตุ: ใช้ valgrind --tool=helgrind เพื่อตรวจจับการหยุดชะงักที่อาจเกิดขึ้นและการแข่งขันข้อมูล
หมายเหตุ: ใช้ valgrind --tool=massif --massif-out-file=massif_file --stacks=true เพื่อวัดขนาดของฮีป ดูเพิ่มเติมที่: https://kde.org/applications/development/org.kde.massif-visualizer
สำหรับรายละเอียดโปรดดู: https://stackoverflow.com/a/44989219
TODO: ลองสร้างด้วย Valgrind และ Clang 10 https://stackoverflow.com/questions/40509986/valgrind-reporting-mismatched-free-delete
TODO: Valgrind อาจไม่รองรับฐานโครเมียม FixMe และลบ gtest_no_suite
ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
ติดตั้ง clang-tidy:
sudo apt-get install clang-tidy # Ubuntu, Debian, etc.
# OR
sudo yum install clang-tidy # RHEL, CentOS, Fedora, etc. การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_CLANG_TIDY=ON ):
# creates local build in separate folder and runs cmake targets
cmake -DCLANG_TIDY= " ON " -DCLEAN_OLD= " ON " -P tools/run_tool.cmake ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
สำหรับรายละเอียดโปรดดูที่: https://chromium.googleource.com/chromium/src.git/+/master/docs/clang_static_analyzer.md และ https://clang-analyzer.lvm.org/scan-build.html.html.html.html.
โปรแกรม CCC-analyzer ทำหน้าที่เหมือนคอมไพเลอร์ปลอมส่งต่อการโต้แย้งบรรทัดคำสั่งไปยังคอมไพเลอร์เพื่อทำการรวบรวมปกติและเสียงดังก้องเพื่อทำการวิเคราะห์แบบคงที่
การเรียกใช้การกำหนดค่าโดยทั่วไปจะสร้าง makefiles ที่มีเส้นทางเดินสายไปยังคอมไพเลอร์และโดยการเรียกใช้การกำหนดค่าผ่านการสแกนที่เส้นทางนั้นถูกตั้งค่าเป็น CCC-Analyzer
# must exist
ccc-analyzer -v
# must exist
c++-analyzer -v
# must exist
scan-build -v
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
cmake -E time
conan install .
--install-folder local_build_scan_build
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
--profile clang12_compiler
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
cmake -E time
conan source .
--source-folder local_build_scan_build
--install-folder local_build_scan_build
# see section about `conan editable mode`
cd local_build_scan_build
# NOTE: change `build_type=Debug` to `build_type=Release` in production
export build_type=Debug
# optional
# remove old CMakeCache
(rm CMakeCache.txt || true)
# NOTE: changed CMAKE_C_COMPILER to ccc-analyzer (!!!)
# configure via cmake
scan-build
--use-cc=clang-10
--use-c++=clang++-10
-o ./scanbuildout/
cmake ..
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DCMAKE_C_COMPILER=ccc-analyzer
-DCMAKE_CXX_COMPILER=c++-analyzer
-DENABLE_TESTS=FALSE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=OFF
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE= ${build_type}
# remove old build artifacts
(make clean || true)
rm -rf bin
# NOTE: requires project configured in debug build
# disable other static analyzers
# run from build directory
scan-build
-maxloop 8
-enable-checker alpha.security.taint.TaintPropagation
-enable-checker alpha.core.BoolAssignment
-enable-checker alpha.core.CastSize
-enable-checker alpha.core.DynamicTypeChecker
-enable-checker alpha.core.FixedAddr
-enable-checker alpha.core.IdenticalExpr
-enable-checker alpha.core.PointerArithm
-enable-checker alpha.core.PointerSub
-enable-checker alpha.core.SizeofPtr
-enable-checker alpha.core.TestAfterDivZero
-enable-checker alpha.deadcode.UnreachableCode
-enable-checker alpha.security.ArrayBoundV2
-enable-checker alpha.security.MallocOverflow
-enable-checker alpha.security.ReturnPtrRange
-enable-checker alpha.unix.PthreadLock
-enable-checker alpha.unix.Stream
-enable-checker alpha.unix.cstring.BufferOverlap
-enable-checker alpha.unix.cstring.NotNullTerminated
-enable-checker alpha.unix.cstring.OutOfBounds
-enable-checker nullability.NullableDereferenced
-enable-checker optin.performance.Padding
-enable-checker security.insecureAPI.rand
-enable-checker security.insecureAPI.strcpy
--use-cc=clang-10
--use-c++=clang++-10
-o ./scanbuildout/
make
-j8 เปิดไฟล์ scanbuildout/...../index.html ไฟล์
ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
สำหรับรายละเอียดโปรดดู: https://github.com/myint/cppclean
การติดตั้ง:
pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --upgrade cppclean การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_CPPCLEAN=ON ):
# creates local build in separate folder and runs cmake targets
cmake -DCPPCLEAN= " ON " -DCLEAN_OLD= " ON " -P tools/run_tool.cmake หมายเหตุ: CPPClean ต้องการการเข้ารหัสไฟล์เป็น: UTF-8 without BOM (ASCII)
ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
รวม-สิ่งที่คุณใช้ (iwyu) เป็นโครงการที่มีวัตถุประสงค์เพื่อเพิ่มประสิทธิภาพรวมถึง
มันจะคำนวณส่วนหัวที่ต้องการและเพิ่ม / ลบรวมถึงความเหมาะสม
สำหรับรายละเอียดโปรดดู: https://include-what-you-use.org/
การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_IWYU=ON ):
# creates local build in separate folder and runs cmake targets
cmake -DIWYU= " ON " -DCLEAN_OLD= " ON " -P tools/run_tool.cmake Codestyle: ใช้ // IWYU pragma: associated ในไฟล์ต้นฉบับ C ++
หมายเหตุ: อ่านเกี่ยวกับ Iwyu Pragmas: https://github.com/include-what-heou-use/include-what-heou-use/blob/master/docs/iwyupragmas.md
หมายเหตุ: อย่าใช้ "บิต/" หรือ "/รายละเอียด/*" รวมเพิ่มลงในไฟล์แม็พ (.imp)
สำหรับรายละเอียดดู:
ใช้ -DUSE_CCACHE=ON
gcc -v
export CC=gcc
export CXX=g++
# NOTE: -DUSE_CCACHE=ON
cmake ..
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DUSE_CCACHE=ON
-DENABLE_TESTS=FALSE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=OFF
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE=Debugสำหรับรายละเอียดโปรดดู: https://www.virag.si/2015/07/use-ccache-with-cmake-for-faster-compilation/
เพื่อให้ได้ประโยชน์สูงสุดจาก ccache ให้ใส่สิ่งนี้ใน: ~/.ccache/ccache.conf :
max_size = 50.0G # or whatever cache size you prefer; default is 5G; 0 means unlimited
base_dir = /home/yourname # or wherever you keep your source files หมายเหตุ: base_dir เป็นสิ่งจำเป็นสำหรับ CCACE ในการแบ่งปันการรวบรวมแคชของไฟล์เดียวกันในที่เก็บ / พา ธ ที่แตกต่างกัน มันจะทำสิ่งนี้สำหรับเส้นทางภายใต้ base_dir ดังนั้นตัวเลือกนี้จึงจำเป็นสำหรับการใช้งาน CCACHE กับ GIT Worktrees (อธิบายไว้ด้านล่าง)
คุณต้องไม่ตั้งค่า base_dir เป็น "/" หรือที่ใดก็ได้ที่มีส่วนหัวของระบบ (ตามเอกสาร ccache)
การติดตั้ง:
sudo apt-get install ccache
# On OS X use homebrew:
# brew install ccache
ccache --version ใช้ -DUSE_LD_GOLD=ON
gcc -v
export CC=gcc
export CXX=g++
# NOTE: -DUSE_LD_GOLD=ON
cmake ..
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DUSE_LD_GOLD=ON
-DENABLE_TESTS=FALSE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=OFF
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE=Debugสำหรับรายละเอียดโปรดดู: https://cristianadam.eu/20170709/Speeding-up-cmake/
หมายเหตุ: ทองไม่เกลียวตามค่าเริ่มต้นกำหนดค่าด้วย "-enable-threads"
หมายเหตุ: LLD เกลียวโดยค่าเริ่มต้นอาจเร็วกว่าทองคำ
ตรวจสอบให้แน่ใจว่าคุณใช้ build Debug ด้วย -e flextool:enable_llvm_tools=True
สำหรับรายละเอียดโปรดดู: https://oclint-docs.readthedocs.io/en/stable/devel/codingstandards.html
การติดตั้ง:
cd ~
wget --no-check-certificate https://github.com/oclint/oclint/releases/download/v0.13.1/oclint-0.13.1-x86_64-linux-4.4.0-112-generic.tar.gz
# mirror 1: http://github.strcpy.cn/oclint/oclint/releases/download/v0.13.1/oclint-0.13.1-x86_64-linux-4.4.0-112-generic.tar.gz
# mirror 2: http://archives.oclint.org/releases/0.8/oclint-0.8.1-x86_64-linux-3.13.0-35-generic.tar.gz
tar -xzvf oclint-0.13.1-x86_64-linux-4.4.0-112-generic.tar.gz
rm -rf oclint-0.13.1-x86_64-linux-4.4.0-112-generic.tar.gz
export OCLINT_HOME= ~ /oclint-0.13.1
export PATH= $OCLINT_HOME /bin: $PATH
oclint -version การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_OCLINT=ON ):
# NOTE: -DCLEAN_OLD="OFF" to keep generated html report
# creates local build in separate folder and runs cmake targets
cmake -DOCLINT= " ON " -DCLEAN_OLD= " OFF " -P tools/run_tool.cmake # `report.html` must exist
# find $PWD -name report.htmlเปิด report.html
ดูการสอน Oclint: http://docs.oclint.org/en/stable/intro/tutorial.html
ดูรายการกฎ Oclint ที่: https://oclint-docs.readthedocs.io/en/stable/rules/
หมายเหตุ: คุณสามารถระงับคำเตือน Oclint ได้
สำหรับรายละเอียดโปรดดู: https://clang.llvm.org/docs/clangformat.html
การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_CLANG_FORMAT=ON ):
# creates local build in separate folder and runs cmake targets
cmake -DCLANG_FORMAT= " ON " -DCLEAN_OLD= " ON " -P tools/run_tool.cmake เราใช้ไฟล์ .clang-format สำหรับรายละเอียดโปรดดู: https://clang.llvm.org/docs/clangformatstyleoptions.html
หมายเหตุ: เราใช้ DisableFormat ดังนั้นรูปแบบเสียงดังจะเปลี่ยนรวมถึงคำสั่งซื้อตาม SortIncludes เท่านั้น
น่าเสียดายที่ clang-format ไม่สามารถกำหนดค่าได้เพียงพอดังนั้นจึงสามารถใช้ในการเรียงลำดับรวมได้เท่านั้น ดู: https://stackoverflow.com/a/32191189
เราใช้ bacause clang-format และ Astyle ที่ไม่ได้รับการสนับสนุนไม่สนับสนุนตัวเลือกมากมาย
สำหรับรายละเอียดโปรดดู: https://patrickhenson.com/2018/06/07/uncrustify-configuration.html
การติดตั้ง:
cd ~
git clone https://github.com/uncrustify/uncrustify.git
cd uncrustify
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
export UNCRUSTIFY_HOME= ~ /uncrustify/build
export PATH= $UNCRUSTIFY_HOME : $PATH
# OR sudo make install
uncrustify --version การใช้งาน (เรียกใช้ cmake ด้วย -DENABLE_UNCRUSTIFY=ON ):
# creates local build in separate folder and runs cmake targets
cmake -DUNCRUSTIFY= " ON " -DCLEAN_OLD= " ON " -P tools/run_tool.cmake เราใช้ไฟล์ uncrustify.cfg สำหรับรายละเอียดโปรดดู: https://patrickhenson.com/2018/06/07/uncrustify-configuration.html
เพื่อรับรายการตัวเลือกที่มีอยู่ทั้งหมดใช้:
uncrustify --show-configUncrustify มีตัวเลือกที่กำหนดค่าได้มากมาย คุณอาจต้องการ GUI เยื้อง Universal (ในการตอบกลับของ Konstantin) เช่นกันเพื่อกำหนดค่า: http://universalindent.sourceforge.net/
ใช้ความคิดเห็นที่มี /* *INDENT-OFF* */ และ /* *INDENT-ON* */ เพื่อปิดการประมวลผลส่วนต่าง ๆ ของไฟล์ต้นฉบับ
ดู disable_processing_cmt จาก uncrustify.cfg :
# Specify the marker used in comments to disable processing of part of the
# file.
# The comment should be used alone in one line.
#
# Default: *INDENT-OFF*
disable_processing_cmt = " *INDENT-OFF* " # string
# Specify the marker used in comments to (re)enable processing in a file.
# The comment should be used alone in one line.
#
# Default: *INDENT-ON*
enable_processing_cmt = " *INDENT-ON* " # string คุณสามารถรวม uncrustify กับ IDE:
ดู https://github.com/blockspacer/llvm_9_installer#how-to-use-with-sanitizers
ต้องการ enable_llvm_tools=True , compile_with_llvm_tools=True และ llvm_tools:build_type=Release :
-s llvm_tools:build_type=Release
-e flextool:enable_llvm_tools=True
-e flextool:compile_with_llvm_tools=True
-o llvm_tools:include_what_you_use=True
...enable_llvm_tools ติดตั้ง clang 10 จาก Conancompile_with_llvm_tools ตั้งค่าตัวแปร cmake ที่จำเป็นในการใช้ clang 10 จาก Conan รัน conan install หรือ conan create ด้วย:
# OR create conan profile https://docs.conan.io/en/latest/reference/profiles.html
-s compiler=clang
-s compiler.version=10
-s compiler.libcxx=libc++ หมายเหตุ: การเปลี่ยนแปลงของคอมไพเลอร์อาจต้องสร้าง DEP ทั้งหมดใหม่ ( --build=missing )
ตัวอย่างในกรณีของการสร้างท้องถิ่น:
export CC= $( find ~ /.conan/data/llvm_tools/master/conan/stable/package/ -path " *bin/clang " | head -n 1 )
export CXX= $( find ~ /.conan/data/llvm_tools/master/conan/stable/package/ -path " *bin/clang++ " | head -n 1 )
export VERBOSE=1
export CONAN_REVISIONS_ENABLED=1
export CONAN_VERBOSE_TRACEBACK=1
export CONAN_PRINT_RUN_COMMANDS=1
export CONAN_LOGGING_LEVEL=10
# NOTE: NO `--profile` argument cause we use `CXX` env. var
# NOTE: you may want to re-build `cling_conan` with clang 10
cmake -E time
conan install .
--install-folder local_build_clang_10
-s build_type=Debug
-s cling_conan:build_type=Release
-s llvm_tools:build_type=Release
--build missing
--build cascade
-s cling_conan:compiler=clang
-s cling_conan:compiler.version=10
-s cling_conan:compiler.libcxx=libstdc++11
-o llvm_tools:include_what_you_use=True
-s llvm_tools:compiler=clang
-s llvm_tools:compiler.version=10
-s llvm_tools:compiler.libcxx=libstdc++11
-e flextool:enable_tests=True
-e flextool:enable_llvm_tools=True
-e flextool:compile_with_llvm_tools=True
-e boost:enable_llvm_tools=True
-e boost:compile_with_llvm_tools=True
-s compiler=clang
-s compiler.version=10
-s compiler.libcxx=libc++
cmake -E time
conan source .
--source-folder local_build_clang_10
--install-folder local_build_clang_10
# remove old CMakeCache
(rm local_build_clang_10/CMakeCache.txt || true)
# see section about `conan editable mode`
conan build .
--build-folder local_build_clang_10
--source-folder local_build_clang_10
--install-folder local_build_clang_10ทำการตรวจสอบ:
# check that `libcpp` symbol exists
nm -an EXECUTABLE_PATH | grep libcpp
# list linked dynamic libs
ldd EXECUTABLE_PATH MCSS_ROOT_DIR_FOR_DOCS จะต้องชี้ไปที่แหล่งข้อมูล m.css เช่นด้านล่าง:
cd ~
git clone https://github.com/mosra/m.css.git
pip3 install jinja2 Pygments
sudo apt install
texlive-base
texlive-latex-extra
texlive-fonts-extra
texlive-fonts-recommended
sudo apt-get install doxygen
sudo apt install python3-pip
# /usr/bin/python must point to python3
/usr/bin/python --version
# NOTE: switch to python3 for doxygen or use -DPYTHON_EXECUTABLE=/usr/bin/python3
alias python= ' /usr/bin/python3 '
# You may need sudo here
pip3 install jinja2 Pygments
sudo apt install
texlive-base
texlive-latex-extra
texlive-fonts-extra
texlive-fonts-recommended ใช้ cmake build กับ '-เป้าหมาย doxydoc' และ -DBUILD_DOXY_DOC=ON
cd ~ /flextool
# see section about `conan editable mode`
cd local_build_clang_10
# optional
# remove old CMakeCache
(rm CMakeCache.txt || true)
# remove old build artifacts
rm -rf flextool
rm -rf bin
find . -iname ' *.o ' -exec rm {} ;
find . -iname ' *.a ' -exec rm {} ;
find . -iname ' *.dll ' -exec rm {} ;
find . -iname ' *.lib ' -exec rm {} ;
# remove old build docs
rm -rf doc-mcss
rm -rf docs
cmake -E make_directory " doc-mcss "
# NOTE: you can change python version like so: -DPYTHON_EXECUTABLE=/usr/bin/python3
cmake ..
-DCMAKE_VERBOSE_MAKEFILE=TRUE
-DMCSS_ROOT_DIR_FOR_DOCS= $HOME /m.css
-DPYTHON_EXECUTABLE=/usr/bin/python3
-DENABLE_TESTS=TRUE
-DBASE_NEED_GEN_BUILD_DATE=FALSE
-DENABLE_DOCTEST=ON
-DBUILD_DOXY_DOC=ON
-DBUILD_SHARED_LIBS=FALSE
-DCONAN_AUTO_INSTALL=OFF
-DCMAKE_BUILD_TYPE=Debug
-DDOXY_ROOT_DIR= $PWD /doc-mcss
-DDOXY_DOC_COMMON_IMG_PATH= $PWD /..
-DPROJECT_SOURCES_DIR_FOR_DOCS= $PWD /../src
cmake -E time cmake --build .
--target doxyDoc_notheme
cmake -E time cmake --build .
--target doxyDoc
# Use to find index.html
find $PWD -name * .htmlเปิด doxydoc/html/index.html
หมายเหตุ: เอกสารเนมสเปซใน docs/namespaces.dox
หมายเหตุ: ไฟล์ไดเรกทอรีและสัญลักษณ์ที่ไม่มีเอกสารประกอบอยู่ในเอาต์พุตเลย
รูปแบบความคิดเห็นที่ใช้:
/ **
* @brief Path utils
*
* Example usage:
*
* @code{.cpp}
* const ::fs::path workdir = storage::getThisBinaryDirectoryPath ();
* @endcode
** /ดู:
สำหรับรายละเอียดโปรดดู: https://afl-1.readthedocs.io/en/latest/index.html
หมายเหตุ: ชอบ github.com/google/afl หรือ aflplus.plus เพื่อไม่อัปเดต AFL จาก lcamtuf.coredump.cx/afl
Fuzzing เป็นเทคนิคการทดสอบซอฟต์แวร์กล่องดำ
การฟัซซิงประกอบด้วยการค้นหาข้อบกพร่องในการใช้งานโดยใช้การฉีดข้อมูลที่ไม่ถูกต้อง/กึ่งขั้วในแบบอัตโนมัติ
Fuzzer พยายามปรับเปลี่ยนอินพุตเพื่อให้สามารถเข้าถึงบรรทัดของรหัสโปรแกรมให้ได้มากที่สุด
ดังนั้นการฟัซซิ่งช่วยให้การค้นพบช่องโหว่ที่อยู่ในเส้นทางรหัสที่ยากที่จะเข้าถึงได้โดยการใช้งานปกติ
ติดตั้ง + รวบรวมซอร์สโค้ดโดยใช้คำสั่งต่อไปนี้:
# optional
# sudo apt-get update
# optional
# sudo apt-get -y install autoconf automake bison build-essential
ca-certificates llvm-dev libtool libtool-bin
libglib2.0-dev make nasm wget
# Tested with clang 10 and gcc 7
sudo apt-get -y install clang-10 g++-7 gcc-7
export CXX=g++-7
export CC=gcc-7
export PATH=/usr/bin/: $PATH
$CC -v
# llvm-config binary that coresponds to the same clang you are using to compile
export LLVM_CONFIG=/usr/bin/llvm-config-10
$LLVM_CONFIG --cxxflags
cd ~
git clone -b v2.56b https://github.com/google/AFL.git --recursive
# NOTE: original AFL not updated since November 2017,
# so prefer `google/AFL.git` to `lcamtuf.coredump.cx/afl`
# wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
# tar -xf afl-latest.tgz
# rm afl-latest.tgz
# cd afl*
cd AFL
make
# build llvm using the sample compiler as afl code uses
# see https://groups.google.com/forum/#!topic/afl-users/1WqZpGXvYY0
make
-C llvm_mode
LLVM_CONFIG= $LLVM_CONFIG
CC=clang-10
CXX=clang++-10
#
# optional
# cd qemu_mode
# ./build_qemu_support.sh
# cd ..
#
make
-C libdislocator
make
-C libtokencap
sudo make install
# OR add to PATH via export PATH=$PATH:...
# do not forget to reset CC and LLVM_CONFIG
unset CXX
unset CC
unset LLVM_CONFIG เรารวบรวมรหัสโดยใช้คอมไพเลอร์ AFL: -DCMAKE_C_COMPILER=afl-clang-fast , -DCMAKE_CXX_COMPILER=afl-clang-fast++ และ -DCMAKE_LINKER=afl-clang-fast
เพื่อตรวจสอบว่าไบนารีใช้คอมไพเลอร์ AFL: nm BINARY_PATH | grep afl
ในการสร้างแอปพลิเคชันด้วย sanitizers และข้อมูลการดีบักบางอย่างที่เปิดใช้งาน: ( -DENABLE_ASAN=ON ฯลฯ ):
หมายเหตุ: มีบางสิ่งที่ต้องพิจารณาเมื่อใช้ที่อยู่ฆ่าเชื้อ แม้ว่า Asan จะพบการละเมิดการเข้าถึงหน่วยความจำ แต่ก็ไม่ได้ทำให้แอปพลิเคชันผิดพลาดโดยอัตโนมัติ นี่เป็นปัญหาเมื่อใช้เครื่องมือฟัซซิ่งอัตโนมัติเพราะพวกเขามักจะพยายามตรวจจับ Segfaults โดยการตรวจสอบรหัสส่งคืน อย่างไรก็ตามเราสามารถบังคับให้ ASAN ขัดข้องซอฟต์แวร์เมื่อเกิดข้อผิดพลาดเกิดขึ้นกับตัวแปรสภาพแวดล้อม ASAN_OPTIONS ก่อนที่จะฟัซซิง: export ASAN_OPTIONS='abort_on_error=1'
หมายเหตุ: ปิดใช้งานฟังก์ชั่นการจัดสรรหน่วยความจำที่กำหนดเอง สิ่งนี้สามารถซ่อนข้อบกพร่องการเข้าถึงหน่วยความจำและป้องกันการตรวจจับข้อผิดพลาดการเข้าถึงหน่วยความจำ
# see https://afl-1.readthedocs.io/en/latest/instrumenting.html
# Setting AFL_HARDEN automatically adds code hardening options
# when invoking the downstream compiler.
# This includes -D_FORTIFY_SOURCE=2 and -fstack-protector-all.
# NOTE: _FORTIFY_SOURCE not compatible with ASAN
# export AFL_HARDEN=1
# see https://aflplus.plus/docs/env_variables/
export AFL_EXIT_WHEN_DONE=1
# By default, the wrapper appends -O3 to optimize builds.
export AFL_DONT_OPTIMIZE=1
# or AFL_USE_MSAN, etc.
# READ https://aflplus.plus/docs/notes_for_asan/
NOTE: if you run several slaves only one should run the
# target compiled with ASAN (and UBSAN, CFISAN),
# the others should run the target with no sanitizers compiled in.
export AFL_USE_UBSAN=1
export AFL_USE_ASAN=1
# AFL_PRELOAD causes AFL to set LD_PRELOAD for the target binary
# without disrupting the afl-fuzz process itself.
# This is useful, among other things, for bootstrapping libdislocator.so.
# see __AFL_LOOP
# export AFL_PERSISTENT=1
# make sure you compile app with `-fsanitize=address` or `-fsanitize=memory` etc. หมายเหตุ: ใช้ AFL_DONT_OPTIMIZE=1 ; อ่าน: http://moyix.blogspot.com/2016/07/fuzzing-with-afl-is-an-art.html
สำหรับรายละเอียดโปรดดู: ใช้ ASAN กับ AFL
ก่อนที่จะใช้โปรแกรมเราอาจต้องเปลี่ยนเป็นรูทผู้ใช้เพื่อจัดเรียง Core_pattern เข้าสู่ระบบเป็นรูทและพิมพ์คำสั่งต่อไปนี้:
# see https://afl-1.readthedocs.io/en/latest/tips.html#check-os-configuration
sudo su
# disable core dumps and CPU frequency scaling on your system (AFL will warn you if you should do this)
echo core > /proc/sys/kernel/core_pattern
# afl-fuzz will usually complain that you should change your `CPUFREQ` settings to performance because the automatic frequency scaling by the Linux kernel doesn't work well with afl.
echo performance | tee /sys/devices/system/cpu/cpu * /cpufreq/scaling_governor
exitหมายเหตุ: อย่าเรียกใช้ฟัซเซอร์ด้วยการเข้าถึงรูท
หมายเหตุ: รับสภาพแวดล้อมที่มั่นคงสำหรับฟัซเซอร์; อย่าเรียกใช้ฟัซเซอร์บนไฮเปอร์ไวเซอร์ที่ได้รับการกำหนดค่าต่ำ
afl-fuzz ใช้เพื่อเรียกใช้ AFL ไวยากรณ์ที่แท้จริงมีดังนี้:
# see https://afl-1.readthedocs.io/en/latest/fuzzing.html#fuzzing-binaries
# -i is a directory of files to use as fuzz input "seeds"
# -o is a directory to write the results (including inputs that provoke crashes or hangs)
# -m is the memory allowed to use. Example: -m500
# You can use -m none to disable memory limit
# -t is the maximum time that a run is allowed to take before being declared a "hang"
# Timeout of 10 seconds: -t 10000
# @@ is fuzzer input file name
# if you skip @@ it will pass the fuzzed file on the standard input
AFL_PERSISTENT=1 afl-fuzz -i [TESTCASE DIR] -o [RESULT_DIR] [TARGET_BINARY] [BINARY_PARAMS] @@
# Example 1: runs `tar` with arguments `xfJ @@ -C fuzz-garbage/ --force-local`
# where @@ is fuzzer input file name
./afl-1.56b/afl-fuzz -i fuzz-input/ -o fuzz-state/ -t 10000 ~ /tar-1.28/src/tar xfJ @@ -C fuzz-garbage/ --force-local
# Example 2: server is dual core, so we can run one AFL instance per core
AFL_PERSISTENT=1 afl-fuzz -i inputs -o multi_sync -M master ./fuzz_capstone
# In another terminal
AFL_PERSISTENT=1 afl-fuzz -i inputs -o multi_sync -S slave1 ./fuzz_capstoneเพื่อทำความเข้าใจหน้าจอสถานะ AFL อ่าน: https://afl-1.readthedocs.io/en/latest/user_guide.html#status-screen
หมายเหตุ: หาก total paths อยู่ที่ 1 คุณอาจตั้งค่าบางอย่างผิดปกติ
หมายเหตุ: ชอบ -m none เราใช้ที่อยู่ แผนที่นี้มีจำนวนมากสำหรับหน่วยความจำเงาดังนั้นเราต้องลบขีด จำกัด ของหน่วยความจำเพื่อให้มันขึ้นมาและทำงาน
หมายเหตุ: ด้วย -m none ซอฟต์แวร์ฟัซซี่ของคุณอาจพยายามจัดสรรและใช้หน่วยความจำจำนวนมากเนื่องจากตัวอย่างฟัซซี่ของคุณ สิ่งนี้อาจนำไปสู่การชนแบบสุ่มในระบบของคุณ คุณไม่ควรทำงานที่สำคัญในขณะที่ทำเช่นนั้น
หมายเหตุ: คุณสามารถลอง ASAN_OPTIONS=hard_rss_limit_mb=2000 เพื่อหลีกเลี่ยง -m none ดู: https://countuponsecurity.com/category/fuzzing/
คุณสามารถเขียนไบนารีที่กำหนดเองที่จะทำงานโดยใช้ afl-fuzz มันอาจห่อฟังก์ชั่นที่คุณต้องการทดสอบเช่นนั้น:
// harness is simply a C program that makes use of certain methods from
// a library, allowing you to indirectly fuzz it
# include < cstdio >
# include < cstdlib >
# include < string >
# include < iostream >
# include < ifstream >
int main ( int argc, char *argv[]) {
{
// init resources here
if (argc > 1 ) {
std::ifstream fin;
fin. open (argv[ 1 ]);
parse (fin); // custom logic
} else {
// / note requires AFL_PERSISTENT=1
// __AFL_LOOP is the way that we have to tell AFL
// that we want persistent mode.
// Each fuzzing iteration,
// instead of to fork and re-execute the target with a different input,
// is just an execution of this loop.
// Force AFL to run 1000 times,
// with 1000 different inputs fed to the library.
// After that, the process is restarted by AFL.
// This ensures we regularly replace the process to avoid memory leaks.
// see https://toastedcornflakes.github.io/articles/fuzzing_capstone_with_afl.html
while ( __AFL_LOOP ( 1000 )) {
parse (std::cin); // custom logic
}
}
// free resources here
return 0 ;
} หมายเหตุ: __afl_loop () อนุญาตให้ AFL ดำเนินการฟัซซิงของไบนารีในกระบวนการผ่านตัวช่วยสร้างหน่วยความจำบางอย่างเมื่อเทียบกับการเริ่มต้นกระบวนการใหม่สำหรับการทดสอบใหม่ทุกครั้งที่เราต้องการทดสอบ ต้องใช้ AFL_PERSISTENT=1
โดยค่าเริ่มต้นแอฟส้อมกระบวนการทุกครั้งที่ทดสอบอินพุตที่แตกต่างกัน เราสามารถควบคุม AFL เพื่อเรียกใช้เคสฟัซหลายตัวในอินสแตนซ์เดียวของโปรแกรมแทนที่จะคืนสถานะโปรแกรมกลับสำหรับตัวอย่างการทดสอบทุกครั้ง สิ่งนี้จะลดเวลาที่ใช้ในพื้นที่เคอร์เนลและปรับปรุงความเร็วที่ฟัซซิง สิ่งนี้เรียกว่าโหมด AFL_PERSISTENT เราสามารถทำได้โดยการรวมแมโคร __afl_loop (1,000) ภายในชุดทดสอบของเรา
หมายเหตุ: คุณอาจสนใจ __afl_init; ดูรายละเอียด: https://robertheaton.com/2019/07/08/how-to-write-an-afl-wrapper-for-any-language/
ปล่อยให้ฟัซเซอร์ทำงานเป็นเวลาไม่กี่ชั่วโมงหรือหลายวันเนื่องจากจะสร้างเส้นทางการดำเนินการรหัสสูงสุดตามกรณีทดสอบที่มีให้
หยุดฟัซซิ่งออก ctrl+c' observing เส้นทางทั้งหมด and การล่มของ Uniq in the section ผลลัพธ์โดยรวมของหน้าจอสถิติ AFL
สร้างพจนานุกรมที่ใช้ค่าคงที่และสตริงทั้งหมดที่พบในโปรแกรมไบนารีของโปรแกรมและเพิ่มเข้าไปในพจนานุกรม ดูสำหรับรหัสสคริปต์: http: //moyix.blogspot.com/2016/07/fuzzing-with-afl-is-an-art.html
#! /bin/bash
# see http://moyix.blogspot.com/2016/07/fuzzing-with-afl-is-an-art.html
objdump -d " ${1} " | grep -Eo ' $0x[0-9a-f]+ ' | cut -c 2- | sort -u | while read const ; do echo $const | python -c ' import sys, struct; sys.stdout.write("".join(struct.pack("<I" if len(l) <= 11 else "<Q", int(l,0)) for l in sys.stdin.readlines())) ' > testcases/ $const ; done
i=0 ; strings " ${1} " | while read line ; do echo -n " $line " > testcases/string_ ${i} ; i=$[ $i + 1 ] ; doneคุณต้องสร้างพจนานุกรมในหนึ่งในสองรูปแบบที่กล่าวถึงในพจนานุกรม/readme.Dictionaries จากนั้นชี้ฟัซเซอร์ไปที่ตัวเลือก -x ในบรรทัดคำสั่ง อ่าน: https://afl-1.readthedocs.io/en/latest/fuzzing.html#fuzzing-binaries และ https://github.com/mirrorer/afl/blob/master/dictionaries/readme.dictionaries
คุณยังสามารถใช้ libtokencap เพื่อสร้างพจนานุกรม ดู: https://github.com/mirrorer/afl/blob/master/libtokencap/readme.tokencap
เราสามารถค้นหากรณีทดสอบที่ทำให้เกิดความผิดพลาดในโฟลเดอร์ results ที่เราสร้างขึ้น ในการนำทางไปยัง results โฟลเดอร์เราสังเกตเห็นโฟลเดอร์ไม่กี่แห่งที่ถูกสร้างขึ้น
หมายเหตุ: เก็บไฟล์ข้อมูลอินพุตให้เล็ก ต่ำกว่า 1 KB เหมาะอย่างยิ่ง
ใช้ afl-cmin เพื่อลดจำนวนไฟล์ข้อมูลอินพุต
ใช้ afl-tmin เพื่อลดไฟล์ข้อมูลอินพุตแต่ละไฟล์ (ลบไบต์ใด ๆ ที่ไม่ส่งผลกระทบต่อเส้นทางรหัสที่ใช้)
ใช้ afl-ptmin เพื่อเรียกใช้ afl-tmin ในแบบคู่ขนาน สำหรับรายละเอียดโปรดดู: https://foxglovesecurity.com/2016/03/15/fuzzing-workflows-a-fuzz-job-from-start-to-finish/
ในการทำซ้ำความผิดพลาดที่พบคุณสามารถใช้ crashwalk (เป็นปลั๊กอิน GDB) โปรดดู: https://ritcsec.wordpress.com/2018/05/10/vulnerability-discovery-by-fuzzing/
apt-get install gdb golang
mkdir src
cd src
git clone https://github.com/jfoote/exploitable.git
cd && mkdir go
export GOPATH= ~ /go
# crashwalk installed in $GOPATH/bin/
go get -u github.com/bnagy/crashwalk/cmd/...
# USAGE
~ /go/bin/cwtriage -root syncdir/fuzzer1/crashes/ -match id -- ~ /parse @@เมื่อคุณไม่สามารถทำซ้ำความผิดพลาดที่พบโดย Afl-Fuzz สาเหตุที่เป็นไปได้มากที่สุดคือคุณไม่ได้ตั้งค่าหน่วยความจำแบบเดียวกับที่ใช้โดยเครื่องมือ อ่าน: https://afl-1.readthedocs.io/en/latest/fuzzing.html#fuzzing-binaries
หมายเหตุ: คุณสามารถใช้ afl-cov เพื่อหาปริมาณว่าคุณใช้เส้นทางรหัสที่มีอยู่ในไบนารีได้ดีเพียงใด สำหรับรายละเอียดโปรดดู: https://foxglovesecurity.com/2016/03/15/fuzzing-workflows-a-fuzz-job-from-start-to-finish/
หมายเหตุ: การวางไดเรกทอรีการทำงานของ AFL บนดิสก์ RAM คุณอาจได้รับความเร็วเพิ่มเติมและหลีกเลี่ยงการสึกหรอดิสก์ในเวลาเดียวกัน สำหรับรายละเอียดโปรดดู: https://bananamafia.dev/post/gb-fuzz/
# Fuzzing involves billions of reads and writes to the filesystem (!!!)
# Use RAMdisks for input since, we don't want to destroy harddrives
# Make a 1GB ramdisk file from which AFL can read input
sudo mkdir -p /mnt/inputfiles
sudo chown -R $USER : $( id -gn $USER ) /mnt/inputfiles
sudo mount -t tmpfs -o size=1024M tmpfs /mnt/inputfiles/ หมายเหตุ: -fvisibility-inlines-hidden flag อาจทำลายเครื่องมือแอฟ
AFL ให้สคริปต์การสำรวจความผิดพลาดใน experimental/crash_triage/triage_crashes.sh
เมื่อรันสคริปต์ triage จะวนผ่านแต่ละไฟล์ขัดข้องในไดเรกทอรี /out/crashes และพิมพ์ข้อมูลการขัดข้องที่เกิดขึ้นไปยังหน้าจอ
การใช้งาน triage_crashes : ./triage_crashes.sh ~/targets/out/ ~/targets/target-app/target-app_binary สำหรับรายละเอียดดู: https://research.aurainfosec.io/hunting-for-bugs-101/
หมายเหตุ: เครื่องมือที่มี AFL เพียงแค่ห้องสมุดที่คุณต้องการทดสอบความเครียดในขณะนี้ทีละครั้ง ให้โปรแกรมใช้ไลบรารีที่ไม่ได้รับการรับรองจากระบบสำหรับฟังก์ชั่นใด ๆ ที่คุณไม่ต้องการฟัซซี่
หมายเหตุ: คุณสามารถเปิดใช้งาน crash exploration mode ผ่าน -C ; ดู: https://lcamtuf.blogspot.com/2014/11/afl-fuzz-crash-exploration-mode.html
หมายเหตุ: AFL ตรวจพบความผิดพลาดโดยการตรวจสอบกระบวนการที่วางไข่ครั้งแรกที่กำลังจะตายเนื่องจากสัญญาณ (Sigsegv, Sigabrt, ฯลฯ ) โปรแกรมที่ติดตั้งตัวจัดการที่กำหนดเองสำหรับสัญญาณเหล่านี้อาจจำเป็นต้องมีรหัสที่เกี่ยวข้องแสดงความคิดเห็น
สำหรับรายละเอียดดู:
Libfuzzer เป็นส่วนหนึ่งของโครงการโครงสร้างพื้นฐานคอมไพเลอร์ LLVM และมาพร้อมกับคอมไพเลอร์ Clang
จากนั้น libfuzzer สามารถเชื่อมโยงกับไดรเวอร์ที่ต้องการโดยผ่าน -fsanitize=fuzzer ในระหว่างขั้นตอนการเชื่อมโยง
หมายเหตุ: -fsanitize=fuzzer ในสัญลักษณ์หลัก () ของ libfuzzer
หมายเหตุ: ในกรณีส่วนใหญ่คุณอาจต้องการรวม libfuzzer เข้ากับ addresssanitizer (ASAN), undefinedBehaviorsanitizer (Ubsan) หรือทั้งสองอย่าง นอกจากนี้คุณยังสามารถสร้างด้วย MemorySanitizer (MSAN) แต่การสนับสนุนคือการทดลอง: -fsanitize=undefined,address,fuzzer
เรียกใช้งานได้ซ้ำ ๆ เรียกใช้ฟังก์ชันต่อไปนี้:
extern " C " int LLVMFuzzerTestOneInput ( const uint8_t *Data, size_t Size ) {
// DoStuffWithYourAPI(Data, Size);
return 0 ;
} ใช้ -fsanitize=address,fuzzer โปรดทราบว่าคุณสามารถเปลี่ยนสารฆ่าเชื้อได้ (ที่อยู่หน่วยความจำเธรด ฯลฯ )
หมายเหตุ: หากคุณสงสัยว่าหน่วยความจำรั่วไหลในเป้าหมายของคุณคุณควรเรียกใช้ libfuzzer ด้วย -runs=N หรือ -max_total_time=N หากเป้าหมายของคุณมีการรั่วไหลอย่างมากในที่สุดคุณก็จะหมด RAM เพื่อป้องกันเครื่องของคุณจากการตายของ OOM คุณอาจใช้: ASAN_OPTIONS=hard_rss_limit_mb=2000 (พร้อมที่อยู่)
Libfuzzer ต้องการคลังเมล็ดพันธุ์ สำหรับรายละเอียดโปรดดู: https://github.com/google/fuzzing/blob/master/tutorial/libfuzzertutorial.md
สำหรับรายละเอียดดู:
Clang รองรับคำอธิบายประกอบความปลอดภัยของเธรด (guarded_by)
-Wthread-safety-analysisbase/thread_annotations.h https://github.com/chromium/chromium/blob/master/base/thread_annotations.h สำหรับรายละเอียดดู:Clang FAS การสนับสนุนชั้นหนึ่งสำหรับ sanitizers ดูรายละเอียดเกี่ยวกับ MSAN, ASAN, TSAN ฯลฯ ในเอกสาร
เสียงดังสามารถสร้างด้วยโปรไฟล์อายุการใช้งาน:
-Wlifetime สำหรับรายละเอียดดู:ส่วนประกอบโอเพ่นซอร์สทั้งหมดใช้ภายใต้ใบอนุญาตโอเพ่นซอร์สที่เกี่ยวข้อง
ส่วนประกอบโอเพ่นซอร์สที่ใช้:
ดูไฟล์ใบอนุญาต
ใบอนุญาต MIT
ดูใบอนุญาตสำหรับเนื้อหาทั้งหมดของใบอนุญาต
โครงการโอเพ่นซอร์สนั้นใช้โครงการ Google Chromium
นี่ไม่ใช่ผลิตภัณฑ์ของ Google อย่างเป็นทางการ
ส่วนลิขสิทธิ์ (c) Google Inc.
ดูไฟล์ใบอนุญาต