Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 584014 | Differences between
and this patch

Collapse All | Expand All

(-)a/Makefile (+6 lines)
Lines 688-693 endif Link Here
688
endif
684
endif
689
KBUILD_CFLAGS += $(stackp-flag)
685
KBUILD_CFLAGS += $(stackp-flag)
690
686
687
# Check if compiler default to -fPIE/-fpie
688
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-default-pie.sh $(CC)), y)
689
	KBUILD_CFLAGS += -fno-PIE
690
	KBUILD_AFLAGS += -fno-PIE
691
endif
692
691
ifdef CONFIG_KCOV
693
ifdef CONFIG_KCOV
692
  ifeq ($(call cc-option, $(CFLAGS_KCOV)),)
694
  ifeq ($(call cc-option, $(CFLAGS_KCOV)),)
693
    $(warning Cannot use CONFIG_KCOV: \
695
    $(warning Cannot use CONFIG_KCOV: \
(-)a/scripts/gcc-default-pie.sh (+13 lines)
Line 0 Link Here
1
#!/bin/sh
2
# Test if gcc default to -fPIE/-fpie
3
# Copyright (C) 2016, Magnus Granberg <zorry@gentoo.org>
4
5
cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
6
int main(void)
7
{
8
#if !(defined(__PIE__) || defined(__pie__))
9
#error "Compiler don't default to PIE"
10
#endif
11
    return 0;
12
}
13
END

Return to bug 584014