-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.variables
executable file
·26 lines (22 loc) · 1.22 KB
/
Makefile.variables
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ABSCURDIR := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
SHARED := $(ABSCURDIR)/Source/Shared/Source
UNAME := $(shell uname)
# executables
CC := $(ABSCURDIR)/Tools/Cross/bin/x86_64-elf-gcc
CXX := $(ABSCURDIR)/Tools/Cross/bin/x86_64-elf-g++
# LD shouldn't be invoked... perhaps remove this...
LD := $(ABSCURDIR)/Tools/Cross/bin/x86_64-elf-ld
# CLAGS had -fpic and -std=c11, but they were removed
CFLAGS := -ffreestanding -fshort-wchar -mno-red-zone -flto -MMD -MP -Wall -Wextra -I$(SHARED)
CXXFLAGS := -ffreestanding -fshort-wchar -mno-red-zone -flto -MMD -MP -Wall -Wextra -I$(SHARED)
# ELF size appears to be unusually large when using this toolchain (but not makefiles!)
# Compiling others' ELFs with this toolchain results in unusally large ELFs too :/
# According to https://stackoverflow.com/q/46916112, the architecture's (x86_64) maximum page size is 2MB,
# which the toolchain appears to default to, as a minimal ELF is around ~2.1MB
# max-page-size: https://stackoverflow.com/a/64808242, reduces ELF size
# -Wl,-z,max-page-size=4096
# The above statement breaks the program when something like the following is declared:
# const char* testr[] {
# "testing"
# };
LDFLAGS := -static -Bsymbolic -nostdlib