Added the -no-pie option for linking
This commit is contained in:
2
Makefile
2
Makefile
@@ -49,7 +49,7 @@ $(EXAMPLES): %: $(EXAMPLES_DIR)/%.cm $(COMPILER)
|
|||||||
@echo "Building $@..."
|
@echo "Building $@..."
|
||||||
./$(COMPILER) $(EXAMPLES_DIR)/$@.cm $@.asm
|
./$(COMPILER) $(EXAMPLES_DIR)/$@.cm $@.asm
|
||||||
$(NASM) $(NASMFLAGS) $@.asm -o $@.o
|
$(NASM) $(NASMFLAGS) $@.asm -o $@.o
|
||||||
$(LD) $(LDFLAGS) $@.o -o $@
|
$(LD) $(LDFLAGS) $@.o -o $@ -no-pie
|
||||||
@echo "Built $@ successfully"
|
@echo "Built $@ successfully"
|
||||||
|
|
||||||
# Run all examples
|
# Run all examples
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ static void run_test(Test *t) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Link */
|
/* Link */
|
||||||
if (run_command("gcc -m32 /tmp/test.o -o /tmp/test 2>/tmp/test.err") != 0) {
|
if (run_command("gcc -m32 /tmp/test.o -o /tmp/test 2>/tmp/test.err -no-pie") != 0) {
|
||||||
printf("FAIL (linker error)\n");
|
printf("FAIL (linker error)\n");
|
||||||
test_failed++;
|
test_failed++;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user