Skip to content

Instantly share code, notes, and snippets.

View jwakely's full-sized avatar
👁️
Massive eye is watching you, but don't worry about it.

Jonathan Wakely jwakely

👁️
Massive eye is watching you, but don't worry about it.
View GitHub Profile
@jwakely
jwakely / update-gcc.sh
Last active September 26, 2021 10:51 — forked from siddhesh/update-glibc.sh
#!/bin/bash
# Update Patchwork patch list from commits in the upstream repo.
# Intended for use with glibc and gcc.
#
# [pw]
# server = https://patchwork.sourceware.org/api/1.2/
# project = gcc
# token = <API token>
# states = committed,accepted,superseded,deferred,rejected
#
@jwakely
jwakely / README.md
Last active June 15, 2021 13:33 — forked from ldionne/README.md
From-scratch Lit configuration for Wakely

The simplest approach is to just replace libcxx/test/lit.cfg.py with the lit.cfg.py file below, then you can just run the tests in-place via a command like:

$LLVM_SOURCE_ROOT/llvm/utils/lit/lit.py -s -i -j4 std/utilities/ratio

Alternatively, put the libstdcxx.cfg.in file in libcxx/test/configs/libstdcxx.cfg.in. Then, configure the LLVM tree with -DLIBCXX_TEST_CONFIG=<path-to-libstdcxx.cfg.in>.

Then, you should be able to use ./build/bin/llvm-lit -sv <whatever>.

@jwakely
jwakely / build_gcc_versions.sh
Last active June 13, 2022 15:20
Script to build any version of GCC (since 3.4.x)
#!/bin/bash -ex
set -e
# baseurl=ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/
baseurl=ftp://sourceware.org/pub/
fetch() {
local ver=$1
local path=$( [[ $ver == ?.?.? ]] && echo releases/gcc-$ver || echo snapshots/$ver )
#include <chrono>
class WinTimer {
public:
// create and start timer
WinTimer() { reset(); }
// return ticks since timer creation or last reset
auto ticks() const
@jwakely
jwakely / grr.c
Created August 24, 2015 15:21 — forked from KyleJHarper/grr.c
Debugging a race condition with null setting.
/*
* grr.c
*
* Created on: Aug 23, 2015
* Author: Kyle Harper
*/
#include <pthread.h>
#include <stdlib.h>
@jwakely
jwakely / libgthread.a
Created July 7, 2015 10:24
Linker script for using GCC's std::thread with static linking
/* Ensure we don't use gthread weak symbols. */
EXTERN(pthread_cond_broadcast)
EXTERN(pthread_cond_destroy)
EXTERN(pthread_cond_signal)
EXTERN(pthread_cond_wait)
EXTERN(pthread_create)
EXTERN(pthread_detach)
EXTERN(pthread_equal)
EXTERN(pthread_join)
EXTERN(pthread_mutex_lock)
@jwakely
jwakely / Makefile
Created May 11, 2014 11:45
Makefile for Howard's dining philosophers benchmarks
URL := https://raw.githubusercontent.com/HowardHinnant/papers/master/dining_philosophers.html
ALGOS := SMART_POLITE SMART PERSISTENT ORDERED STD
TARGETS_ROUND := $(foreach algo,$(ALGOS),round-$(algo))
TARGETS_3D := $(foreach algo,$(ALGOS),3d-$(algo))
CXXFLAGS := -std=c++11 -O2 -pthread -Wall -Wno-sign-compare
# Define GCC_PATH to use a GCC from a non-standard path,
@jwakely
jwakely / make_array.cc
Last active December 24, 2015 23:09 — forked from lichray/make_array.cc
#include <array>
template <typename... T>
using common_type_t = typename std::common_type<T...>::type;
template <typename T1, typename... T2>
constexpr auto make_array(T1&& t1, T2&&... t2)
-> std::array<common_type_t<T1, T2...>, sizeof...(T2) + 1>
{
return { std::forward<T1>(t1), std::forward<T2>(t2)... };
#ifndef SSVU_FASTFUNC
#define SSVU_FASTFUNC
#include <cstring>
#include <type_traits>
#include <cassert>
#include <cstddef>
#include <memory>
#include <new>
#include <utility>