Skip to content

Instantly share code, notes, and snippets.

View abrodkin's full-sized avatar

Alexey Brodkin abrodkin

View GitHub Profile
@abrodkin
abrodkin / cpython-2.x-no-usr-local.md
Created September 25, 2018 11:25
Build CPython 2.x with crap in /usr/local/
diff --git a/setup.py b/setup.py
index 33cecc6875..52265a58fc 100644
--- a/setup.py
+++ b/setup.py
@@ -454,10 +454,6 @@ class PyBuildExt(build_ext):
             os.unlink(tmpfile)
 
     def detect_modules(self):
- # Ensure that /usr/local is always used

CROSS-TOOLCHAIN (with GNU tools from ARC GitHub):

CT_EXPERIMENTAL=y
CT_PREFIX_DIR="${PWD}/toolchain_cross"
CT_ARCH_ARC=y
CT_ARCH_CPU="hs38_linux"
# CT_DEMULTILIB is not set
CT_TARGET_VENDOR="snps"
CT_KERNEL_LINUX=y
CT_BINUTILS_SRC_DEVEL=y

To run glibc test-suite on target without native toolchain we need to have the following 2 requirements:

  1. Host executes tests on target via SSH so we need to have SSH server up and running on target. Moreover we need to either enable paswordless login via SSH or install user's SSH key on target so that execution scripts may connect to target via SSH without asking user for entering pasword all the time (there're 5k+ tests).

  2. Host's filesystem must be accessible from target. Moreover paths must match exactly on both devices (i.e. "/home/username/glibc-testsuite" in both cases must be available and contain exectly the same data) because tests are being built on the fly and immediately get executed via SSH. Thus we need to mount host's filesystem with glibc testsuite on target.

SSH SERVER

@abrodkin
abrodkin / chocolate-doom-qemu.txt
Last active March 27, 2024 18:47
Chocolate-doom execution in QEMU or simple embedded Linux board with framebuffer.
fbset > /etc/fb.modes
export SDL_NOMOUSE=1
chocolate-doom
@abrodkin
abrodkin / recvRawEth.c
Last active April 7, 2021 05:11 — forked from austinmarton/recvRawEth.c
Receive raw Ethernet frames in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>