Skip to content

Instantly share code, notes, and snippets.

@gabrielschulhof
Last active April 7, 2017 19:28
Show Gist options
  • Save gabrielschulhof/fca78d4b7a70a689bed5f83644572b10 to your computer and use it in GitHub Desktop.
Save gabrielschulhof/fca78d4b7a70a689bed5f83644572b10 to your computer and use it in GitHub Desktop.
static void the_constructor(void) __attribute__((constructor));
static void the_constructor(void) {
while(1);
}
int main(int argc, char **argv) {
return 0;
}
COMMON_FLAGS = \
-flto \
-fno-fat-lto-objects \
-fno-builtin \
-fno-stack-protector \
-Wall \
-Werror=all \
-Wextra \
-Werror=extra \
-Wformat-nonliteral \
-Werror=format-nonliteral \
-Winit-self \
-Werror=init-self \
-Wconversion \
-Werror=conversion \
-Wsign-conversion \
-Werror=sign-conversion \
-Wformat-security \
-Werror=format-security \
-Wmissing-declarations \
-Werror=missing-declarations \
-Wshadow \
-Werror=shadow \
-Wstrict-prototypes \
-Werror=strict-prototypes \
-Wundef \
-Werror=undef \
-Wold-style-definition \
-Werror=old-style-definition \
-Wno-stack-protector \
-Wno-attributes \
-Wlogical-op \
-Werror=logical-op \
-Werror \
-std=c99 \
-pedantic \
-g
CFLAGS = \
-DCONFIG_DISABLE_ES2015_BUILTIN \
-DCONFIG_DISABLE_ES2015_PROMISE_BUILTIN \
-DCONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN \
-DCONFIG_MEM_HEAP_AREA_SIZE=524288 \
-DJERRY_ENABLE_ERROR_MESSAGES \
-DJERRY_ENABLE_SNAPSHOT_EXEC \
-DJERRY_ENABLE_SNAPSHOT_SAVE \
-DJERRY_JS_PARSER=1 \
-I/home/nix/iot/jerryscript/jerry-core \
-I/home/nix/iot/jerryscript/jerry-core/debugger \
-I/home/nix/iot/jerryscript/jerry-core/ecma/base \
-I/home/nix/iot/jerryscript/jerry-core/ecma/builtin-objects \
-I/home/nix/iot/jerryscript/jerry-core/ecma/builtin-objects/typedarray \
-I/home/nix/iot/jerryscript/jerry-core/ecma/operations \
-I/home/nix/iot/jerryscript/jerry-core/jcontext \
-I/home/nix/iot/jerryscript/jerry-core/jmem \
-I/home/nix/iot/jerryscript/jerry-core/jrt \
-I/home/nix/iot/jerryscript/jerry-core/lit \
-I/home/nix/iot/jerryscript/jerry-core/parser/js \
-I/home/nix/iot/jerryscript/jerry-core/parser/regexp \
-I/home/nix/iot/jerryscript/jerry-core/vm \
-I/home/nix/iot/jerryscript/jerry-libm/include \
-isystem /home/nix/iot/jerryscript/jerry-libc/include \
$(COMMON_CFLAGS)
LDFLAGS = \
-static \
-flto \
-Wl,-z,noexecstack \
-nostdlib \
-lgcc
tmp: main.o constructor.o
$(CC) $(COMMON_CFLAGS) $(LDFLAGS) -o $@ main.o constructor.o /home/nix/iot/jerryscript/build/tests/napitests/lib/libjerry-libc.a
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<
clean:
rm -f tmp main.o constructor.o
.PHONY: clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment