Skip to content

Instantly share code, notes, and snippets.

View weliveindetail's full-sized avatar
🌍
🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲

Stefan Gränitz weliveindetail

🌍
🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲
View GitHub Profile
@weliveindetail
weliveindetail / lldb-precache
Created January 20, 2024 13:01
Pre-populate LLDB module cache with existing binaries
#!/bin/bash
set -e
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <executable> [remote-linux]"
exit 1
fi
executable_path="$1"
echo "Pre-caching executable: $executable_path"
@weliveindetail
weliveindetail / R_ARM_GOT_PREL.md
Last active January 10, 2024 12:30
AArch32 relocation notes

Run test arm-fpic-got.s (simplified ouput):

$ bin/llvm-lit --filter=arm-fpic-got -a tools/lld/test
...
RUN: at line 2: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi arm-fpic-got.s -o arm-fpic-got.s.tmp.o
RUN: at line 3: ld.lld arm-fpic-got.s.tmp.o -o arm-fpic-got.s.tmp
...

Input object:

@weliveindetail
weliveindetail / launch.json
Last active January 10, 2024 12:52
Cross-compile and remote debug clang-repl on Raspberry Pi 2-4 (32-bit Raspbian armv7)
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "custom",
"name": "[raspi4b] Attach clang-repl",
"initCommands": [
"platform select remote-linux",
"platform connect connect://192.168.1.104:9001",
From fa1d9a34232137d7a6db6a01735a9d4bf690d4a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= <stefan.graenitz@gmail.com>
Date: Thu, 16 Mar 2023 14:42:45 +0100
Subject: [PATCH] [CMake] Prevent uncachable calls with ccache on Windows
---
llvm/CMakeLists.txt | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
@weliveindetail
weliveindetail / windbg-symbol-synth-001.md
Created September 27, 2023 15:00
WinDbg SymBuilder demo

Minimal example:

> cat app.c
extern char lafc(int argc, char *argv[]);
int main(int argc, char *argv[]) {
  return lafc(argc, argv);
}
> cat lafc.c
char lafc(int argc, char *argv[]) {
  char ec = argv[argc - 1][0];
@weliveindetail
weliveindetail / 0001-Run-test-suite-on-mvp-package.patch
Created July 12, 2023 12:43
Run test suite on mvp-package with AppleClang and without OMVLL_PYTHONPATH
From beb385fd3dfc34523b9e968bbcd5a59c163dc743 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= <stefan.graenitz@gmail.com>
Date: Wed, 12 Jul 2023 14:39:03 +0200
Subject: [PATCH] Run test suite on mvp-package
OMVLL_PYTHONPATH
---
src/test/lit.cfg.py | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
@weliveindetail
weliveindetail / 0001-hack-Remove-assertions-for-duplicate-option-registra.patch
Created July 5, 2023 12:13
[llvm][hack] Remove assertions for duplicate option registration
From 73643507109bc6cff9a6582d3902492acbd63793 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= <stefan.graenitz@gmail.com>
Date: Wed, 5 Jul 2023 14:09:32 +0200
Subject: [PATCH] [hack] Remove assertions for duplicate option registration
---
llvm/include/llvm/Support/CommandLine.h | 4 +++-
llvm/lib/Support/CommandLine.cpp | 6 +++---
2 files changed, 6 insertions(+), 4 deletions(-)
@weliveindetail
weliveindetail / README.md
Created July 2, 2023 12:27
git-baobab-me-test

Checkout repo with git-baobab-me script:

➜ cd /path/to/test-dir
➜ git clone https://github.com/weliveindetail/git-baobab.git git-baobab
Cloning into 'git-baobab'...
remote: Enumerating objects: 223, done.
remote: Counting objects: 100% (36/36), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 223 (delta 19), reused 26 (delta 12), pack-reused 187
Receiving objects: 100% (223/223), 7.04 MiB | 5.98 MiB/s, done.
@weliveindetail
weliveindetail / README.md
Created May 17, 2023 12:48
git-bisect-llvm-project

Run git bisect:

> git bisect start
> git bisect good 72a72315b052180a7df90a26000fdca4ef09dd94
> git bisect bad f2bb57c19455e77fd71be782f9ee9092f31bd2a9
> git bisect run /tmp/check-kaleidoscope-ch4.sh
...

ready> ready> Evaluated to 5.000000
ready> ready> + exit_code=0
@weliveindetail
weliveindetail / raspbian11-aarch32-rpi3b-clang13.log
Last active February 9, 2024 10:28
All details about compilers
> clang-13 -xc++ -E -v /dev/null 2>&1
Raspbian clang version 13.0.1-6~deb11u1+rpi1
Target: arm-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/10
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/8
Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/10