summaryrefslogtreecommitdiffhomepage
path: root/project/extras.mk
blob: 73d6b39420906ec27aaae7a5bd19963c5cc0b70c (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
44
45
46
47
48
./src/internal/version.o:	build/version.h
./src/internal/version.lo:	build/version.h

# libc.so
SHARED_OBJS      += $(LDSO_OBJS)

LDFLAGS_COMMON   += -nostdlib
LDFLAGS_COMMON   += -Wl,-Bsymbolic-functions
LDFLAGS_COMMON   += -Wl,--sort-common
LDFLAGS_COMMON   += -Wl,--gc-sections
LDFLAGS_COMMON   += -Wl,--no-undefined
LDFLAGS_COMMON   += -Wl,--exclude-libs=ALL

LDFLAGS_COMMON   += -Wl,-e              -Wl,_dlstart
LDFLAGS_COMMON   += -Wl,--sort-section  -Wl,alignment

SHARED_LIB_DEPS  += -lgcc -lgcc_eh

ifeq ($(CC_BINFMT),ELF)
LDFLAGS_COMMON   += -Wl,--hash-style    -Wl,both
endif

# common cflags
CFLAGS_COMMON    += -fdata-sections
CFLAGS_COMMON    += -ffunction-sections
CFLAGS_COMMON    += -fno-unwind-tables
CFLAGS_COMMON    += -fno-asynchronous-unwind-tables
CFLAGS_COMMON    += -frounding-math
CFLAGS_COMMON    += -fexcess-precision=standard

# assembler cflags
ifeq ($(CC_BINFMT),ELF)
CFLAGS_ASM       += -Wa,--noexecstack
CFLAGS_CONFIG    += $(CFLAGS_ASM)
endif

# memory modules
libc_mem_modules  = \
	./src/string/memcpy.c \
	./src/string/memmove.c \
	./src/string/memcmp.c   \
	./src/string/memset.c

libc_mem_objs     = $(libc_mem_modules:%.c=%.o)
libc_mem_lobjs    = $(libc_mem_modules:%.c=%.lo)

$(libc_mem_objs):   CFLAGS_CONFIG += -fno-tree-loop-distribute-patterns
$(libc_mem_lobjs):  CFLAGS_CONFIG += -fno-tree-loop-distribute-patterns