Skip to content
Browse files

build fix: slect better defaults for compiler tools

this includes CC, CXX, LD, CPP, OBJCOPY, and NM.

A new variable CROSS_COMPILER is set to allow the user to define their own compiler prefix.

The default will be CC=gcc, etc.
  • Loading branch information...
1 parent 21d3f70 commit f8d32b161cc2a86eb849af1ef7851300c3f4efbb @bartman committed
Showing with 16 additions and 12 deletions.
  1. +8 −6 config/x86.mk
  2. +8 −6 config/x86_64.mk
View
14 config/x86.mk
@@ -1,12 +1,14 @@
# Copyright (c) 2011 by Markus Duft <mduft@gentoo.org>
# This file is part of the 'tachyon' operating system.
-CC := x86_64-pc-elf-gcc
-CXX := x86_64-pc-elf-g++
-LD := x86_64-pc-elf-ld
-CPP := x86_64-pc-elf-cpp
-OBJCOPY := x86_64-pc-elf-objcopy
-NM := x86_64-pc-elf-nm
+#CROSS_COMPILER := x86_64-pc-elf-
+
+CC := ${CROSS_COMPILER}gcc
+CXX := ${CROSS_COMPILER}g++
+LD := ${CROSS_COMPILER}ld
+CPP := ${CROSS_COMPILER}cpp
+OBJCOPY := ${CROSS_COMPILER}objcopy
+NM := ${CROSS_COMPILER}nm
KERNEL_CPPFLAGS := -D__X86__
KERNEL_CFLAGS := -O0 -g -m32 $(KERNEL_CPPFLAGS)
View
14 config/x86_64.mk
@@ -1,12 +1,14 @@
# Copyright (c) 2011 by Markus Duft <mduft@gentoo.org>
# This file is part of the 'tachyon' operating system.
-CC := x86_64-pc-elf-gcc
-CXX := x86_64-pc-elf-g++
-LD := x86_64-pc-elf-ld
-CPP := x86_64-pc-elf-cpp
-OBJCOPY := x86_64-pc-elf-objcopy
-NM := x86_64-pc-elf-nm
+#CROSS_COMPILER := x86_64-pc-elf-
+
+CC := ${CROSS_COMPILER}gcc
+CXX := ${CROSS_COMPILER}g++
+LD := ${CROSS_COMPILER}ld
+CPP := ${CROSS_COMPILER}cpp
+OBJCOPY := ${CROSS_COMPILER}objcopy
+NM := ${CROSS_COMPILER}nm
KERNEL_CPPFLAGS := -D__X86_64__
KERNEL_CFLAGS := -O0 -g -mcmodel=kernel -mno-red-zone -mno-sse $(KERNEL_CPPFLAGS)

1 comment on commit f8d32b1

@mduft

as i commented on the associated issue, this is not a bug, as the according (hardcoded) compilers are created using a script. i want to avoid using external tools. of course this may be worth re-thinking... for now i'd prefer to leave it as it is.

Please sign in to comment.
Something went wrong with that request. Please try again.