Skip to content

Instantly share code, notes, and snippets.

View VitalyAnkh's full-sized avatar
🏠
Reading stacks project

VitalyR VitalyAnkh

🏠
Reading stacks project
View GitHub Profile
@VitalyAnkh
VitalyAnkh / gist:d453d6361a7457f758c8c9af73ca46b9
Last active May 9, 2022 07:59
tools/dev/gm.py riscv32.debug
tools/dev/gm.py riscv32.debug
# mkdir -p out/riscv32.debug
# echo > out/riscv32.debug/args.gn << EOF
is_component_build = true
is_debug = true
symbol_level = 2
target_cpu = "x86"
v8_target_cpu = "riscv32"
use_goma = false
v8_enable_backtrace = true
@VitalyAnkh
VitalyAnkh / sicp_polyglot.org
Created May 18, 2022 17:08
sicp_polyglot.org

sicp-polyglot

Chapter 1. Building Abstraction with Procedures

Square Roots by Newton’s Method

Rust

fn average(x: f64, y: f64) -> f64 {
    (x + y) / 2.0
@VitalyAnkh
VitalyAnkh / gist:00ecdaf21d800729b4e4bff042d8db8c
Created June 23, 2022 10:04
gnu-toochaine make riscv32gc error
if test -f /home/vitalyr/projects/dev/c/riscv-gnu-toolchain/riscv-gcc/contrib/download_prerequisites && test "false" = "true"; then cd /home/vitalyr/projects/dev/c/riscv-gnu-toolchain/riscv-gcc && ./contrib/download_prerequisites; fi
rm -rf stamps/build-gcc-linux-stage1 build-gcc-linux-stage1
mkdir build-gcc-linux-stage1
cd build-gcc-linux-stage1 && /home/vitalyr/projects/dev/c/riscv-gnu-toolchain/riscv-gcc/configure \
--target=riscv32-unknown-linux-gnu \
\
--prefix=/opt/riscv \
--with-sysroot=/opt/riscv/sysroot \
--with-newlib \
--without-headers \
@VitalyAnkh
VitalyAnkh / support-clang.patch
Created June 28, 2022 08:01
support-clang.patch
From 0ca13669edde3ce8f92f3a13ce06d52e95eb6526 Mon Sep 17 00:00:00 2001
From: Lu Yahan <[email protected]>
Date: Thu, 23 Jun 2022 10:12:21 +0800
Subject: [PATCH] support clang
---
build_config.h | 5 +++++
config/compiler/BUILD.gn | 30 ++++++++++++++++++++++++++----
config/riscv.gni | 18 ++++++++++++++++++
toolchain/linux/BUILD.gn | 35 +++++++++++++++++++++++++++++++++++
This file has been truncated, but you can view the full file.
WARNING: No org-loaddefs.el file could be found from where org.el is loaded.
You need to run "make" or "make autoloads" from Org lisp directory
Error: user-error ("CSL style file not found: \"acm-siggraph.csl\"")
debug-early-backtrace()
debug-early(error (user-error "CSL style file not found: \"acm-siggraph.csl\""))
user-error("CSL style file not found: %S" "acm-siggraph.csl")
org-cite-csl--style-file((:export-options nil :back-end #s(org-export-backend :name latex :parent nil :transcoders ((bold . org-latex-bold) (center-block . org-latex-center-block) (clock . org-latex-clock) (code . org-latex-code) (drawer . org-latex-drawer) (dynamic-block . org-latex-dynamic-block) (entity . org-latex-entity) (example-block . org-latex-example-block) (export-block . org-latex-export-block) (export-snippet . org-latex-export-snippet) (fixed-width . org-latex-fixed-width) (footnote-definition . org-latex-footnote-definition) (footnote-reference . org-latex-footnote-reference) (headline . org-latex-headline) (hori
ninja -C build
ninja: Entering directory `build'
[44/55] Compiling C object core/libcogcore.so.9.1.1.p/cog-utils.c.o
FAILED: core/libcogcore.so.9.1.1.p/cog-utils.c.o
ccache cc -Icore/libcogcore.so.9.1.1.p -Icore -I../core -I/usr/include/wpe-webkit-1.1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libsoup-3.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/wpe-1.0 -I/usr/include/libmanette -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -DCOG_INSIDE_COG__=1 -DCOG_USE_SOUP2=1 -fPIC -pthread -DWPE_ENABLE_XKB=1 '-DG_LOG_DOMAIN="Cog-Core"' -MD -MQ core/libcogcore.so.9.1.1.p/cog-utils.c.o -MF core/libcogcore.so.9.1.1.p/cog-utils.c.o.d -o core/libcogcore.so.9.1.1.p/cog-utils.c.o -c ../core/cog-utils.c
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:34,
from /usr/include/glib-2.0/glib/galloca.h:34,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/glib-2.0/gobj
@VitalyAnkh
VitalyAnkh / gist:cd7136a82dfe944ed15f453a8044006d
Created September 28, 2022 13:51
wayland-info output on Arch Linux with Nvidia 3060, 515.76 driver
❰vitalyr❙~❱✔≻ wayland-info
interface: 'wl_compositor', version: 5, name: 1
interface: 'wl_eglstream_display', version: 1, name: 2
interface: 'wl_drm', version: 2, name: 3
interface: 'wl_shm', version: 1, name: 4
formats (fourcc):
0x48344258 = 'XB4H'
0x48344241 = 'AB4H'
0x48345258 = 'XR4H'
0x48345241 = 'AR4H'
❰vitalyr❙~/projects/dev/c/cog(git≠master)❱✔≻ ./build/launcher/cog
(cog:56320): GLib-GIO-WARNING **: 21:52:18.637: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal. It should do one of these.
Cog-Core-Message: 21:52:19.164: <file:///home/vitalyr/projects/dev/c/cog> Load started.
Cog-Core-Message: 21:52:19.172: <file:///home/vitalyr/projects/dev/c/cog> Loading...
**
Cog-Wayland:ERROR:../platform/wayland/cog-platform-wl.c:1681:on_export_wl_egl_image: assertion failed: (wpe_view_data.buffer)
Bail out! Cog-Wayland:ERROR:../platform/wayland/cog-platform-wl.c:1681:on_export_wl_egl_image: assertion failed: (wpe_view_data.buffer)
fish: Job 1, './build/launcher/cog' terminated by signal SIGABRT (Abort)
@VitalyAnkh
VitalyAnkh / gist:9045aca2be2ef7ed1a6698455a3cf7e2
Created September 28, 2022 13:58
WAYLAND_DEBUG=client cog output
WAYLAND_DEBUG=client ./build/launcher/cog
[ 602322.452] -> [email protected]_registry(new id wl_registry@2)
[ 602322.466] -> [email protected](new id wl_callback@3)
[ 602322.750] [email protected]_id(3)
[ 602322.753] [email protected](1, "wl_compositor", 5)
[ 602322.756] [email protected](2, "wl_eglstream_display", 1)
[ 602322.759] [email protected](3, "wl_drm", 2)
[ 602322.761] [email protected](4, "wl_shm", 1)
[ 602322.762] [email protected](5, "wl_output", 2)
[ 602322.763] [email protected](6, "zxdg_output_manager_v1", 3)
@VitalyAnkh
VitalyAnkh / gist:687335e0e65c12b8ad0bad940968e254
Last active May 12, 2023 05:59
mozilla-central code count
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Assembly 324 281143 245678 16319 19146
GNU Style Assembly 294 188424 158033 11040 19351
Autoconf 400 56326 43210 6479 6637
Automake 17 4272 3670 253 349
BASH 26 2267 1588 391 288
Batch 34 2375 1934 117 324
C 4396 4440746 3457222 601138 382386