Release of ForgeZero 1.9.0, a build tool for C and assembler

ForgeZero 1.9.0 (fz), a command-line build tool for projects written in C, C++, and assembly languages ​​(NASM, GAS, FASM), has been released. The tool doesn't require a Makefile or other configuration files for basic use. The project code is written in Go and is licensed under the MIT license.

ForgeZero detects the file type and automatically selects the appropriate backend. Each code file is compiled into an object file, then checked for duplicate global symbols across all objects and linked into a single executable file. Compiled files are cached and recompiled only after changes are made to the associated code files. Optionally, file system change tracking and recompilation are possible after code file updates.

The supported compilers are GCC, Clang, G++, and Clang++; assemblers are NASM, GAS, and FASM; linkers are LD, GCC, and Clang; and the AR archiver is supported. Mandatory warnings for C and C++ are: "-Wall -Wextra -Werror -Wpedantic -Wshadow -Wconversion". The AddressSanitizer and UndefinedBehaviorSanitizer sanitizers are enabled by default (they can be disabled with the -sanitize=false flag). The supported platforms are: Linux, macOS, Windows (WSL2 and experimentally native).

Main changes in version 1.9.0:

  • Added "-target" flag , which enables cross-compilation for any architecture with the appropriate prefix tools. fz automatically determines the names of the compiler, linker, and archiver based on the specified identifier (e.g., "arm-linux-gnueabihf-gcc"). All standard GNU target platforms are supported, including arm-linux-gnueabihf, aarch64-linux-gnu, and riscv64-linux-gnu.
  • Support for the Language Server Protocol (LSP) has been implemented. The "-compile-commands" flag generates a compile_commands.json (Compilation Database) file in the project root. The file is read by language servers clangd and ccls, providing autocompletion, code navigation, and diagnostics in editors that support LSP (Neovim, VSCode, CLion, Emacs, etc.).
  • The fz "-update" command now saves the current binary to /usr/local/bin/fz.old before installing a new version, allowing you to roll back to the previous version without reinstalling.
  • Fixed a bug in multi-directory projects where files with identical base names from different subdirectories would overwrite each other's object files. Object file names are now generated based on the full relative path to the source file.
  • Implemented interactive mode "fz -shell" for building single files.
  • Test coverage has been added for the SplitCommand, CmdSet, and CmdBuild commands. Test coverage for the linker package has increased from 17% to 60%, and coverage for all packages has exceeded 40%.
  • Added a CheckTool replacement mechanism for testing scenarios with missing toolchain components.

Changes from previous releases:

  • Version 1.8.0 implements the assembly of static libraries (-type static / -lib), ensures the uniqueness of object file names in multi-director projects, and fixes errors in the assembly subsystem related to the traversal of the ".." path.
  • Version 1.7.0 adds parallel compilation (-j N, 0 β€” autodetection of the number of cores), support for linker scripts (-T) and entry point addresses (-Ttext), interactive mode (fz -shell), explicit selection of output format (elf32, elf64, bin), compilation of C++ files (.cpp, .cc, .cxx) with the same strict warning flags as for C.
  • Version 1.6.0 adds project initialization (fz -init, creates .fz.yaml, .fzignore, README.md), bin format support (-format bin) for bootloaders and firmware, and configuration fields libs, flags.cc, flags.asm, flags.ld.
  • Version 1.5.0 introduces multiple source directories (source_dirs), explicit file lists (source_files), include/exclude patterns, a libs field for linker libraries, the .fzignore file, and multi-level merging of configuration files.

Source: opennet.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers πŸ”₯ Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster