summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/x86_64/MCONFIG
blob: 70d690e331aa1bb8ef08d307084092ed5d08158f (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- makefile -*-
#
# arch/x86-64/MCONFIG
#
# Special rules for this architecture.  Note that this is actually
# included from the main Makefile, and that pathnames should be
# accordingly.
#
# Blatantly copied and modified from i386 version by Mats Petersson, AMD.
#

#
# NOTE: -fno-asynchronous-unwind-tables produce significantly smaller
# binaries (20% smaller), but makes the code completely useless for
# debugging using gdb.
#
KLIBCARCHREQFLAGS = -m64
KLIBCOPTFLAGS     += -Os -fomit-frame-pointer -mno-sse \
                     $(call cc-option,-falign-functions=1, )	\
                     $(call cc-option,-falign-jumps=1, )	\
                     $(call cc-option,-falign-loops=1, )
ifeq ($(DEBUG),y)
KLIBCOPTFLAGS     += -g
else
KLIBCOPTFLAGS     += -fno-asynchronous-unwind-tables
endif
KLIBCBITSIZE      = 64
KLIBCLDFLAGS      = -m elf_x86_64 $(LD_IMAGE_BASE_OPT) 0x00400000

# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
# 2 MB - normal binaries start at 4 MB
#
# binutils now uses max-page-size=0x200000 by default, which pushes
# klibc.so data over the 4 MB mark, overlapping the executable.
# The old default was max-page-size=0x100000, but that also results
# in a broken layout with binutils 2.30.  Since there's no
# architectural page size betwen 4 KB and 2MB, set it to 4 KB.
KLIBCSHAREDFLAGS     = $(LD_IMAGE_BASE_OPT) 0x00200000 -z max-page-size=0x1000

# Kernel has never used stack trampolines
KLIBCEXECSTACK := n