# clang

Published articles for clang.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How fast is C++23's std::flat\_map?

DevFeed: [How fast is C++23's std::flat\_map?](<https://devfeed.tech/articles/how-fast-is-c-23-s-std-flat-map-31465.md>)

Original publisher: [Read original article](<https://lemire.me/blog/2026/09/16/how-fast-is-c23s-stdflat_map/>)

Author: Daniel Lemire

Published: 2026-09-16T20:26:36Z

Content type: article

Language: en

Sources: [Daniel Lemire](<https://devfeed.tech/sources/daniel-lemire.md>)

Topics: [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Library](<https://devfeed.tech/topics/library.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [clang](<https://devfeed.tech/topics/clang.md>)

Tags: [array](<https://devfeed.tech/tags/array.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [clang](<https://devfeed.tech/tags/clang.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [speed](<https://devfeed.tech/tags/speed.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>)

### AI overview

This article benchmarks C++23's std::flat_map, a sorted container backed by parallel arrays of keys and values. It explains serialization and loading considerations, then compares insertion and lookup performance with std::map. Random-order insertion becomes quadratic as the container grows, while increasing-order or bulk insertion is much faster; random lookups can also be faster for large maps because std::flat_map uses less memory.

### Source excerpt

C++23 added a new type to the standard library: std::flat_map. There is also a std::flat_set and other variants, but let me focus on std::flat_map. A flat map is a sorted vector of keys next to a vector of values. A query is a binary search over the sorted keys. You need a recent standard library: ... Continue reading How fast is C++23's std::flat_map?

## C++-техрадар: что разработчики действительно готовы брать в работу

DevFeed: [C++-техрадар: что разработчики действительно готовы брать в работу](<https://devfeed.tech/articles/c-23087.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/kaspersky/articles/1067982/>)

Author: Kaspersky\_Lab ("Лаборатория Касперского")

Published: 2026-08-07T13:17:24Z

Content type: article

Language: ru

Sources: ["Лаборатория Касперского" RU](<https://devfeed.tech/sources/ru-2.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [CMake](<https://devfeed.tech/topics/cmake.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [bazel](<https://devfeed.tech/tags/bazel.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [git](<https://devfeed.tech/tags/git.md>), [plus-plus-3a0baa67a2fc](<https://devfeed.tech/tags/plus-plus-3a0baa67a2fc.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [tech-radar](<https://devfeed.tech/tags/tech-radar.md>), [vs-code](<https://devfeed.tech/tags/vs-code.md>)

### AI overview

The article analyzes the C++ portion of a technical radar based on survey responses from developers at C++ Russia and HolyJS. It explains how technologies are assessed across Adopt, Trial, Assess, and Hold categories, emphasizing that the overall distribution of votes matters more than a single dominant response. The supplied evidence specifically notes CMake as a strong performer and PostgreSQL as dividing respondents.

### Source excerpt

В мае на конференциях C++ Russia и HolyJS мы предложили участникам оценить технологии, инструменты и инженерные практики, с которыми они работают или за которыми следят. Так появились данные для двух технических радаров: по экосистеме C++ и по JavaScript. Сырые цифры сами по себе рассказывают немного, поэтому мы отдали результаты на разбор эксперту. Виктор Новиков, руководитель группы разработки в "Лаборатории Касперского", посмотрел на распределения голосов и поделился своим мнением, почему CMake уверенно побеждает, а PostgreSQL раскалывает аудиторию пополам. В этой статье -- его анализ C++-части исследования. Про техрадар JavaScript мы расскажем в другой статье. Посмотреть радар и принять участие в голосовании можно на странице проекта. Читать далее

## C++ libraries linking

DevFeed: [C++ libraries linking](<https://devfeed.tech/articles/c-libraries-linking-22393.md>)

Original publisher: [Read original article](<https://www.red-lang.org/2026/07/c-libraries-linking.html>)

Author: Nenad Rakocevic (noreply@blogger.com)

Published: 2026-07-29T19:07:38Z

Content type: release

Language: en

Sources: [Red](<https://devfeed.tech/sources/red.md>)

Topics: [Red](<https://devfeed.tech/topics/red.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [build-tools](<https://devfeed.tech/tags/build-tools.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [directx](<https://devfeed.tech/tags/directx.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [msvc](<https://devfeed.tech/tags/msvc.md>), [static-linking](<https://devfeed.tech/tags/static-linking.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>), [windows](<https://devfeed.tech/tags/windows.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

The Red toolchain now supports statically linking C++ libraries, including their runtime, on Windows, Linux, and macOS. It accepts libraries built with MSVC, GCC, or clang through the existing import system and compilation switch, with platform-specific prerequisites and constraints.

### Source excerpt

When we introduced static linking of C libraries, the promise was simple: name a .lib or .a archive in your #import, compile with -s, and ship one self-contained executable, no DLLs riding along, nothing to install on the target machine. There was one big frontier left, and everyone saw it coming: the libraries people want most (vision, GUI, audio, machine learning) are written in C++. A C++ library is a very different animal to link: it brings global constructors, exceptions, RTTI, templates, thread-local storage, and an entire language runtime that expects to be wired up just so. Until now, that was the line where you switched back to DLLs. That line is gone. The Red toolchain now statically links C++ libraries too (their runtime included) on every platform Red targets: Windows, Linux (x86 and ARM), and macOS. The best part: nothing changes. It is the same import system and same compilation switch: red -r -s myapp.red Libraries built with MSVC, GCC or clang are all accepted, in their native object formats. What you need preinstalled ➤ Windows: for C++ libraries (or C code built against Microsoft's static runtime), install the free Visual Studio Build Tools with the "Desktop development with C++" workload. Just one installer, and Red locates everything by itself: no vcvarsall, no PATH, no environment variables. Plain C libraries still need nothing at all and that now extends to C libraries touching COM, DirectX or MediaFoundation: the GUID constants such code references ship inside the toolchain, so a fresh Windows 11 with only red-toolchain executable on it links them! ➤ Linux: the GNU runtime archives from your distribution's gcc packages (libstdc++.a, libgcc.a and friends) placed next to your library. If one is missing, the linker names exactly what it needs. ➤ macOS: nothing beyond the toolchain; the system C++ runtime binds automatically. Some constraints 32-bit libraries for now, until the 64-bit toolchain is ready. The imported surface must be C (extern "C",

## Optimizing LLVM's bump allocator

DevFeed: [Optimizing LLVM's bump allocator](<https://devfeed.tech/articles/optimizing-llvm-s-bump-allocator-31134.md>)

Original publisher: [Read original article](<https://maskray.me/blog/optimizing-llvm-bump-allocator>)

Published: 2026-06-28T07:00:00Z

Content type: article

Language: en

Sources: [MaskRay](<https://devfeed.tech/sources/maskray.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [clang](<https://devfeed.tech/topics/clang.md>)

Tags: [changes](<https://devfeed.tech/tags/changes.md>), [clang](<https://devfeed.tech/tags/clang.md>), [codegen](<https://devfeed.tech/tags/codegen.md>), [debug](<https://devfeed.tech/tags/debug.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [memory](<https://devfeed.tech/tags/memory.md>), [optimizing](<https://devfeed.tech/tags/optimizing.md>), [performance](<https://devfeed.tech/tags/performance.md>)

### AI overview

This article explains three recent changes that optimize LLVM's BumpPtrAllocator: avoiding unnecessary realignment, using a sentinel to eliminate a null check, and removing per-allocation accounting from the hot path. It also discusses alignment, typed allocation, incomplete types, and ABI considerations.

### Source excerpt

BumpPtrAllocator is LLVM's bump allocator (arena allocator): each allocation bumps a pointer within a slab, and everything is freed at once when the allocator dies. It backs Clang's ASTContext, lld's make<T> object pools, TableGen records, and many other arenas. Here is the fast path before three recent changes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 __attribute__((returns_nonnull)) void *Allocate(size_t Size, Align Alignment) { BytesAllocated += Size; // (3) accounting RMW uintptr_t AlignedPtr = alignAddr(CurPtr, Alignment); // (1) always realign size_t SizeToAllocate = Size; #if LLVM_ADDRESS_SANITIZER_BUILD SizeToAllocate += RedZoneSize; #endif uintptr_t AllocEndPtr = AlignedPtr + SizeToAllocate; if (LLVM_LIKELY(AllocEndPtr <= uintptr_t(End) && CurPtr != nullptr)) { // (2) bound + null check CurPtr = reinterpret_cast<char *>(AllocEndPtr); ... return reinterpret_cast<char *>(AlignedPtr); } return AllocateSlow(Size, SizeToAllocate, Alignment); }

## A deep dive into SmallVector::push\_back

DevFeed: [A deep dive into SmallVector::push\_back](<https://devfeed.tech/articles/a-deep-dive-into-smallvector-push-back-31123.md>)

Original publisher: [Read original article](<https://maskray.me/blog/a-deep-dive-into-smallvector-push-back>)

Published: 2026-06-27T07:00:00Z

Content type: article

Language: en

Sources: [MaskRay](<https://devfeed.tech/sources/maskray.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [clang](<https://devfeed.tech/topics/clang.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [gcc](<https://devfeed.tech/topics/gcc.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [clang](<https://devfeed.tech/tags/clang.md>), [codegen](<https://devfeed.tech/tags/codegen.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>)

### AI overview

This article examines an LLVM SmallVector::push_back optimization for approximately trivially copyable element types. It explains how tail-calling the slow growth path reduces the fast path from 14 to 7 instructions and avoids callee-saved registers, while noting tradeoffs for out-of-line calls and overall build size.

### Source excerpt

tl;dr This blog post describes a recent SmallVector::push_back optimization for approximately trivially copyable element types. SmallVector is LLVM's most-used container, and push_back its hot operation. For the trivially-copyable specialization the fast path should be fast. 1 2 3 #include <llvm/ADT/SmallVector.h> void f(llvm::SmallVectorImpl<int> &v, int x) { v.push_back(x); } clang -S --target=x86_64 -O2 -DNDEBUG a.cc generates: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 push rbp # callee-saved spills + a stack realignment, push rbx # all on the fast path push rax mov eax, [rdi + 8] # size cmp eax, [rdi + 12] # vs capacity jae .Lgrow .Lstore: # reached from the fast path AND from .Lgrow mov rcx, [rdi] mov [rcx + rax*4], esi inc dword ptr [rdi + 8] add rsp, 8 pop rbx pop rbp ret .Lgrow: mov rbx, rdi # keep `this`/`x` alive across the call mov ebp, esi call SmallVectorBase<unsigned>::grow_pod ... jmp .Lstore

## 【eBPF 内核实现深度拆解】从验证器到 JIT，从 BTF 到调度器

DevFeed: [【eBPF 内核实现深度拆解】从验证器到 JIT，从 BTF 到调度器](<https://devfeed.tech/articles/ebpf-jit-btf-33982.md>)

Original publisher: [Read original article](<https://quant67.com/post/ebpf/index.html>)

Author: Liao Tonglang

Published: 2026-06-12T00:00:00Z

Content type: article

Language: zh

Sources: [土法炼钢 - 系统与基础设施](<https://devfeed.tech/sources/source-4.md>)

Topics: [eBPF](<https://devfeed.tech/topics/ebpf.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [JIT](<https://devfeed.tech/topics/jit.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [clang](<https://devfeed.tech/topics/clang.md>), [hash](<https://devfeed.tech/topics/hash.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [RISC-V](<https://devfeed.tech/topics/riscv.md>), [ast-matchers](<https://devfeed.tech/topics/ast-matchers.md>)

Tags: [arm](<https://devfeed.tech/tags/arm.md>), [array](<https://devfeed.tech/tags/array.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [bpf-jit](<https://devfeed.tech/tags/bpf-jit.md>), [bpf-maps](<https://devfeed.tech/tags/bpf-maps.md>), [bpf-verifier](<https://devfeed.tech/tags/bpf-verifier.md>), [btf](<https://devfeed.tech/tags/btf.md>), [clang](<https://devfeed.tech/tags/clang.md>), [co-re](<https://devfeed.tech/tags/co-re.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [ebpf](<https://devfeed.tech/tags/ebpf.md>), [fentry](<https://devfeed.tech/tags/fentry.md>), [hash](<https://devfeed.tech/tags/hash.md>), [jit](<https://devfeed.tech/tags/jit.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [libbpf](<https://devfeed.tech/tags/libbpf.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-kernel](<https://devfeed.tech/tags/linux-kernel.md>), [precision](<https://devfeed.tech/tags/precision.md>), [risc-v](<https://devfeed.tech/tags/risc-v.md>), [sched-ext](<https://devfeed.tech/tags/sched-ext.md>), [trampoline](<https://devfeed.tech/tags/trampoline.md>), [x86](<https://devfeed.tech/tags/x86.md>), [xdp](<https://devfeed.tech/tags/xdp.md>)

### AI overview

This Chinese-language series systematically explains eBPF's Linux kernel implementation, covering the BPF instruction set and registers, verifier algorithms, JIT compilation, map data structures and concurrency, helper type checking, BTF and CO-RE relocation, libbpf loading, trampolines, and sched_ext interfaces. It is aimed at engineers who want to understand eBPF kernel source code and build production BPF programs.

### Source excerpt

eBPF 内核虚拟机内部实现系统讲解：BPF 指令集与寄存器机器、验证器的抽象解释与状态裁剪、JIT 编译器后端、Map 各类型的并发与内存模型、helper 函数注册与类型检查、BTF 格式规范与 CO-RE 重定位引擎、libbpf 加载器工程、fentry/fexit 蹦床机制、sched_ext 调度器内核接口。面向想读懂 eBPF 内核源码、写生产级 BPF 程序的系统工程师。

## Fighting Hyrum's Law in LLVM

DevFeed: [Fighting Hyrum's Law in LLVM](<https://devfeed.tech/articles/fighting-hyrum-s-law-in-llvm-31128.md>)

Original publisher: [Read original article](<https://maskray.me/blog/fighting-hyrums-law-in-llvm>)

Published: 2026-05-10T07:00:00Z

Content type: article

Language: en

Sources: [MaskRay](<https://devfeed.tech/sources/maskray.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [reproducible builds](<https://devfeed.tech/topics/reproducible-builds.md>), [hash](<https://devfeed.tech/topics/hash.md>)

Tags: [clang](<https://devfeed.tech/tags/clang.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [hash](<https://devfeed.tech/tags/hash.md>), [lld](<https://devfeed.tech/tags/lld.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [reproducible-builds](<https://devfeed.tech/tags/reproducible-builds.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

This article examines how LLVM can develop dependencies on unspecified or incidental behavior under Hyrum's Law, causing output variation that harms reproducible builds, bisection, and bug reports. It describes hash-seed perturbation, reverse container iteration, and iterator invalidation checks as mechanisms for exposing such dependencies.

### Source excerpt

With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody. -- Hyrum's Law In a compiler, the most common form of Hyrum's Law is dependence on unspecified behavior -- hash bucket order, the order of equal elements after std::sort, padding offsets. The same framing covers a few cases that are technically undefined behavior (use of an invalidated iterator) or plain incidental properties (ABI struct layout, ELF section offsets). When the compiler itself harbors such a dependency, the symptom is usually output that varies build-to-build: an unstable sort that lands differently after the standard library changes, a hash map whose iteration order shifts when the hash function does. Occasionally the variation is run-to-run within a single build -- DenseMap<void *, X> keys with an ASLR-derived seed reorder buckets each invocation. Either way, reproducible builds, bisection, and bug reports all assume same input -> same output, and a stealth Hyrum dependency breaks that. This post surveys some mechanisms that perturb the contract's blind spots so dependencies cannot quietly form.

## Recent lld/ELF performance improvements

DevFeed: [Recent lld/ELF performance improvements](<https://devfeed.tech/articles/recent-lld-elf-performance-improvements-31121.md>)

Original publisher: [Read original article](<https://maskray.me/blog/2026-04-12-recent-lld-elf-performance-improvements>)

Published: 2026-04-12T07:00:00Z

Content type: article

Language: en

Sources: [MaskRay](<https://devfeed.tech/sources/maskray.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [clang](<https://devfeed.tech/topics/clang.md>), [Chromium](<https://devfeed.tech/topics/chromium.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [chromium](<https://devfeed.tech/tags/chromium.md>), [clang](<https://devfeed.tech/tags/clang.md>), [gc](<https://devfeed.tech/tags/gc.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [linker](<https://devfeed.tech/tags/linker.md>), [lld](<https://devfeed.tech/tags/lld.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [macos](<https://devfeed.tech/tags/macos.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [patches](<https://devfeed.tech/tags/patches.md>), [performance](<https://devfeed.tech/tags/performance.md>)

### AI overview

This article reports LLVM lld/ELF linker performance improvements from parallelizing link phases and reducing task-runtime overhead. Benchmarks show a 1.34x speedup over lld 22.1 for a Release+Asserts clang link and a 1.09x speedup for a Chromium debug link, while mold and wild remain faster in the comparisons described.

### Source excerpt

Updated in 2026-05. Since the LLVM 22 branch was cut, I've landed patches that parallelize more link phases and cut task-runtime overhead. This post compares current main against lld 22.1, mold, and wild. Headline: a Release+Asserts clang --gc-sections link is 1.34x as fast as lld 22.1; Chromium debug with --gdb-index is 1.09x as fast. mold and wild are still ahead -- the last section explains why.

## Bit-field layout

DevFeed: [Bit-field layout](<https://devfeed.tech/articles/bit-field-layout-31124.md>)

Original publisher: [Read original article](<https://maskray.me/blog/bit-field-layout>)

Published: 2026-02-22T08:00:00Z

Content type: tutorial

Language: en

Sources: [MaskRay](<https://devfeed.tech/sources/maskray.md>)

Topics: [implementation](<https://devfeed.tech/topics/implementation.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [clang](<https://devfeed.tech/topics/clang.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [MSVC](<https://devfeed.tech/topics/msvc.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [codegen](<https://devfeed.tech/tags/codegen.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compiler-optimization](<https://devfeed.tech/tags/compiler-optimization.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [msvc](<https://devfeed.tech/tags/msvc.md>)

### AI overview

This article explains how C and C++ bit-field layout is implementation-defined and governed primarily by platform ABIs. It distinguishes ABI-defined storage layout from compiler code generation, focusing on the Itanium ABI and describing differences in the Microsoft ABI.

### Source excerpt

The C and C++ standards leave nearly every detail to the implementation. C23 §6.7.3.2: An implementation may allocate any addressable storage unit large enough to hold a bit-field. If enough space remains, a bit-field that immediately follows another bit-field in a structure shall be packed into adjacent bits of the same unit. If insufficient space remains, whether a bit-field that does not fit is put into the next unit or overlaps adjacent units is implementation-defined. The order of allocation of bit-fields within a unit (high-order to low-order or low-order to high-order) is implementation-defined. The alignment of the addressable storage unit is unspecified C++ is also terse -- [class.bit]p1: Allocation of bit-fields within a class object is implementation-defined. Alignment of bit-fields is implementation-defined. Bit-fields are packed into some addressable allocation unit.

## Unsigned char std::basic\_string\<\> in C++

DevFeed: [Unsigned char std::basic\_string\<\> in C++](<https://devfeed.tech/articles/unsigned-char-std-basic-string-in-c-36572.md>)

Original publisher: [Read original article](<https://berthub.eu/articles/posts/unsigned-char-std-string-cpp/>)

Published: 2026-01-03T22:00:02Z

Content type: tutorial

Language: en

Sources: [Bert Hubert's writings](<https://devfeed.tech/sources/bert-hubert-s-writings.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [standard](<https://devfeed.tech/topics/standard.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [clang](<https://devfeed.tech/topics/clang.md>), [gcc](<https://devfeed.tech/topics/gcc.md>)

Tags: [bits](<https://devfeed.tech/tags/bits.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [concatenation](<https://devfeed.tech/tags/concatenation.md>), [cryptographic](<https://devfeed.tech/tags/cryptographic.md>), [freebsd](<https://devfeed.tech/tags/freebsd.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [openbsd](<https://devfeed.tech/tags/openbsd.md>), [standard](<https://devfeed.tech/tags/standard.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

A C++ post explains why code using std::basic_string<uint8_t> can fail on FreeBSD and OpenBSD. The issue involves std::char_traits: LLVM 19 removed its unconstrained base template because the C++ Standard does not require it for unsigned-character types. Code may need string concatenation and related operations replaced or a correct custom specialization provided.

### Source excerpt

Brief post on a somewhat vexing and irritating C++ problem I ran into some time ago. I hope that this page will help other people deal with this problem more quickly than I did. I've long used std::basic_string<uint8_t>, an unsigned char string, for fiddling with bits. You could use a regular char string, but especially when doing cryptographic or sub-byte operations, it is more convenient to not have to deal with sign bits.

## Understanding Apple Debug Info

DevFeed: [Understanding Apple Debug Info](<https://devfeed.tech/articles/understanding-apple-debug-info-25412.md>)

Original publisher: [Read original article](<https://smileykeith.com/2025/09/21/understanding-apple-debug-info/>)

Author: Keith Smiley

Published: 2025-09-21T17:00:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [C](<https://devfeed.tech/topics/c.md>), [Linux](<https://devfeed.tech/topics/linux.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [build](<https://devfeed.tech/tags/build.md>), [c](<https://devfeed.tech/tags/c.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [debug](<https://devfeed.tech/tags/debug.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [ios](<https://devfeed.tech/tags/ios.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [macos](<https://devfeed.tech/tags/macos.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This article explains how debug information works for Apple platforms and Mach-O binaries, contrasting the approach with Linux ELF binaries. It shows how compiler-generated debug metadata is stored in intermediate object files and located by lldb, then introduces issues that can arise in complex or distributed Bazel builds, including invalid absolute paths.

### Source excerpt

Apple platforms (macOS, iOS, etc), and specifically Mach-O binaries, have a slightly different approach to debug info than ELF binaries for Linux. If you are familiar with Xcode, you might have seen a few related settings that control what is produced and wondered what the trade-offs are. The goal of this post is to help you debug cases where these differences lead to a degraded debugging experience in lldb so that you can fix them. If you have a particularly complex build, potentially managed by Bazel1 or another tool, especially if you are using distributed builds, you are even more likely to hit issues. Let's dive in to how the pieces fit together. A brief explanation of debug info Debug info is metadata produced by the compiler that is consumed by debuggers (like lldb), profilers, and other tools. It is used to map runtime information, like addresses, function arguments, and stack traces, back to the source that was used to produce the binary. Without this information debugging in lldb shows primarily raw instructions and addresses, which is rarely acceptable for common debugging workflows. Inspecting debug info When building for Apple platforms debug info isn't contained in the final binary (this is the primary difference from the default Linux workflows). Instead the binary contains references to the files where lldb can find it (this is conceptually similar to if you use -gsplit-dwarf on Linux). Let's inspect some binaries to see what this really means. First we create a small binary: $ cat main.c int main() { return 0; } $ clang main.c -g -c -o main.o $ clang main.o -o main If we attempt to inspect the debug info contained in main, we find nothing: $ dwarfdump main # use llvm-dwarfdump if not on macOS main: file format Mach-O arm64 .debug_info contents: However when we debug this binary in lldb, you will correctly see the source file and line number information: $ lldb -- main (lldb) target create "main" Current executable set to '/tmp/demo/main' (arm64). (l

## Performance of the Python 3.14 tail-call interpreter

DevFeed: [Performance of the Python 3.14 tail-call interpreter](<https://devfeed.tech/articles/performance-of-the-python-3-14-tail-call-interpreter-21947.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/post/cpython-tail-call/>)

Author: Nelson Elhage

Published: 2025-03-09T22:00:00Z

Content type: article

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Python 3.14](<https://devfeed.tech/topics/python-3-14.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [intel](<https://devfeed.tech/tags/intel.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [performance](<https://devfeed.tech/tags/performance.md>), [performance-engineering](<https://devfeed.tech/tags/performance-engineering.md>), [python](<https://devfeed.tech/tags/python.md>), [python-3-14](<https://devfeed.tech/tags/python-3-14.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>)

### AI overview

This article examines the performance gains attributed to CPython's Python 3.14 tail-call bytecode interpreter. It finds that the initial 10-15% improvement was primarily caused by inadvertently working around an LLVM 19 regression; with better baselines, the gain is closer to 1-5%, depending on the setup.

### Source excerpt

About a month ago, the CPython project merged a new implementation strategy for their bytecode interpreter. The initial headline results were very impressive, showing a 10-15% performance improvement on average across a wide range of benchmarks across a variety of platforms. Unfortunately, as I will document in this post, these impressive performance gains turned out to be primarily due to inadvertently working around a regression in LLVM 19. When benchmarked against a better baseline (such GCC, clang-18, or LLVM 19 with certain tuning flags), the performance gain drops to 1-5% or so depending on the exact setup.

## Bazel caching and compressed debug info

DevFeed: [Bazel caching and compressed debug info](<https://devfeed.tech/articles/bazel-caching-and-compressed-debug-info-25410.md>)

Original publisher: [Read original article](<https://smileykeith.com/2025/02/14/compressed-debug-info/>)

Author: Keith Smiley

Published: 2025-02-14T18:00:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [C](<https://devfeed.tech/topics/c.md>)

Tags: [bazel](<https://devfeed.tech/tags/bazel.md>), [build](<https://devfeed.tech/tags/build.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [caching](<https://devfeed.tech/tags/caching.md>), [clang](<https://devfeed.tech/tags/clang.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [config](<https://devfeed.tech/tags/config.md>), [configuration](<https://devfeed.tech/tags/configuration.md>)

### AI overview

This article explains how compressing debug information can reduce C and C++ binary sizes and improve Bazel remote-cache efficiency. Using llvm-objcopy, the example reduces a roughly 536 MB binary to about 290 MB, and the authors report nearly 60% fewer cache reads after deployment.

### Source excerpt

One of bazel's most attractive features is the ability for it to remotely cache artifacts to reduce unnecessary work for large builds. Unfortunately users quickly discover this comes with non-trivial financial and bandwidth implications. There are many ways, of varying difficulty, to try and improve your cache usage. From breaking unnecessary dependencies, to adding larger local storage for CI workers, builds without the bytes, build avoidance, etc. For codebases with lots of C or C++ one of the potentially easiest wins is to enable compressed debug information1. Let's look at an example from our codebase. Looking at the size of a non-trivial C++ binary built with -g -O2 (similar to cmake's RelWithDebInfo configuration), or binary clocks in at ~530mbs: % du -sh bin 536M bin To get a sense of what percentage of this binary is debug info, we can use llvm-objcopy to strip the debug info entirely: % llvm-objcopy --strip-debug bin strippedbin % du -sh strippedbin 159M strippedbin This shows us that almost 70%(!!) of the binary size is taken up with debug info. In release configurations we can eliminate this entirely with bazel's --strip argument, but for developer builds, or other use cases where you need debug info, we can still improve this. If we use llvm-objcopy again, this time to compress the debug info, we can immediately see our potential gains: % llvm-objcopy --compress-debug-sections bin compressedbin % du -sh compressedbin 290M compressedbin This shows us we can get an almost 50%(!!) improvement in binary size in this example. To enable this in bazel, assuming you're using a relatively recent version of gcc or clang, you can add something like this to your .bazelrc2: build --enable_platform_specific_config build:linux --copt=-gz --host_copt=-gz build:linux --linkopt=-gz --host_linkopt=-gz In practice we saw cache reads drop by nearly 60% when we rolled out this change. Reducing binary size with this approach has a lot of benefits, but it's even more pronounced

## C++ exception performance three years later

DevFeed: [C++ exception performance three years later](<https://devfeed.tech/articles/c-exception-performance-three-years-later-25087.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2024/12/c-exception-performance-three-years.html>)

Author: Thomas Neumann (noreply@blogger.com)

Published: 2024-12-10T14:44:00Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [JIT](<https://devfeed.tech/topics/jit.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [exception](<https://devfeed.tech/tags/exception.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [glibc](<https://devfeed.tech/tags/glibc.md>), [jit](<https://devfeed.tech/tags/jit.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [performance](<https://devfeed.tech/tags/performance.md>), [series](<https://devfeed.tech/tags/series.md>)

### AI overview

The article reviews improvements to C++ exception unwinding performance. Lock-free lookup mechanisms in glibc and libgcc improve scalability for statically generated and JIT-generated code, although clang's implementation may still have scaling limitations.

### Source excerpt

About three years ago we noticed serious performance problems in C++ exception unwinding. Due to contention on the unwinding path these became more and more severe the more cores a system had, and unwinding could slow down by orders of magnitude. Due to the constraints of backwards compatibility this contention was not easy to eliminate, and P2544 discussed ways to fix this problem via language changes in C++. But fortunately people found less invasive solutions. First, Florian Weimer changed the glibc to provide a lock-free mechanism to find the (static) unwind tables for a given shared object. Which eliminates the most serious contention for "simple" C++ programs. For example in a micro-benchmark that calls a function with some computations (100 calls to sqrt per function invocation), and which throws with a certain probability, we previously had very poor scalability with increasing core count. With his patch we now see with gcc 14.2 on a dual-socket EPYC 7713 the following performance development (runtime in ms): 1 2 4 8 16 32 64 128 threads 0% failure 29 29 29 29 29 29 29 42 0.1% failure 29 29 29 29 29 29 29 32 1% failure 29 30 30 30 30 30 32 34 10% failure 36 36 37 37 37 37 47 65 Which is more or less perfect. 128 threads are a bit slower, but that is to be expected as one EPYC only has 64 cores. With higher failure rates unwinding itself becomes slower but that is still acceptable here. Thus most C++ programs are just fine. For our use case that is not enough, though. We dynamically generate machine code at runtime, and we want to be able to pass exceptions through generated code. The _dl_find_object mechanism of glibc is not used for JITed code, instead libgcc maintains its own lookup structure. Historically this was a simple list with a global lock, which of course had terrible performance. But through a series of patches we managed to change libgcc into using a lock-free b-tree for maintaining the dynamic unwinding frames. Using a similar experiment to the

## Espressif-IDE v3.0.0 -- LSP Support for C/C++ Editor

DevFeed: [Espressif-IDE v3.0.0 -- LSP Support for C/C++ Editor](<https://devfeed.tech/articles/espressif-ide-v3-0-0-lsp-support-for-c-c-editor-13867.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/espressif-ide-lsp-support/>)

Author: John Lee

Published: 2024-06-28T00:00:00Z

Content type: release

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [Espressif IDE](<https://devfeed.tech/topics/espressif-ide.md>), [ide](<https://devfeed.tech/topics/ide.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [C](<https://devfeed.tech/topics/c.md>), [ESP-IDF](<https://devfeed.tech/topics/esp-idf.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [cross-platform](<https://devfeed.tech/topics/cross-platform.md>), [Release notes](<https://devfeed.tech/topics/release-notes.md>), [ESP32](<https://devfeed.tech/topics/esp32.md>), [ESP32-P4](<https://devfeed.tech/topics/esp32-p4.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [eclipse](<https://devfeed.tech/tags/eclipse.md>), [esp-idf](<https://devfeed.tech/tags/esp-idf.md>), [esp32](<https://devfeed.tech/tags/esp32.md>), [esp32-p4](<https://devfeed.tech/tags/esp32-p4.md>), [espressif-ide](<https://devfeed.tech/tags/espressif-ide.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [ide](<https://devfeed.tech/tags/ide.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [news](<https://devfeed.tech/tags/news.md>), [release](<https://devfeed.tech/tags/release.md>)

### AI overview

Espressif-IDE v3.0.0 is a cross-platform integrated development environment update for Espressif chip development. It introduces Eclipse CDT-LSP plugins for newer C/C++ standards and a C/C++ editor powered by LLVM clangd for ESP-IDF developers.

### Source excerpt

This article briefly covers the most important features introduced in Espressif-IDE v3.0.0 and some of their implementation details. If you have further improvement ideas or if you encounter any issues while using Espressif-IDE, do not hesitate to report them in the project's GitHub issues.

## Thread Count Scaling Part 2. Blender and Clang

DevFeed: [Thread Count Scaling Part 2. Blender and Clang](<https://devfeed.tech/articles/thread-count-scaling-part-2-blender-and-clang-13641.md>)

Original publisher: [Read original article](<https://easyperf.net/blog/2024/05/10/Thread-Count-Scaling-Part2>)

Author: Denis Bakhvalov

Published: 2024-05-10T04:00:00Z

Content type: article

Language: en

Sources: [Denis Bakhvalov](<https://devfeed.tech/sources/denis-bakhvalov.md>)

Topics: [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [blender](<https://devfeed.tech/tags/blender.md>), [book-chapters](<https://devfeed.tech/tags/book-chapters.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [performance](<https://devfeed.tech/tags/performance.md>), [performance-analysis](<https://devfeed.tech/tags/performance-analysis.md>), [process](<https://devfeed.tech/tags/process.md>), [scale](<https://devfeed.tech/tags/scale.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

This article examines thread-count scaling in Blender and Clang. Blender scales across the available threads because its rendering workload is highly parallelizable, but scaling declines as E-cores and SMT sibling threads are used. Clang compilation is also massively parallel, though its scaling is affected by cache and branch behavior, core differences, SMT, and frequency throttling.

### Source excerpt

Subscribe to my newsletter, support me on Patreon, Github, or by PayPal donation. This blog is an excerpt from the book. More details in the introduction. Blender is the only benchmark in our suite that continues to scale up to all 16 threads in the system. The reason for this is that the workload is highly parallelizable. The rendering process is divided into small tiles, and each tile can be rendered independently. However, even with this high level of parallelism, the scaling is only .

## Accelerate Your IoT Development with the Espressif WebIDE

DevFeed: [Accelerate Your IoT Development with the Espressif WebIDE](<https://devfeed.tech/articles/accelerate-your-iot-development-with-the-espressif-webide-13799.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/accelerate-your-iot-development-with-the-espressif-webide/>)

Author: John Lee

Published: 2023-04-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [Espressif](<https://devfeed.tech/topics/espressif.md>), [Internet of things](<https://devfeed.tech/topics/iot.md>), [ESP-IDF](<https://devfeed.tech/topics/esp-idf.md>), [ide](<https://devfeed.tech/topics/ide.md>), [Visual Studio Code](<https://devfeed.tech/topics/visual-studio-code.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [Website](<https://devfeed.tech/topics/website.md>), [Web](<https://devfeed.tech/topics/web.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Docker Container](<https://devfeed.tech/topics/docker-container.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [browser](<https://devfeed.tech/tags/browser.md>), [c-c-plus-plus](<https://devfeed.tech/tags/c-c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [docker](<https://devfeed.tech/tags/docker.md>), [eclipse-theia](<https://devfeed.tech/tags/eclipse-theia.md>), [esp-idf](<https://devfeed.tech/tags/esp-idf.md>), [esp32](<https://devfeed.tech/tags/esp32.md>), [espressif](<https://devfeed.tech/tags/espressif.md>), [esptool](<https://devfeed.tech/tags/esptool.md>), [ide](<https://devfeed.tech/tags/ide.md>), [iot](<https://devfeed.tech/tags/iot.md>), [json](<https://devfeed.tech/tags/json.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [python](<https://devfeed.tech/tags/python.md>), [qemu](<https://devfeed.tech/tags/qemu.md>), [theia](<https://devfeed.tech/tags/theia.md>), [typescript](<https://devfeed.tech/tags/typescript.md>), [visual-studio-code](<https://devfeed.tech/tags/visual-studio-code.md>), [web](<https://devfeed.tech/tags/web.md>)

### AI overview

This tutorial introduces the Espressif Web IDE, an Eclipse Theia-based IDE that integrates the ESP-IDF extension for Visual Studio Code with additional tools. It explains how to run the IDE from source or in Docker, connect to ESP chip serial ports, flash and monitor devices, and use C/C++ language features.

### Source excerpt

The Espressif Web IDE is an implementation of the Eclipse Theia framework with the ESP-IDF extension for Visual Studio Code and few additional tools. You can see it in action in the Espressif DevCon22 presentation below. If you haven't used Eclipse Theia before, it is an open-source framework to develop Cloud & Desktop IDEs and tools in TypeScript with a Visual Studio Code UI and Visual Studio Code extensions support or extensions implemented in the OpenVSX registry.

## Auto linking with Mach-O binaries

DevFeed: [Auto linking with Mach-O binaries](<https://devfeed.tech/articles/auto-linking-with-mach-o-binaries-25407.md>)

Original publisher: [Read original article](<https://smileykeith.com/2022/02/23/lc-linker-option/>)

Author: Keith Smiley

Published: 2022-02-24T02:00:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [clang](<https://devfeed.tech/tags/clang.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This article explains automatic linking for Mach-O binaries. It shows how Objective-C compilation can embed linker options for dependencies such as Foundation, how to inspect those options, and how omitting module support causes explicit linking to be required. It also covers module maps, Swift standard-library dependencies, and several ways to add linker options manually with clang, swiftc, or assembly directives.

### Source excerpt

Auto linking is a feature that embeds information in your binaries' at compile time which is then used at link time to automatically link your dependencies. This allows you to reduce the duplication of flags between the different phases of your (or your consumers') builds. For example, with this Objective-C file: #include <Foundation/Foundation.h> int main() { NSLog(@"Hello, World!"); return 1; } Compiled with: $ clang -fmodules -c foo.m -o foo.o You can then inspect the options added for use at link time: $ otool -l foo.o | grep LC_LINKER_OPTION -A3 cmd LC_LINKER_OPTION cmdsize 40 count 2 string #1 -framework string #2 Foundation ... Now when linking this binary you don't have to pass any extra flags to the linker to make sure you link Foundation: $ ld foo.o -syslibroot `xcrun --show-sdk-path` To compare, if you compile the binary without -fmodules1: $ clang -c foo.m -o foo.o You don't get any LC_LINKER_OPTIONs. Then when linking the binary with the same command as before, it fails with these errors: $ ld foo.o -syslibroot `xcrun --show-sdk-path` Undefined symbols for architecture arm64: "_NSLog", referenced from: _main in foo.o "___CFConstantStringClassReference", referenced from: CFString in foo.o ld: symbol(s) not found for architecture arm64 To make it succeed you must explicitly link Foundation through an argument to your linker invocation: $ ld foo.o -syslibroot `xcrun --show-sdk-path` -framework Foundation Auto linking is also applied when using module maps that use the link directive. For example with this module map file: // module.modulemap module foo { link "foo" link framework "Foundation" } That you include with in this source file: @import foo; int main() { return 1; } And compile (with an include path to the module.modulemap file): $ clang -fmodules -c foo.m -o foo.o -I. The produced object depends on foo and Foundation. This can be useful for handwriting module map files for prebuilt libraries, and for quite a few other cases. You can read about thi

## Reproducible codesigning on Apple Silicon

DevFeed: [Reproducible codesigning on Apple Silicon](<https://devfeed.tech/articles/reproducible-codesigning-on-apple-silicon-25405.md>)

Original publisher: [Read original article](<https://smileykeith.com/2021/10/05/codesign-m1/>)

Author: Keith Smiley

Published: 2021-10-06T03:00:00Z

Content type: article

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [Arm](<https://devfeed.tech/topics/arm.md>), [x86](<https://devfeed.tech/topics/x86.md>), [C](<https://devfeed.tech/topics/c.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [arm](<https://devfeed.tech/tags/arm.md>), [binaries](<https://devfeed.tech/tags/binaries.md>), [c](<https://devfeed.tech/tags/c.md>), [clang](<https://devfeed.tech/tags/clang.md>), [code](<https://devfeed.tech/tags/code.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [identifier](<https://devfeed.tech/tags/identifier.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [reproducible-builds](<https://devfeed.tech/tags/reproducible-builds.md>), [signing](<https://devfeed.tech/tags/signing.md>), [source](<https://devfeed.tech/tags/source.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

The article explains why codesigning universal macOS binaries can produce different results on Apple Silicon and Intel Macs, despite the binaries being identical before signing. It traces the issue through Apple's open-source code and identifies architecture-dependent UUID handling as the cause of non-reproducible codesigning.

### Source excerpt

For people who expect reproducible builds, Apple Silicon machines provide an interesting challenge. Apple Silicon requires arm64 binaries, including command line tools you build yourself, be codesigned. This change is mostly transparent to developers, because Apple updated their linker to automatically ad-hoc sign binaries1. Unfortunately, if you're interested in producing binaries that support both Intel Macs and Apple Silicon Macs, you likely want to produce a fat binary. When codesigning this binary you hit some behavior that depends on your current machine's architecture. Example You can consistently produce the same result across multiple machines when compiling a binary without signing it. Here's an example with a simple C program: $ echo "int main() { return 0; }" > main.c $ clang main.c -Wl,-no_adhoc_codesign -arch arm64 -arch x86_64 -o main $ shasum main 113033b3d9a247210b49a476bbfadb2e347846fe main The shasum of main should always be the same regardless of your host machine2. On Apple Silicon machines you can see this binary has the same sha1 even if you run clang under Rosetta 23: $ arch -x86_64 clang main.c -Wl,-no_adhoc_codesign -arch arm64 -arch x86_64 -o main $ shasum main 113033b3d9a247210b49a476bbfadb2e347846fe main The issue is introduced when you codesign the binary on Apple Silicon machines versus Intel machines. You can immediately see the difference3: $ codesign --force --sign - main $ shasum main 84631e812bd480c306766ba03a728dd2565dd672 main % arch -x86_64 codesign --force --sign - main % shasum main f631b6c0daf3ffd0bb5f65d19fa045acf447a72d main We get closer to identifying the problem when you compare the details of these differences: $ codesign --force --sign - main $ codesign -dvvv main > arm.txt 2>&1 $ arch -x86_64 codesign --force --sign - main $ codesign -dvvv main > intel.txt 2>&1 $ diff -Nur intel.txt arm.txt --- intel.txt 2021-10-05 21:26:32.731918710 -0700 +++ arm.txt 2021-10-05 21:26:29.473702845 -0700 @@ -1,14 +1,14 @@ Executable=/

## ReactOS in 2020

DevFeed: [ReactOS in 2020](<https://devfeed.tech/articles/reactos-in-2020-33215.md>)

Original publisher: [Read original article](<https://reactos.org/project-news/reactos-in-2020/>)

Published: 2021-01-02T00:00:00Z

Content type: article

Language: en

Sources: [Front Page on ReactOS Website](<https://devfeed.tech/sources/front-page-on-reactos-website.md>)

Topics: [ReactOS](<https://devfeed.tech/topics/reactos.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [build tools](<https://devfeed.tech/topics/build-tools.md>), [CMake](<https://devfeed.tech/topics/cmake.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [Shell](<https://devfeed.tech/topics/shell.md>), [clang](<https://devfeed.tech/topics/clang.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [MSVC](<https://devfeed.tech/topics/msvc.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [ci](<https://devfeed.tech/tags/ci.md>), [clang](<https://devfeed.tech/tags/clang.md>), [cmake](<https://devfeed.tech/tags/cmake.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [free](<https://devfeed.tech/tags/free.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [github](<https://devfeed.tech/tags/github.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [msvc](<https://devfeed.tech/tags/msvc.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [os](<https://devfeed.tech/tags/os.md>), [react](<https://devfeed.tech/tags/react.md>), [reactos](<https://devfeed.tech/tags/reactos.md>), [shell](<https://devfeed.tech/tags/shell.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>), [win32](<https://devfeed.tech/tags/win32.md>), [winapi](<https://devfeed.tech/tags/winapi.md>)

### AI overview

A 2020 retrospective on ReactOS reports bug fixes, new instabilities, full-time kernel hires, shell improvements, RAPPS application-manager enhancements, and upgrades to its compiler and build tooling. It covers GCC 8.4, CMake 3.17, restored Clang CI builds, reduced older MSVC support, and a move to the C99 standard.

### Source excerpt

Despite all the turbulence, it has been quite a productive year for ReactOS. Many bugs and instabilities were resolved, many more have been introduced. This year we hired two kernel developers full-time, this happened for the first time in the project's history. The post highlights some of the changes which may be interesting to the community. Shell changes Shell hasn't seen much attention recently, due to most of the work being concentrated in the kernel, but there are still some useful fixes and feature implementations:

## On GitHub Actions with MSYS2

DevFeed: [On GitHub Actions with MSYS2](<https://devfeed.tech/articles/on-github-actions-with-msys2-27451.md>)

Original publisher: [Read original article](<https://ariya.io/2020/07/on-github-actions-with-msys2/>)

Published: 2020-08-01T03:33:31Z

Content type: tutorial

Language: en

Sources: [Ariya Hidayat](<https://devfeed.tech/sources/ariya-hidayat.md>)

Topics: [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [C](<https://devfeed.tech/topics/c.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [Shell](<https://devfeed.tech/topics/shell.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [c](<https://devfeed.tech/tags/c.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [github](<https://devfeed.tech/tags/github.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [toolchains](<https://devfeed.tech/tags/toolchains.md>), [windows](<https://devfeed.tech/tags/windows.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

### AI overview

A practical guide to using GitHub Actions with MSYS2 to build an ANSI C program on Windows. It shows configurations for GCC and Clang, then uses matrix parameters to cover both i686 and AMD64 architectures.

### Source excerpt

Thanks to the complete GitHub Actions for MSYS2, it is easier than ever to construct a continuous integration setup for building with compilers and toolchains which can run on MSYS2.

## Smarter C/C++ inlining with \_\_attribute\_\_((flatten))

DevFeed: [Smarter C/C++ inlining with \_\_attribute\_\_((flatten))](<https://devfeed.tech/articles/smarter-c-c-inlining-with-attribute-flatten-38362.md>)

Original publisher: [Read original article](<https://awesomekling.github.io/Smarter-C++-inlining-with-attribute-flatten/>)

Author: Andreas Kling

Published: 2020-04-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Andreas Kling](<https://devfeed.tech/sources/andreas-kling.md>)

Topics: [inlining](<https://devfeed.tech/topics/inlining.md>), [c/c++](<https://devfeed.tech/topics/c-c-plus-plus.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [clang](<https://devfeed.tech/topics/clang.md>), [gcc](<https://devfeed.tech/topics/gcc.md>), [build times](<https://devfeed.tech/topics/build-times.md>)

Tags: [build-times](<https://devfeed.tech/tags/build-times.md>), [c-c-plus-plus](<https://devfeed.tech/tags/c-c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [function](<https://devfeed.tech/tags/function.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [inlining](<https://devfeed.tech/tags/inlining.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

This post explains how to use the __attribute__((flatten)) function attribute in C/C++ to apply aggressive inlining selectively. GCC and Clang support the attribute, which inlines a function's callees while limiting the program-size, cache-locality, and build-time costs of broader inlining.

### Source excerpt

This post describes a compile-time technique for getting the benefits of aggressive inlining in hot code while protecting cool code from its downsides.

## Clang on Windows

DevFeed: [Clang on Windows](<https://devfeed.tech/articles/clang-on-windows-27445.md>)

Original publisher: [Read original article](<https://ariya.io/2020/01/clang-on-windows/>)

Published: 2020-01-05T22:46:09Z

Content type: tutorial

Language: en

Sources: [Ariya Hidayat](<https://devfeed.tech/sources/ariya-hidayat.md>)

Topics: [c/c++](<https://devfeed.tech/topics/c-c-plus-plus.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [Package manager](<https://devfeed.tech/topics/package-manager.md>), [make](<https://devfeed.tech/topics/make.md>), [Azure](<https://devfeed.tech/topics/azure.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>)

Tags: [azure](<https://devfeed.tech/tags/azure.md>), [build](<https://devfeed.tech/tags/build.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cache](<https://devfeed.tech/tags/cache.md>), [clang](<https://devfeed.tech/tags/clang.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [make](<https://devfeed.tech/tags/make.md>), [pacman](<https://devfeed.tech/tags/pacman.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

A tutorial on using MSYS2 to install and run Clang on Windows for building 32-bit and 64-bit C/C++ applications. It also describes integrating the toolchain with Azure Pipelines and caching downloaded packages.

### Source excerpt

Thanks to the MSYS2 project, now there is an easy way to utilize Clang to build C/C++ application on Windows. This works equally well for both 32-bit and 64-bit programs.

## Kotlin/Native (Stranger) Threads - Kevin Galligan

DevFeed: [Kotlin/Native (Stranger) Threads - Kevin Galligan](<https://devfeed.tech/articles/kotlin-native-stranger-threads-kevin-galligan-38281.md>)

Original publisher: [Read original article](<https://touchlab.co/kotlin-native-stranger-threads>)

Published: 2018-05-11T20:31:45Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [CLion](<https://devfeed.tech/topics/clion.md>), [clang](<https://devfeed.tech/topics/clang.md>)

Tags: [clang](<https://devfeed.tech/tags/clang.md>), [clion](<https://devfeed.tech/tags/clion.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>), [threading](<https://devfeed.tech/tags/threading.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

The first chapter of a series on threading in Kotlin/Native introduces its thread and state model, recommends CLion for experimentation, and guides readers through creating and running a Kotlin/Native HelloWorld project. It previews Workers, data passing, and data freezing.

### Source excerpt

This is going to be a multi-part series on threading in Kotlin Native. To build a reasonably functional product, understanding threads is critical.

[Next page](<https://devfeed.tech/tags/clang.md?cursor=WyIyMDE4LTA1LTExVDIwOjMxOjQ1KzAwOjAwIiwgIjA5M2UwNTRjLTlhNTctNDU2MS1iMjZlLTQ2MTg2ZDAwYTIwZSJd>)