Skip to content

Instantly share code, notes, and snippets.

@xeno14
Created August 10, 2020 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeno14/7e28176d39ec5c196720e40eade18381 to your computer and use it in GitHub Desktop.
Save xeno14/7e28176d39ec5c196720e40eade18381 to your computer and use it in GitHub Desktop.
『自作エミュレータで学ぶx86アーキテクチャ』Chapter 3.7で64bit環境でバイナリを生成する場合のtolset_p86/exec-c-test/Makefileの差分
--- Makefile.orig 2020-08-10 18:42:26.102494400 +0900
+++ Makefile 2020-08-10 18:47:55.182494400 +0900
@@ -6,8 +6,9 @@ CC = gcc
LD = ld
AS = nasm
CFLAGS += -nostdlib -fno-asynchronous-unwind-tables \
- -I$(Z_TOOLS)/i386-elf-gcc/include -g -fno-stack-protector
-LDFLAGS += --entry=start --oformat=binary -Ttext 0x7c00
+ -I$(Z_TOOLS)/i386-elf-gcc/include -g -fno-stack-protector \
+ -m32 -march=i386 -fno-pie
+LDFLAGS += --entry=start --oformat=binary -Ttext 0x7c00 -m elf_i386
.PHONY: all
all :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment