Accepting request 284831 from home:msmeissn:branches:devel:gcc

moved to new location

- add a gcc-PIE subpackage, which enables building PIE binaries
  by default using the defaults.spec file. bsc#912298

OBS-URL: https://build.opensuse.org/request/show/284831
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gcc?expand=0&rev=53
This commit is contained in:
Richard Biener 2015-02-09 10:56:33 +00:00 committed by Git OBS Bridge
parent 69a18be16c
commit 4ac7216a8d
2 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Feb 4 07:29:43 UTC 2015 - meissner@suse.com
- add a gcc-PIE subpackage, which enables building PIE binaries
by default using the defaults.spec file. bsc#912298
-------------------------------------------------------------------
Mon Aug 4 13:29:20 UTC 2014 - rguenther@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package gcc
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -341,6 +341,18 @@ Requires: gcc-objc = %{version}
%description -n gcc-obj-c++
The system GNU Objective C++ Compiler.
%package -n gcc-PIE
Summary: A default configuration to build all binaries in PIE mode
License: GPL-3.0+
Group: Development/Languages/Other
Requires: gcc
%description -n gcc-PIE
This package contains a configuration file (spec) that changes the
compilers default setting to build all ELF binaries in the Position
Independend Executable (PIE) variant. This enables better address
space randomization (ASLR).
%if %{build_ada}
%package -n gcc-ada
@ -423,6 +435,14 @@ ln -sf gcc-%{gcc_suffix}.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/cc.1.gz
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/bfd-plugins
ln -s `gcc-%{gcc_suffix} -print-file-name=liblto_plugin.so.0.0.0` $RPM_BUILD_ROOT%{_prefix}/lib/bfd-plugins/liblto_plugin.so.0.0.0
dir=`gcc -print-prog-name=cc1`
dir=${dir%/cc1}
mkdir -p $RPM_BUILD_ROOT/$dir
cat > $RPM_BUILD_ROOT/$dir/defaults.spec <<EOF
*default_spec:
%%{pie|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE|shared|static|nostdlib|nodefaultlibs|nostartfiles:;:-fPIE -pie}
EOF
%files
%defattr(-,root,root)
%{_prefix}/bin/gcc
@ -509,6 +529,10 @@ ln -s `gcc-%{gcc_suffix} -print-file-name=liblto_plugin.so.0.0.0` $RPM_BUILD_ROO
# empty - only for the dependency
%doc README
%files -n gcc-PIE
%defattr(-,root,root)
/usr/lib*/gcc/*-suse-linux*/*/defaults.spec
%files -n gcc-locale
%defattr(-,root,root)
# empty - only for the dependency