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 / support-clang.patch
Created June 28, 2022 08:01
support-clang.patch
From 0ca13669edde3ce8f92f3a13ce06d52e95eb6526 Mon Sep 17 00:00:00 2001
From: Lu Yahan <yahan@iscas.ac.cn>
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 +++++++++++++++++++++++++++++++++++
@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 / 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: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 / gist:1d146e2bcf46402e2b45d1201fbdd230
Created May 1, 2022 06:05
drm_info output when mutter is causing a invisible cursor
Node: /dev/dri/card0
├───Driver: nvidia-drm (NVIDIA DRM driver) version 0.0.0 (20160202)
│ ├───DRM_CLIENT_CAP_STEREO_3D supported
│ ├───DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
│ ├───DRM_CLIENT_CAP_ATOMIC supported
│ ├───DRM_CLIENT_CAP_ASPECT_RATIO supported
│ ├───DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
│ ├───DRM_CAP_DUMB_BUFFER = 1
│ ├───DRM_CAP_VBLANK_HIGH_CRTC = 1
│ ├───DRM_CAP_DUMB_PREFERRED_DEPTH = 24
@VitalyAnkh
VitalyAnkh / PKGBUILD
Created February 15, 2022 14:25
PKGBUILD for libgccjit-11.2.0
# Maintainer: Andrew Whatson <https://aur.archlinux.org/account/flatwhatson>
# Maintainer: ZenTauro <zentauro at riseup dot net>
# Contributor: Ruben De Smet <ruben dot de dot smet at glycos dot org>
# Contributor: Jashandeep Sohi <jashandeep.s.sohi@gmail.com>
pkgname=libgccjit
pkgver=11.2.0
pkgrel=1
pkgdesc='Just-In-Time Compilation using GCC.'
arch=(x86_64)
(map! :leader
;; make doom-leader-buffer-map alive
(:prefix-map ("b" . "buffer")
:desc "Toggle narrowing" "-" #'doom/toggle-narrow-buffer
:desc "Previous buffer" "[" #'previous-buffer
:desc "Next buffer" "]" #'next-buffer
(:when (featurep! :ui workspaces)
:desc "Switch workspace buffer" "b" #'persp-switch-to-buffer
:desc "Switch buffer" "B" #'switch-to-buffer)
(:unless (featurep! :ui workspaces)
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="de.neemann.digital.docu.DocuTest" time="2.573" tests="1" errors="0" skipped="0" failures="1">
<properties>
<property name="java.specification.version" value="17"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.class.path" value="/home/vitalyr/.cache/paru/clone/digital-git/src/digital-git/target/test-classes:/home/vitalyr/.cache/paru/clone/digital-git/src/digital-git/target/classes:/home/vitalyr/.m2/repository/com/thoughtworks/xstream/xstream/1.4.18/xstream-1.4.18.jar:/home/vitalyr/.m2/repository/io/github/x-stream/mxparser/1.2.2/mxparser-1.2.2.jar:/home/vitalyr/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:/home/vitalyr/.m2/repository/junit/junit/4.13.1/junit-4.13.1.jar:/home/vitalyr/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcre
In file included from termchar.h:23,
from scroll.c:25:
dispextern.h: 在函数‘GLYPH_CODE_P’中:
dispextern.h:1890:58: 错误:expected expression before ‘>’ token
1890 | (MAX_FACE_ID<TYPE_MAXIMUM (EMACS_INT)> > CHARACTERBITS
| ^
In file included from termhooks.h:27,
from frame.h:22,
from character.c:37:
dispextern.h: 在函数‘GLYPH_CODE_P’中:
# System Info:
1. `uname -a`:
Linux rex 5.7.7-arch1-1 #1 SMP PREEMPT Wed, 01 Jul 2020 14:53:16 +0000 x86_64 GNU/Linux
2. `lsb_release`:
`lsb_release` not found.
3. `/etc/lsb-release`: