Fix BZ #18043 (c4): buffer-overflow (read past the end) in wordexp/parse_dollars...
[glibc.git] / sysdeps / tile / tilegx / Makefile
blob4281dd98fc7ca62e8991c515f1c6948d0ce6cf13
1 include $(common-objpfx)cflags-mcmodel-large.mk
3 # Check for gcc to support the command-line switch, and for
4 # binutils to support the hwN_plt() assembly operators and relocations.
5 $(common-objpfx)cflags-mcmodel-large.mk: $(common-objpfx)config.make
6 mcmodel=no; \
7 (echo 'int main() { return getuid(); }' | \
8 $(CC) -o /dev/null -xc - -mcmodel=large -fpic) && mcmodel=yes; \
9 echo "cflags-mcmodel-large = $$mcmodel" > $@
11 ifeq (yes,$(cflags-mcmodel-large))
13 ifeq ($(subdir),csu)
14 # elf-init.c is in libc_nonshared.o (the end of the shared object) but
15 # must reach the _init symbol at the very start of the shared object.
16 CFLAGS-elf-init.c += -mcmodel=large
18 # __gmon_start__ is at the very start of the shared object when linked
19 # with profiling, but calls to libc.so via the PLT at the very end.
20 CFLAGS-gmon-start.c += -mcmodel=large
21 endif
23 else
25 # Don't try to compile assembly code with hwN_plt() directives if the
26 # toolchain doesn't support -mcmodel=large.
27 ifeq ($(subdir),csu)
28 CPPFLAGS-start.S += -DNO_PLT_PCREL
29 CPPFLAGS-crti.S += -DNO_PLT_PCREL
30 endif
31 ifeq ($(subdir),nptl)
32 CPPFLAGS-pt-crti.S += -DNO_PLT_PCREL
33 endif
35 endif