gcc_secure-1.0-0.12.oe2303>  <@PT@7!.ܶujG7od!nopeneuler@compass-ci.com G7oյ ?T8ڜ&&@nG}AY֓#k#&30櫤r|!Ѱlu⣷kd7aDJA 4QL$(+O"M3P]p B9gA/abKş x!R%dFeNb?$(/ 2{z+:qzω)H6n+-ŶIղS/hqSW٘xZXEwB֑V,?vf=|n>[^ TR~m OÀsĨ$WIj3'[,d-b`L 0s=L߹s>C_Dr542ǘz1d998bcf4f61131a8bf0bb95b8d5e8038532e42bd23cd4d3c418d86a4a374b2cef753b5bfc0f61d122252090e1cc4f4a00cb4a103 n(?K-Ud>3)>?).d   Itx        $0@(89:FGHIRXY\]^defDHCgcc_secure1.00.12.oe2303Enforcing secure compile options for abuildEnforcing secure compile option for abuildd!edc-64g.compass-cihGPL-2.0-onlySystem/Managementlinuxaarch64hd!79411ca7e66d7287314074193e6bbfb4cb0ebc3a3db093721bc6ad6b3fe3a5d7c rootrootgcc_secure  coreutilsrpmlib(CompressedFileNames)rpmlib(FileDigests)util-linux3.0.4-14.6.0-14.18.0bz@b8b@` @`.`n@Chenyx - 1.0-0.12zoulin - 1.0-0.11zhangchenfeng - 1.0-0.10licihua - 1.0-0.9shenyangyang - 1.0-0.8shenyangyang - 1.0-0.7- 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 16798884851.0-0.12.oe2303gcc_secure.speccpiogzip9utf-8f5682a4692289c4be4c5d073c7dcbb2b75feb9dc35242b0b246856903a5afe0225b615bbc902525b4e2065a0d773a8d419b8ffced36ae7b1c8e48493f78cd78bName: gcc_secure Summary: Enforcing secure compile options for abuild License: GPL-2.0-only Group: System/Management Version: 1.0 Release: 0.12 BuildRoot: /var/tmp/gcc_secure-1.0 BuildRequires: util-linux coreutils Requires: util-linux rpm grep binutils gcc coreutils rpm-build %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 * 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{}v*,wR\*l).MEOO+=>7lW6 F~1 `W6: ҄u!61۝TkXtFLìkX `#LE6„?dކ>bi 0toYO$5>k@[,N—gͯ ]Ce;f= Ʒ;[cFB 9x|!1ָ~dꠜ|,G#^QdVx-Ahf[pE.# CY?LOxI=:0/vYϞOrQ$b, ؓv'[3ͣ򬰮Ywi;93dm dԟ!1PAի"-q&3eoϘݝعEѭCO).EHA4C6G%쌌u/i&V,QŻ}FD17}ae: B"S\g@ <~Ӗs#-q<[nwlmRXIDO4Eͮٝ#*xc=q EZ)O`C ::{Jɿ8Dj>_Ť;O;焻b`a OC֡jWpx?O`#/ SmKSPTH櫠`la>Sf*RdfvsP{Rq0ǬTSOx6+OpKA X9DvA4jNFa?"i;4a8I3NFˢj7D!Np fZl~a)&h`p{$EZևD9%'dM#,[ZtQdXSreP, *u(c>3=E~Ql %v2 b^u9Bzd