Skip to content

Instantly share code, notes, and snippets.

View flounderK's full-sized avatar
💭
Screaming in confusion

Clif Wolfe flounderK

💭
Screaming in confusion
  • Good god I’m lost
View GitHub Profile
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
cmake -S llvm -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_INSTALL_UTILS=ON -DLLVM_ENABLE_PROJECTS=clang
ninja -C build
@flounderK
flounderK / kconfig.cmake
Last active May 11, 2025 13:43
kconfig_cmake
function(set_kconfig_vars_from_file FILENAME)
# Optional Kconfig integration
if(EXISTS "${FILENAME}")
file(READ "${FILENAME}" KCONFIG_CONTENTS)
string(REGEX MATCHALL "CONFIG_[A-Za-z0-9_]+=(y|n)" KCONFIG_LINES "${KCONFIG_CONTENTS}")
foreach(line ${KCONFIG_LINES})
message("${line}")
string(REPLACE "=" ";" line_parts ${line})
list(GET line_parts 0 VAR)
import re
import subprocess
import os
import pty
import tty
import fcntl
import stat
import threading
from queue import Queue
import logging
@flounderK
flounderK / build_kernel.sh
Created May 25, 2025 18:56
Build linux kernel in a different output directory
git clone https://github.com/torvalds/linux.git
cd linux
mkdir -p build
KBUILD_OUTPUT=build make O=build -j $(($(nproc)-1)) defconfig
KBUILD_OUTPUT=build make O=build -j $(($(nproc)-1))
#ifndef INTRUSIVE_LIST_H
#define INTRUSIVE_LIST_H
#include <stddef.h>
/* Basic intrusive doubly-linked list node */
struct list_head {
struct list_head *next, *prev;
};