Skip to content

Instantly share code, notes, and snippets.

@xxuejie
xxuejie / status.md
Created March 3, 2014 13:09
Regarding the current status of webruby

We now have reached a corner regarding the development of webruby.Emscripten is now switching to a LLVM-based backend, which eventually will replace the old JS-based backend. However, a bug in clang prevents us to use the new le32-unknown-nacl triple in LLVM/emscripten, it also prevents us from using the new LLVM-based backend of emscripten.

A fix has been developed for LLVM to solve this problem, but as of today, it's neither in the PNaCl fork of clang, nor emscripten-fastcomp-clang. So this prevents us from switching to the latest version of emscripten.

In a meantime, an attempt to fix this problem at mruby side was also rejected, since this would complicate mruby a lot for a small corner case.

We could maintain

@xxuejie
xxuejie / .vimrc
Created April 12, 2014 04:24
Minimal vimrc
set nocompatible
syntax on
filetype plugin indent on
set background=dark
colorscheme solarized
set ffs=mac,unix,dos
set encoding=utf-8
@xxuejie
xxuejie / build.log
Last active August 29, 2015 14:14
mruby build log
(in /Users/rafael/develop/opensource/mruby)
mkdir -p /Users/rafael/develop/opensource/mruby/bin
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/array.o" -c "/Users/rafael/develop/opensource/mruby/src/array.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/backtrace.o" -c "/Users/rafael/develop/opensource/mruby/src/backtrace.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -DMRB_DEBUG -I"/Users/rafael/develop/opensource/mruby/include" -MMD -o "/Users/rafael/develop/opensource/mruby/build/host/src/class.o" -c "/Users/rafael/develop/opensource/mruby/src/class.c"
"gcc" -g -std=gnu99 -O3 -Wall -Werror-implicit-functi
@xxuejie
xxuejie / Rakefile
Created February 22, 2015 09:10
Webruby project rakefile including SDL2
require 'webruby'
# This file sets up the build environment for a webruby project.
Webruby::App.setup do |conf|
# Entrypoint file name
conf.entrypoint = 'app/app.rb'
# By default, the build output directory is "build/"
conf.build_dir = 'build'
@xxuejie
xxuejie / solarize.sh
Created September 18, 2012 18:45 — forked from codeforkjeff/solarize.sh
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
@xxuejie
xxuejie / va-args-bug.c
Created November 13, 2012 01:58
va_arg bug of emscripten
#include <stdio.h>
#include <stdarg.h>
typedef struct type_a {
union {
double f;
void *p;
int i;
short sym;
} value;
@xxuejie
xxuejie / clang++.out
Created November 21, 2012 23:02
setjmp/longjmp workaround using C++ exceptions
$ clang++ stack-manipulation-exception.cc
$ ./a.out
Entering stack_manipulate_func, level: 0
Normal execution path, level: 0
Entering stack_manipulate_func, level: 1
Throws exception at level 1
Error execution path, level: 0
Exiting stack_manipulate_func, level: 0
@xxuejie
xxuejie / clang.out
Created November 21, 2012 22:43
Stack manipulation setjmp with emscripten
$ clang stack-manipulation.c
$ ./a.out
Entering stack_manipulate_func, level: 0
Setjmp normal execution path, level: 0
Entering stack_manipulate_func, level: 1
Perform longjmp at level 1
Setjmp error execution path, level: 0
Exiting stack_manipulate_func, level: 0
@xxuejie
xxuejie / clang.out
Created December 7, 2012 22:49
setjmp does not restore local variables
$ clang setjmp-test.c
$ ./a.out
setjmp normal execution path, level: 0, prev_jmp: 0x0
setjmp normal execution path, level: 1, prev_jmp: 0x7fff5df345f0
level is 2, perform longjmp!
setjmp exception execution path, level: 1, prev_jmp: 0x7fff5df345f0
prev_jmp is not empty, continue with longjmp!
setjmp exception execution path, level: 0, prev_jmp: 0x0
Exiting setjmp function, level: 0, prev_jmp: 0x0
@xxuejie
xxuejie / clang++.out
Created December 7, 2012 23:16
c++ exception also does not restore local variables
$ clang++ setjmp-cpp-test.cc
$ ./a.out
setjmp normal execution path, level: 0, prev_jmp: -1
setjmp normal execution path, level: 1, prev_jmp: 0
level is 2, perform longjmp!
setjmp exception execution path, level: 1, prev_jmp: 0
prev_jmp is not empty, continue with longjmp!
setjmp exception execution path, level: 0, prev_jmp: -1
Exiting setjmp function, level: 0, prev_jmp: -1