switch to the standard gcc
Found a bug in Intel's cross-compiler. => Switch to the standard gcc and use the flags "-march=i586 -mtune=i586" => Code runs on all Pentium (I) systems
This commit is contained in:
parent
0c61f5dee1
commit
93d9540785
4 changed files with 12 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -14,6 +14,7 @@ Makefile
|
|||
include/metalsvm/config.h
|
||||
include/metalsvm/config.inc
|
||||
tools/make_initrd
|
||||
tools/scc_bootinfo.asm
|
||||
newlib/examples/hello
|
||||
newlib/examples/jacobi
|
||||
newlib/examples/echo
|
||||
|
|
|
@ -12,10 +12,6 @@ STACKPROT = -fno-stack-protector
|
|||
# Set your own cross compiler tool chain prefix here
|
||||
CROSSCOMPREFIX =
|
||||
|
||||
# Uncomment both lines if compiling for the SCC!
|
||||
CROSSCOMPREFIX = i386-unknown-linux-gnu-
|
||||
STACKPROT =
|
||||
|
||||
CC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
|
||||
CXX_FOR_TARGET = $(CROSSCOMPREFIX)g++
|
||||
GCC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
|
||||
|
@ -42,7 +38,7 @@ NASMFLAGS = -felf32 -g -i$(TOPDIR)/include/metalsvm/
|
|||
INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include -I$(TOPDIR)/lwip/src/include -I$(TOPDIR)/lwip/src/include/ipv4 -I$(TOPDIR)/drivers
|
||||
# For 64bit support, you have to define "-m64 -mno-red-zone" instead of "-m32 -march=i586"
|
||||
# Compiler options for final code
|
||||
CFLAGS = -g -m32 -march=i586 -Wall -O2 -fstrength-reduce -fomit-frame-pointer -finline-functions -ffreestanding $(INCLUDE) $(STACKPROT)
|
||||
CFLAGS = -g -m32 -march=i586 -mtune=i586 -Wall -O2 -fstrength-reduce -fomit-frame-pointer -finline-functions -ffreestanding $(INCLUDE) $(STACKPROT)
|
||||
# Compiler options for debuging
|
||||
#CFLAGS = -g -O -m32 -march=i586 -Wall -fomit-frame-pointer -ffreestanding $(INCLUDE) $(STACKPROT)
|
||||
ARFLAGS = rsv
|
||||
|
@ -51,7 +47,7 @@ STRIP_DEBUG = --strip-debug
|
|||
KEEP_DEBUG = --only-keep-debug
|
||||
OUTPUT_FORMAT = -O elf32-i386
|
||||
# For 64bit support, you have to define -m64 instead of "-m32 -march=i586"
|
||||
CFLAGS_FOR_NEWLIB = -m32 -march=i586 -O2 $(STACKPROT)
|
||||
CFLAGS_FOR_NEWLIB = -m32 -march=i586 -mtune=i586 -O2 $(STACKPROT)
|
||||
# For 64bit support, you have to define -m64 instead of "-m32 -march=i586"
|
||||
LDFLAGS_FOR_NEWLIB = -m32 -march=i586
|
||||
# For 64bit support, you have to define -m64 instead of "-m32"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
MAKE = make
|
||||
CC = gcc
|
||||
CROSS_COMPILE=i386-unknown-linux-gnu-gcc
|
||||
CROSS_OBJCOPY=i386-unknown-linux-gnu-objcopy
|
||||
CROSS_COMPILE=gcc
|
||||
CROSS_OBJCOPY=objcopy
|
||||
CFLAGS = -m32 -O2 -Wall
|
||||
LDFLGAS =
|
||||
DEFINES=
|
||||
DEFINES =
|
||||
NASM = nasm
|
||||
NASMFLAGS = -fbin
|
||||
EXECFILES = $(shell find ../newlib/examples -perm -u+r+x -type f)
|
||||
|
@ -33,6 +33,9 @@ smp_setup.hex: smp_setup.bin
|
|||
scc_setup.bin: scc_setup.asm
|
||||
$(NASM) $(NASMFLAGS) -o $@ $<
|
||||
|
||||
reset_vector.o: reset_vector.S
|
||||
gcc -m32 -c -o reset_vector.o reset_vector.S
|
||||
|
||||
reset_vector.bin: reset_vector.o
|
||||
ld --oformat binary -Ttext 0 -melf_i386 -o $@ $<
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* Copyright (c) 2004 Fabrice Bellard
|
||||
*/
|
||||
|
||||
// MetalSVM reuses the same routine to launch its preloaded kernel
|
||||
|
||||
#define LOAD_SEG 0x9000
|
||||
// define CONFIG_MCEMU_DEBUG 1
|
||||
.code16
|
||||
|
@ -36,4 +38,4 @@ _realstart:
|
|||
_start:
|
||||
jmp _realstart
|
||||
_end:
|
||||
.fill 4096 - _end, 1, 0
|
||||
.fill 4096 - $, 1, 0
|
||||
|
|
Loading…
Add table
Reference in a new issue