summaryrefslogtreecommitdiff
path: root/ports/sysdeps/tile/tilegx/Makefile
blob: d3a0e970a77e115bfc6d0eab7cf1420dfd3cd738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include $(common-objpfx)cflags-mcmodel-large.mk

$(common-objpfx)cflags-mcmodel-large.mk: $(common-objpfx)config.make
	mcmodel=no; \
	$(CC) -S -o /dev/null -xc /dev/null -mcmodel=large && mcmodel=yes; \
	echo "cflags-mcmodel-large = $$mcmodel" > $@

ifeq ($(subdir),csu)
ifeq (yes,$(cflags-mcmodel-large))
# elf-init.c is in libc_nonshared.o (the end of the shared object) but
# must reach the _init symbol at the very start of the shared object.
CFLAGS-elf-init.c += -mcmodel=large

# __gmon_start__ is at the very start of the shared object when linked
# with profiling, but calls to libc.so via the PLT at the very end.
CFLAGS-gmon-start.c += -mcmodel=large
endif
endif