Skip to content

Instantly share code, notes, and snippets.

View rofl0r's full-sized avatar

rofl0r

View GitHub Profile
when --disable-shared is used, libgcc is built without hidden visibility.
in combination with 2 other bugs, this leads to miscompilation of
musl libc.so on mips.
these 3 issues combined are:
1. gcc emitting useless .globl
2. gas generating OBJECT symbol rather than unknown type when it sees .globl
without .type
3. libgcc.a symbols not getting hidden visibility like they should
--- gcc473.org/libgcc/Makefile.in
@rofl0r
rofl0r / dist-from-tags.sh
Last active August 29, 2015 14:03
create distro tarballs for all tags in a git repo.
#!/bin/sh
# (C) 2014 rofl0r, released under the public domain.
# this script takes a repo url as arguments and then checks out
# all tags, creates a tarball from each one and prints a hyperlink
# to stdout.
# for example ./dist-from-tags.sh $HOME/git-repos/wavemon > index.html
# the tarballs are created in the current working dir.
url="$1"
this=$PWD
@rofl0r
rofl0r / getentropy_linux.c
Created July 12, 2014 12:17
libressl portable code 1
/*
* issetugid implementation for Linux
* Public domain
*/
#include <errno.h>
#include <gnu/libc-version.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
@rofl0r
rofl0r / Makefile
Created August 13, 2014 21:31 — forked from o11c/Makefile
.DEFAULT_GOAL := all
.PHONY: ${MAKECMDGOALS}
$(filter-out all,${MAKECMDGOALS}) all: .forward-all ;
.forward-all:
${MAKE} -C build ${MAKECMDGOALS}
${MAKEFILE_LIST}: ;
.SUFFIXES:
import io/[Writer, Reader]
/**
Multi-Purpose Buffer class.
This is a String, with guaranteed mutability.
All operations will be done on the Buffer itself, instead of a clone.
Other difference from String: the constructor will set capacity, not size.
*/
Buffer: class extends String{
XString: class {
data : Char*
size : SizeT
init: func (src: Char*, =size) {
data = gc_malloc(size)
memcpy (data, src, size)
}
using Posix;
[Compact]
public class Test {
public void test() {
stdout.puts ("foo\n");
}
}
static int main(){
opening file nagtest.ooc for read...
full name nagtest
myst name .
/home/rofl/dev/rock/sdk/lang/Exception.ooc
/home/rofl/dev/rock/sdk/lang/System.ooc
/home/rofl/dev/rock/sdk/lang/Memory.ooc
/home/rofl/dev/rock/sdk/lang/types.ooc~
/home/rofl/dev/rock/sdk/lang/types.ooc
/home/rofl/dev/rock/sdk/lang/Numbers.ooc
/home/rofl/dev/rock/sdk/lang/Buffer.ooc
OOC: Changes to String
String is now a class, which wraps a Buffer in a immutable way.
this means every method that can change the string, like trim, is executed on a clone of the internal buffer, then a new String including that buffer is returned.
the other difference between string and buffer is, that methods for the buffer are mostly of void return type, while String always returns a new instance. so you can do something like
// s infers to String here
s := " /tmp/aaa/bbb " trim() replaceAll("/", "\\") reverse()
here a new string is created, then each time a clone created and the method applied on the clones buffer
so this makes for at least 4 memory allocations and complete memcpy, which isnt very efficient.
main: func (argc: Int, argv: Char**) {
for (i in 1..argc) printf (argv[i])
}
$ rm -rf .libs/ rock_tmp/ && rock plain.ooc -gc=dynamic +-Os -dce
$ ls -lat plain
-rwxr-xr-x 1 rofl users 133283 31. Aug 18:50 plain
$ objdump -t plain