gcc_secure-1.0-0.13.oe24090>    fF ;G|`u` -Fpq:ԭI0$eAt}[6/t?X1t;QjPѴWT6aHv@ Bᥩ]qlEJkUМޙ FUD}AbZe tRsjj|@wl1J]bEwY,s«wa"cu8#{xT2s8u[R[4Y܀"gYmԆ%b/?@ʷHTE F5g>xQ oՐ?DvpbԿUA.רVcA#)daٗtA=Ec aױ >yYd5X+P$ z042dd06700948ce02404fecdc8404368306e87c2d8025d3ec6738adf950d5d67799104b20d7b6607446903e726a20cba16fa67c24t*"@Lu>4*J?*:d   Itx     ! $(-48DT(89:FG4H8I<R@XDYH\X]\^ldmerfw| Cgcc_secure1.00.13.oe2409Enforcing secure compile options for abuildEnforcing secure compile option for abuildfFdc-64g.compass-ciGPL-2.0-onlyhttp://openeuler.orgSystem/Managementlinuxaarch64fFibe5448d07bcdd7b42f8dbe793c3b094a2974fe824afb630052b82cba21c857f7 rootrootgcc_secure  coreutilsrpmlib(CompressedFileNames)rpmlib(FileDigests)util-linux3.0.4-14.6.0-14.18.2c@bz@b8b@` @`.`n@Ge Wang - 1.0-0.13Chenyx - 1.0-0.12zoulin - 1.0-0.11zhangchenfeng - 1.0-0.10licihua - 1.0-0.9shenyangyang - 1.0-0.8shenyangyang - 1.0-0.7- Type:enhancement - ID:NA - SUG:NA - DESC: add requires gcc-c++- License compliance rectification- Type:enhancement - ID:NA - SUG:NA - DESC: Add automake.spec to gcc_secure_exclude- Type:enhancement - ID:NA - SUG:NA - DESC: clean spec- Type:enhancement - ID:NA - SUG:NA - DESC: support -fsigned-char for g++- Type:enhancement - ID:NA - SUG:NA - DESC:change file mode from 777 to 755 for secure- Type:enhancement - ID:NA - SUG:NA - DESC: bump release rebuilding for adding rhash.spec to macro gcc_secure_excludedc-64g.compass-ci 17270227931.0-0.13.oe2409gcc_secure.speccpiogzip9utf-82c31f945c0132154fa68f446dbbd6985eda5b8c765857f3406e0916b631ace808a2e0754a229acd40c0bfb3f64dfe0101136a456033a533e372950cae668d99cName: gcc_secure Summary: Enforcing secure compile options for abuild License: GPL-2.0-only Group: System/Management Version: 1.0 Release: 0.13 BuildRoot: /var/tmp/gcc_secure-1.0 BuildRequires: util-linux coreutils Requires: util-linux rpm grep binutils gcc coreutils rpm-build gcc-c++ %description Enforcing secure compile option for abuild %prep %pre %post echo -e '*cc1_options:\n+ %{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs:%{!fno-stack-protector:%{!fstack-protector-all:-fstack-protector-strong}}}}}' >/opt/gcc-specs-fs-cc1 echo -e '*cc1_options:\n+ %{!r:%{!D__KERNEL__:%{!pie:%{!fpic:%{!fPIC:%{!fpie:%{!fPIE:%{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE:%{!shared:%{!static:%{!nostdlib:%{!nostartfiles:-fPIE}}}}}}}}}}}}}}}' >/opt/gcc-specs-pie-cc1 echo -e '*self_spec:\n+ %{!D__KERNEL__:%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r:%{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}}' >/opt/gcc-specs-pie-ld old_gcc=/usr/bin/gcc mv $old_gcc $old_gcc"_old" cat < $old_gcc #!/bin/sh gcc_secure_exclude=\`rpm --eval 'podman.spec|gcc.spec|arm-trusted-firmware.spec|docker-engine-openeuler.spec|arts.spec|runc-openeuler.spec|kata-containers.spec|dyninst.spec|ipxe.spec|tboot.spec|syslinux.spec|gcc-libraries.spec|kpatch.spec|gdb.spec|xorg-x11-server.spec|xorg-x11-drv-fbdev.spec|xorg-x11-drv-vesa.spec|xorg-x11-drv-ati.spec|xorg-x11-drv-dummy.spec|xorg-x11-drv-intel.spec|xorg-x11-drv-nouveau.spec|xorg-x11-drv-qxl.spec|xorg-x11-drv-v4l.spec|xorg-x11-drv-vmware.spec|xorg-x11-drv-evdev.spec|xorg-x11-drv-synaptics.spec|xorg-x11-drv-vmmouse.spec|xorg-x11-drv-void.spec|xorg-x11-drv-wacom.spec|hivex.spec|gimp.spec|memstomp.spec|supermin.spec|system-config-firewall.spec|isdn4k-utils.spec|emacs.spec|graphviz.spec|buildah.spec|rhash.spec|automake.spec'\` if ! cat /.build.command | egrep "\$gcc_secure_exclude" &>/dev/null; then sec_opt='-fPIC -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fsigned-char' fs_opt='' if [[ "\$@" =~ "-O0" ]]; then #openjdk set O0 can not use FS sec_opt=\`echo \$sec_opt | sed 's/ -D_FORTIFY_SOURCE=2 -O2 / /'\` fi if [ -d '/home/abuild/rpmbuild/SOURCES' ]; then configfile=/home/abuild/rpmbuild/SOURCES/config_for_secure else configfile=/root/rpmbuild/SOURCES/config_for_secure fi if [ -f \$configfile ]; then rpm_name=\`cat \$configfile| grep rpm_name| awk -F: '{print \$NF}'\` sec_opt=\`cat \$configfile| grep sec_opt| awk -F: '{print \$NF}'\` fs_opt=\`cat \$configfile| grep fs_opt| awk -F: '{print \$NF}'\` fi if [[ x\$rpm_name = "xnumactl" ]] && [[ "\$@" =~ "-march=x86-64" ]];then #numactl i686 use asm can't add -fPIC sec_opt=\`echo \$sec_opt | sed 's/-fPIC / /'\` fi if [[ x\$rpm_name = "xglibc" ]] || [[ x\$rpm_name = "xcompat-glibc" ]];then #glibc supply fs define, can not add fs for glibc self /usr/bin/gcc_old \$sec_opt "\$@" \$fs_opt --specs=/opt/gcc-specs-pie-cc1 --specs=/opt/gcc-specs-pie-ld else /usr/bin/gcc_old \$sec_opt "\$@" \$fs_opt --specs=/opt/gcc-specs-pie-cc1 --specs=/opt/gcc-specs-pie-ld --specs=/opt/gcc-specs-fs-cc1 fi else $old_gcc"_old" "\$@" fi END1 chmod 755 $old_gcc $old_gcc"_old" old_gplus=/usr/bin/g++ if [ -f $old_gplus ]; then mv $old_gplus $old_gplus"_old" cat < $old_gplus #!/bin/sh gcc_secure_exclude=\`rpm --eval 'podman.spec|gcc.spec|arm-trusted-firmware.spec|docker-engine-openeuler.spec|arts.spec|runc-openeuler.spec|kata-containers.spec|dyninst.spec|ipxe.spec|tboot.spec|syslinux.spec|gcc-libraries.spec|kpatch.spec|gdb.spec|xorg-x11-server.spec|xorg-x11-drv-fbdev.spec|xorg-x11-drv-vesa.spec|xorg-x11-drv-ati.spec|xorg-x11-drv-dummy.spec|xorg-x11-drv-intel.spec|xorg-x11-drv-nouveau.spec|xorg-x11-drv-qxl.spec|xorg-x11-drv-v4l.spec|xorg-x11-drv-vmware.spec|xorg-x11-drv-evdev.spec|xorg-x11-drv-synaptics.spec|xorg-x11-drv-vmmouse.spec|xorg-x11-drv-void.spec|xorg-x11-drv-wacom.spec|hivex.spec|gimp.spec|memstomp.spec|supermin.spec|system-config-firewall.spec|isdn4k-utils.spec|emacs.spec|graphviz.spec|buildah.spec|rhash.spec|automake.spec'\` if ! cat /.build.command | egrep "\$gcc_secure_exclude" &>/dev/null; then sec_opt='-fPIC -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fsigned-char' fs_opt='' if [[ "\$@" =~ "-O0" ]]; then #openjdk set O0 can not use FS sec_opt=\`echo \$sec_opt | sed 's/ -D_FORTIFY_SOURCE=2 -O2 / /'\` fi if [ -d '/home/abuild/rpmbuild/SOURCES' ]; then configfile=/home/abuild/rpmbuild/SOURCES/config_for_secure_g++ else configfile=/root/rpmbuild/SOURCES/config_for_secure_g++ fi if [ -f \$configfile ]; then rpm_name=\`cat \$configfile| grep rpm_name| awk -F: '{print \$NF}'\` sec_opt=\`cat \$configfile| grep sec_opt| awk -F: '{print \$NF}'\` fs_opt=\`cat \$configfile| grep fs_opt| awk -F: '{print \$NF}'\` fi if [[ x"\$@" = "x-v" ]];then #libtool use g++ -v for test compile env,if add Wl opt, it will make g++ -v fail $old_gplus"_old" "\$@" else /usr/bin/g++_old \$sec_opt "\$@" \$fs_opt --specs=/opt/gcc-specs-pie-cc1 --specs=/opt/gcc-specs-pie-ld --specs=/opt/gcc-specs-fs-cc1 fi else $old_gplus"_old" "\$@" fi END1 chmod 755 $old_gplus $old_gplus"_old" fi old_cpp=/usr/bin/c++ if [ -f $old_cpp ]; then mv $old_cpp $old_cpp"_old" cat < $old_cpp #!/bin/sh gcc_secure_exclude=\`rpm --eval 'podman.spec|gcc.spec|arm-trusted-firmware.spec|docker-engine-openeuler.spec|arts.spec|runc-openeuler.spec|kata-containers.spec|dyninst.spec|ipxe.spec|tboot.spec|syslinux.spec|gcc-libraries.spec|kpatch.spec|gdb.spec|xorg-x11-server.spec|xorg-x11-drv-fbdev.spec|xorg-x11-drv-vesa.spec|xorg-x11-drv-ati.spec|xorg-x11-drv-dummy.spec|xorg-x11-drv-intel.spec|xorg-x11-drv-nouveau.spec|xorg-x11-drv-qxl.spec|xorg-x11-drv-v4l.spec|xorg-x11-drv-vmware.spec|xorg-x11-drv-evdev.spec|xorg-x11-drv-synaptics.spec|xorg-x11-drv-vmmouse.spec|xorg-x11-drv-void.spec|xorg-x11-drv-wacom.spec|hivex.spec|gimp.spec|memstomp.spec|supermin.spec|system-config-firewall.spec|isdn4k-utils.spec|emacs.spec|graphviz.spec|buildah.spec|rhash.spec|automake.spec'\` if ! cat /.build.command | egrep "\$gcc_secure_exclude" &>/dev/null; then sec_opt='-fPIC -D_FORTIFY_SOURCE=2 -O2 -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fsigned-char' fs_opt='' if [[ "\$@" =~ "-O0" ]]; then #openjdk set O0 can not use FS sec_opt=\`echo \$sec_opt | sed 's/ -D_FORTIFY_SOURCE=2 -O2 / /'\` fi if [ -d '/home/abuild/rpmbuild/SOURCES' ]; then configfile=/home/abuild/rpmbuild/SOURCES/config_for_secure_c++ else configfile=/root/rpmbuild/SOURCES/config_for_secure_c++ fi if [ -f \$configfile ]; then rpm_name=\`cat \$configfile| grep rpm_name| awk -F: '{print \$NF}'\` sec_opt=\`cat \$configfile| grep sec_opt| awk -F: '{print \$NF}'\` fs_opt=\`cat \$configfile| grep fs_opt| awk -F: '{print \$NF}'\` fi /usr/bin/c++_old \$sec_opt "\$@" \$fs_opt --specs=/opt/gcc-specs-pie-cc1 --specs=/opt/gcc-specs-pie-ld --specs=/opt/gcc-specs-fs-cc1 else $old_cpp"_old" "\$@" fi END1 chmod 755 $old_cpp $old_cpp"_old" fi %preun %postun %files %defattr(-,root,root) %clean rm -rf $RPM_BUILD_ROOT/* rm -rf /var/tmp/gcc_secure-1.0 rm -rf $RPM_BUILD_DIR/gcc_secure-1.0 %changelog * Fri Nov 25 2022 Ge Wang - 1.0-0.13 - Type:enhancement - ID:NA - SUG:NA - DESC: add requires gcc-c++ * Thu Jul 28 2022 Chenyx - 1.0-0.12 - License compliance rectification * Thu Feb 17 2022 zoulin - 1.0-0.11 - Type:enhancement - ID:NA - SUG:NA - DESC: Add automake.spec to gcc_secure_exclude * Thu Feb 10 2022 zhangchenfeng - 1.0-0.10 - Type:enhancement - ID:NA - SUG:NA - DESC: clean spec * Wed Jul 21 2021 licihua - 1.0-0.9 - Type:enhancement - ID:NA - SUG:NA - DESC: support -fsigned-char for g++ * Mon Jul 12 2021 shenyangyang - 1.0-0.8 - Type:enhancement - ID:NA - SUG:NA - DESC:change file mode from 777 to 755 for secure * Thu Apr 8 2021 shenyangyang - 1.0-0.7 - Type:enhancement - ID:NA - SUG:NA - DESC: bump release rebuilding for adding rhash.spec to macro gcc_secure_exclude * Tue Feb 18 2020 yanzhihua - 1.0-0.6 - Type:enhancement - ID:NA - SUG:NA - DESC: add compile options for arm * Mon Jan 13 2020 openEuler Buildteam - 1.0-0.5 - package init * Mon Apr 01 2019 liuxueping - 1.0-0.4 - Type:enhancement - ID:NA - SUG:NA - DESC: no buildrequires rpms about tool * Tue Nov 27 2018 zhangchenfeng - 1.0-0.3 - Type:enhancement - ID:NA - SUG:NA - DESC:resolve numactl i686 fail * Tue Nov 27 2018 zhangchenfeng - 1.0-0.2 - Type:enhancement - ID:NA - SUG:NA - DESC:resolve numactl i686 fail * Sat Nov 10 2018 Wuyou - 1.0-0.1 - Type:enhancement - ID:NA - SUG:NA - DESC:add safe compile options ?YmSHg. $9 &-!G]-EǶ6Ҍn42&=7ىR{_Pyyiidcg:}rj_֕N)J}w槒%1={vEk"a\Q{BC& d bvIk>Dfu6wRԤWb^E+_L&qlBMƯ4[[7osUǞ;{u}jVMk~ݕ,b\nRd#=6)E@"` `p}κKSSlƊhϧO&4MބH/"fFpBA08*~v7sօJb-5 40q52±pB6`}{Ar fvkl 4asUH!ϟυ"tھ٘BP;H"vAo5B3ۂKpy׸)ez,vH8ёwnȂ^"içYnʞ[ imgUȺ ᯙwYokS ?D^Z*i2]hwbGN˓>*su?#2#y32"sXDBwQMHoF( "dyȹjٿhxv2-FZjxB Ex2 1+*cp;j'moKSTp}:9M8;_㻬pҺ:'3a 4a614|#Dvzw,#YjÀP$ z&P38 _Eln:kxzA4(?z=9kAfAwhvpF~/Z˪j6do٢\Cp_c_p4YfXܽX"Zʄ+?(p?!;XO4B>]':Kק]]/y\T)˂J#A~-Jkko$2*VyV2 +b^θu ٟ@z