From 21978273b9c34fb78c581265319fd97e920d5335 Mon Sep 17 00:00:00 2001 From: wangchunyang Date: Mon, 2 Sep 2024 20:32:22 +0800 Subject: [PATCH] update lto patch --- 0001-Enable-LTO-By-Default.patch | 1120 +++++++++++++++--------------- openEuler-rpm-config.spec | 7 +- 2 files changed, 558 insertions(+), 569 deletions(-) diff --git a/0001-Enable-LTO-By-Default.patch b/0001-Enable-LTO-By-Default.patch index bac5897..78de572 100644 --- a/0001-Enable-LTO-By-Default.patch +++ b/0001-Enable-LTO-By-Default.patch @@ -1,24 +1,22 @@ -From 2a24fbc1bb28764c3577f3a9e108614cd2e108b2 Mon Sep 17 00:00:00 2001 +From ee991c59eeb06a1692ee9d7eddf1c46e1dd10f4d Mon Sep 17 00:00:00 2001 From: wangchunyang Date: Fri, 26 Jul 2024 12:54:56 +0800 Subject: [PATCH] Enable LTO By Default --- - brp-strip-lto | 17 ++ - lto_flag | 5 + - lto_white_list | 536 +++++++++++++++++++++++++++++++++++++++++++++++++ - macros | 6 +- - 4 files changed, 563 insertions(+), 1 deletion(-) + brp-strip-lto | 12 ++ + lto_white_list | 533 +++++++++++++++++++++++++++++++++++++++++++++++++ + macros | 15 +- + 3 files changed, 559 insertions(+), 1 deletion(-) create mode 100644 brp-strip-lto - create mode 100755 lto_flag create mode 100644 lto_white_list diff --git a/brp-strip-lto b/brp-strip-lto new file mode 100644 -index 0000000..3df672a +index 0000000..81a0231 --- /dev/null +++ b/brp-strip-lto -@@ -0,0 +1,17 @@ +@@ -0,0 +1,12 @@ +#!/usr/bin/sh +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then @@ -28,569 +26,550 @@ index 0000000..3df672a +STRIP=${1:-strip} +NCPUS=${RPM_BUILD_NCPUS:-1} + -+case `uname -a` in -+Darwin*) exit 0 ;; -+*) ;; -+esac -+ +# Strip ELF binaries +find "$RPM_BUILD_ROOT" -type f -name '*.[ao]' \! -regex "$RPM_BUILD_ROOT/*usr/lib/debug.*" -print0 | \ + eu-elfclassify --not-program --not-library --not-linux-kernel-module --stdin0 --print0 | xargs -0 -r -P$NCPUS -n32 sh -c "$STRIP -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 \"\$@\"" ARG0 -diff --git a/lto_flag b/lto_flag -new file mode 100755 -index 0000000..53e3adb ---- /dev/null -+++ b/lto_flag -@@ -0,0 +1,5 @@ -+#!/bin/sh -+current_spec=`cat /.build.command` -+if grep -Fxq "$current_spec" "/lib/rpm/openEuler/lto_white_list"; then -+ echo "-flto -ffat-lto-objects" -+fi diff --git a/lto_white_list b/lto_white_list new file mode 100644 -index 0000000..780be19 +index 0000000..bc637db --- /dev/null +++ b/lto_white_list -@@ -0,0 +1,536 @@ -+adcli.spec -+aide.spec -+amanda.spec -+annobin.spec -+apr.spec -+argon2.spec -+at.spec -+atf.spec -+attr.spec -+audit.spec -+augeas.spec -+authselect.spec -+autogen.spec -+avahi.spec -+babeltrace.spec -+bind.spec -+bison.spec -+bolt.spec -+booth.spec -+brotli.spec -+byacc.spec -+bzip2.spec -+cairomm.spec -+certmonger.spec -+cfitsio.spec -+CharLS.spec -+check.spec -+chkconfig.spec -+chrony.spec -+chrpath.spec -+ck.spec -+clamav.spec -+clevis.spec -+clucene.spec -+cmake.spec -+cockpit.spec -+courier-unicode.spec -+cppcheck.spec -+cpp-httplib.spec -+cracklib.spec -+createrepo_c.spec -+cronie.spec -+cryptsetup.spec -+cups.spec -+cups-filters.spec -+curl.spec -+dav1d.spec -+dbus-broker.spec -+dbus-glib.spec -+dbxtool.spec -+dhcp.spec -+dialog.spec -+ding-libs.spec -+discount.spec -+dos2unix.spec -+dosfstools.spec -+double-conversion.spec -+dovecot.spec -+doxygen.spec -+dropwatch.spec -+drpm.spec -+d-spy.spec -+dwz.spec -+e2fsprogs.spec -+enca.spec -+entr.spec -+environment-modules.spec -+erlang-sd_notify.spec -+espeak-ng.spec -+ethtool.spec -+exempi.spec -+exiv2.spec -+expat.spec -+findutils.spec -+flac.spec -+flatbuffers.spec -+flex.spec -+fmt.spec -+fping.spec -+freetype.spec -+freexl.spec -+fribidi.spec -+gawk.spec -+gc.spec -+gdb.spec -+gdbm.spec -+gdisk.spec -+GeoIP.spec -+geos.spec -+gettext.spec -+ghostscript.spec -+git.spec -+gjs.spec -+glade.spec -+glib-networking.spec -+glm.spec -+glslang.spec -+glusterfs.spec -+gmp.spec -+gnome-autoar.spec -+gnupg2.spec -+gobject-introspection.spec -+gperftools.spec -+GraphicsMagick.spec -+graphite2.spec -+graphviz.spec -+greatsql.spec -+grep.spec -+groff.spec -+grubby.spec -+gsl.spec -+gsm.spec -+gtest.spec -+gzip.spec -+harfbuzz.spec -+hdf.spec -+hdf5.spec -+httpd.spec -+http-parser.spec -+hwloc.spec -+ibus-libpinyin.spec -+icu.spec -+ilmbase.spec -+Imath.spec -+iniparser.spec -+ipcalc.spec -+iproute.spec -+iptables.spec -+isomd5sum.spec -+jansson.spec -+jbig2dec.spec -+jbigkit.spec -+jemalloc.spec -+jimtcl.spec -+jose.spec -+jq.spec -+json-c.spec -+jsoncpp.spec -+Judy.spec -+kbd.spec -+krb5.spec -+kyua.spec -+lame.spec -+lcms2.spec -+libabigail.spec -+libadwaita.spec -+libaec.spec -+libarchive.spec -+libart_lgpl.spec -+libass.spec -+libatomic_ops.spec -+libb2.spec -+libbsd.spec -+libcap.spec -+libcap-ng.spec -+libcdio.spec -+libcdio-paranoia.spec -+libcomps.spec -+libconfuse.spec -+libcue.spec -+libdatrie.spec -+libdbi.spec -+libdnf.spec -+libdrm.spec -+libdwarf.spec -+libEMF.spec -+libev.spec -+libevent.spec -+libffado.spec -+libfprint.spec -+libgexiv2.spec -+libgit2.spec -+libglvnd.spec -+libgta.spec -+libhandy.spec -+libidn.spec -+libidn2.spec -+libiscsi.spec -+libisoburn.spec -+libjpeg-turbo.spec -+libkcapi.spec -+libkeepalive.spec -+libldb.spec -+liblouis.spec -+libmaxminddb.spec -+libmbim.spec -+libmd.spec -+libmemcached.spec -+libmetalink.spec -+libmodplug.spec -+libmodulemd.spec -+libnftnl.spec -+libnma.spec -+libnvme.spec -+libogg.spec -+libopenraw.spec -+libpinyin.spec -+libpipeline.spec -+libplist.spec -+libpwquality.spec -+libqb.spec -+libquvi.spec -+librabbitmq.spec -+libraqm.spec -+librdkafka.spec -+librepo.spec -+libreswan.spec -+librevenge.spec -+libsamplerate.spec -+libseccomp.spec -+libsemanage.spec -+libserf.spec -+libsexy.spec -+libshumate.spec -+libsndfile.spec -+libsodium.spec -+libsolv.spec -+libspectre.spec -+libspiro.spec -+libssh.spec -+libssh2.spec -+libtalloc.spec -+libtasn1.spec -+libtdb.spec -+libtevent.spec -+libtiff.spec -+libunwind.spec -+libusb.spec -+libusbmuxd.spec -+libuser.spec -+libutempter.spec -+libuv.spec -+libvirt.spec -+libvirt-python.spec -+libvorbis.spec -+libwacom.spec -+libwbxml.spec -+libx86emu.spec -+libyaml.spec -+libyubikey.spec -+libzip.spec -+lilv.spec -+lldb.spec -+lmdb.spec -+logrotate.spec -+lshw.spec -+lsof.spec -+lua-expat.spec -+lua-filesystem.spec -+lua-lpeg.spec -+luksmeta.spec -+lzip.spec -+lzo.spec -+m2crypto.spec -+m4.spec -+malcontent.spec -+man-db.spec -+mcpp.spec -+mdadm.spec -+mecab.spec -+metis.spec -+mksh.spec -+mod_auth_openidc.spec -+mod_http2.spec -+mokutil.spec -+mongo-c-driver.spec -+mozjs102.spec -+mpfr.spec -+mpich.spec -+mysql.spec -+nasm.spec -+netcf.spec -+nethogs.spec -+netpbm.spec -+net-snmp.spec -+newt.spec -+nfs-utils.spec -+nftables.spec -+nghttp2.spec -+ninja-build.spec -+nodejs.spec -+npth.spec -+nspr.spec -+nss_wrapper.spec -+nss-mdns.spec -+nss-pam-ldapd.spec -+nss-pem.spec -+ntp.spec -+numpy.spec -+ocl-icd.spec -+oddjob.spec -+oniguruma.spec -+opencc.spec -+OpenEXR.spec -+openhpi.spec -+open-isns.spec -+openmpi.spec -+openscap.spec -+opensp.spec -+openssh.spec -+openvpn.spec -+openvswitch.spec -+p11-kit.spec -+pacemaker.spec -+pam_krb5.spec -+pam_wrapper.spec -+pango.spec -+passwd.spec -+patchelf.spec -+patchutils.spec -+pavucontrol.spec -+pcre2.spec -+perl-autovivification.spec -+perl-B-COW.spec -+perl-BSD-Resource.spec -+perl-Class-XSAccessor.spec -+perl-Clone.spec -+perl-Compress-Bzip2.spec -+perl-Compress-Raw-Bzip2.spec -+perl-Compress-Raw-Zlib.spec -+perl-Crypt-DES.spec -+perl-Crypt-IDEA.spec -+perl-Curses.spec -+perl-Data-Dumper.spec -+perl-Data-UUID.spec -+perl-DateTime.spec -+perl-DB_File.spec -+perl-DBD-MariaDB.spec -+perl-DBD-MySQL.spec -+perl-DBD-Pg.spec -+perl-DBD-SQLite.spec -+perl-Devel-CallChecker.spec -+perl-Devel-Caller.spec -+perl-Devel-LexAlias.spec -+perl-Digest-MD5.spec -+perl-Digest-SHA.spec -+perl-Digest-SHA1.spec -+perl-Digest-SHA3.spec -+perl-Encode-EUCJPASCII.spec -+perl-Encode-JIS2K.spec -+perl-FCGI.spec -+perl-Filter.spec -+perl-GD.spec -+perl-Glib.spec -+perl-GSSAPI.spec -+perl-HTML-Parser.spec -+perl-IO-Tty.spec -+perl-IPC-SysV.spec -+perl-libintl-perl.spec -+perl-List-MoreUtils-XS.spec -+perl-Math-BigInt-FastCalc.spec -+perl-MIME-Base64.spec -+perl-NetAddr-IP.spec -+perl-Package-Stash-XS.spec -+perl-PerlIO-utf8_strict.spec -+perl-PkgConfig-LibPkgConf.spec -+perl-Scalar-List-Utils.spec -+perl-Socket.spec -+perl-Socket6.spec -+perl-Storable.spec -+perl-Sub-Identify.spec -+perl-Sub-Name.spec -+perl-Syntax-Keyword-Try.spec -+perl-Sys-CPU.spec -+perl-Sys-MemInfo.spec -+perl-Sys-Syslog.spec -+perl-TermReadKey.spec -+perl-Test-LeakTrace.spec -+perl-Text-Soundex.spec -+perl-threads-shared.spec -+perl-Time-HiRes.spec -+perl-Unicode-Collate.spec -+perl-Unicode-LineBreak.spec -+perl-Unicode-Normalize.spec -+perl-XML-LibXSLT.spec -+perl-YAML-LibYAML.spec -+phonon.spec -+pigz.spec -+pipewire.spec -+pkgconf.spec -+pngquant.spec -+poco.spec -+polkit-pkla-compat.spec -+poppler.spec -+popt.spec -+postgresql.spec -+postgresql-odbc.spec -+procenv.spec -+proj.spec -+protobuf2.spec -+protobuf-c.spec -+pulseaudio.spec -+pycairo.spec -+pyparted.spec -+PyQt4.spec -+python3.spec -+python-argon2-cffi-bindings.spec -+python-bcrypt.spec -+python-cffi.spec -+python-cheetah.spec -+python-ethtool.spec -+python-greenlet.spec -+python-kiwisolver.spec -+python-lazy-object-proxy.spec -+python-markupsafe.spec -+python-netifaces.spec -+python-pillow.spec -+python-psycopg2.spec -+python-pycryptodomex.spec -+python-pycurl.spec -+python-pymongo.spec -+python-pynacl.spec -+python-pyrsistent.spec -+python-simplejson.spec -+python-systemd.spec -+python-urwid.spec -+python-zope-interface.spec -+python-zstandard.spec -+pyxattr.spec -+qpid-proton.spec -+qrencode.spec -+qscintilla.spec -+qt6-qttools.spec -+quota.spec -+raptor2.spec -+rcs.spec -+realmd.spec -+recode.spec -+rhash.spec -+rpm.spec -+rrdtool.spec -+rsync.spec -+rsyslog.spec -+ruby.spec -+ruby-augeas.spec -+rubygem-bcrypt.spec -+rubygem-bindex.spec -+rubygem-bootsnap.spec -+rubygem-ffi.spec -+rubygem-hiredis.spec -+rubygem-idn.spec -+rubygem-msgpack.spec -+rubygem-nio4r.spec -+rubygem-nokogiri.spec -+rubygem-pg.spec -+rubygem-racc.spec -+rubygem-rdiscount.spec -+rubygem-redcarpet.spec -+rubygem-RedCloth.spec -+rubygem-regexp_property_values.spec -+rubygem-ruby-shadow.spec -+rubygem-sqlite3.spec -+rubygem-thin.spec -+rubygem-unf_ext.spec -+rubygem-websocket-driver.spec -+rust.spec -+satyr.spec -+sbc.spec -+sendmail.spec -+setools.spec -+sg3_utils.spec -+slang.spec -+snappy.spec -+socat.spec -+socket_wrapper.spec -+softhsm.spec -+sox.spec -+soxr.spec -+squid.spec -+sratom.spec -+srt.spec -+sscg.spec -+strace.spec -+subunit.spec -+swtpm.spec -+symlinks.spec -+sysbench.spec -+sysfsutils.spec -+sysprof.spec -+sysstat.spec -+systemd.spec -+taglib.spec -+tang.spec -+tar.spec -+tcl.spec -+tclx.spec -+tcp_wrappers.spec -+tcsh.spec -+teckit.spec -+telepathy-glib.spec -+tigervnc.spec -+time.spec -+timedatex.spec -+tipcutils.spec -+tokyocabinet.spec -+tpm2-tools.spec -+ttembed.spec -+ub-dhcp.spec -+uchardet.spec -+uid_wrapper.spec -+unbound.spec -+units.spec -+unrtf.spec -+unzip.spec -+uriparser.spec -+usbguard.spec -+userspace-rcu.spec -+ustr.spec -+utf8proc.spec -+util-linux.spec -+uuid.spec -+varnish.spec -+vid.stab.spec -+vino.spec -+virt-what.spec -+volume_key.spec -+wget.spec -+wxGTK3.spec -+xcb-util.spec -+xcb-util-image.spec -+xcb-util-keysyms.spec -+xcb-util-wm.spec -+xcb-util-xrm.spec -+xdelta.spec -+xmlstarlet.spec -+xmlto.spec -+xorg-x11-server.spec -+xorg-x11-xauth.spec -+xxhash.spec -+yajl.spec -+yelp.spec -+ykpers.spec -+zenity.spec -+zeromq.spec -+zstd.spec +@@ -0,0 +1,533 @@ ++adcli ++aide ++amanda ++annobin ++apr ++argon2 ++at ++atf ++attr ++audit ++augeas ++authselect ++autogen ++avahi ++babeltrace ++bind ++bison ++bolt ++booth ++brotli ++byacc ++bzip2 ++cairomm ++certmonger ++cfitsio ++CharLS ++check ++chkconfig ++chrony ++chrpath ++ck ++clamav ++clevis ++clucene ++cmake ++cockpit ++courier-unicode ++cppcheck ++cpp-httplib ++cracklib ++createrepo_c ++cronie ++cryptsetup ++cups ++cups-filters ++curl ++dav1d ++dbus-broker ++dbus-glib ++dbxtool ++dhcp ++dialog ++ding-libs ++discount ++dos2unix ++dosfstools ++double-conversion ++dovecot ++doxygen ++dropwatch ++drpm ++d-spy ++dwz ++e2fsprogs ++enca ++entr ++environment-modules ++erlang-sd_notify ++espeak-ng ++ethtool ++exempi ++exiv2 ++expat ++findutils ++flac ++flatbuffers ++flex ++fmt ++fping ++freetype ++freexl ++fribidi ++gawk ++gc ++gdb ++gdbm ++gdisk ++GeoIP ++geos ++gettext ++ghostscript ++git ++gjs ++glade ++glib-networking ++glm ++glslang ++glusterfs ++gmp ++gnome-autoar ++gnupg2 ++gobject-introspection ++gperftools ++GraphicsMagick ++graphite2 ++graphviz ++greatsql ++grep ++groff ++grubby ++gsl ++gsm ++gtest ++gzip ++harfbuzz ++hdf ++hdf5 ++httpd ++http-parser ++hwloc ++ibus-libpinyin ++icu ++ilmbase ++Imath ++iniparser ++ipcalc ++iproute ++iptables ++isomd5sum ++jansson ++jbig2dec ++jbigkit ++jemalloc ++jimtcl ++jose ++jq ++json-c ++jsoncpp ++Judy ++kbd ++kyua ++lame ++lcms2 ++libabigail ++libadwaita ++libaec ++libarchive ++libart_lgpl ++libass ++libatomic_ops ++libb2 ++libbsd ++libcap ++libcap-ng ++libcdio ++libcdio-paranoia ++libcomps ++libconfuse ++libcue ++libdatrie ++libdbi ++libdnf ++libdrm ++libdwarf ++libEMF ++libev ++libevent ++libffado ++libfprint ++libgexiv2 ++libgit2 ++libglvnd ++libgta ++libhandy ++libidn ++libidn2 ++libiscsi ++libisoburn ++libjpeg-turbo ++libkcapi ++libkeepalive ++libldb ++libmaxminddb ++libmbim ++libmd ++libmemcached ++libmetalink ++libmodplug ++libmodulemd ++libnftnl ++libnma ++libnvme ++libogg ++libopenraw ++libpinyin ++libpipeline ++libplist ++libpwquality ++libqb ++libquvi ++librabbitmq ++libraqm ++librepo ++libreswan ++librevenge ++libsamplerate ++libseccomp ++libsemanage ++libserf ++libsexy ++libshumate ++libsndfile ++libsodium ++libsolv ++libspectre ++libspiro ++libssh ++libssh2 ++libtalloc ++libtasn1 ++libtdb ++libtevent ++libtiff ++libunwind ++libusb ++libusbmuxd ++libuser ++libutempter ++libuv ++libvirt ++libvirt-python ++libvorbis ++libwacom ++libwbxml ++libx86emu ++libyaml ++libyubikey ++libzip ++lilv ++lldb ++lmdb ++logrotate ++lshw ++lsof ++lua-expat ++lua-filesystem ++lua-lpeg ++luksmeta ++lzip ++lzo ++m2crypto ++m4 ++malcontent ++man-db ++mcpp ++mdadm ++mecab ++metis ++mksh ++mod_auth_openidc ++mod_http2 ++mokutil ++mongo-c-driver ++mozjs102 ++mpfr ++mpich ++mysql ++nasm ++netcf ++nethogs ++netpbm ++net-snmp ++newt ++nfs-utils ++nftables ++nghttp2 ++ninja-build ++nodejs ++npth ++nspr ++nss_wrapper ++nss-mdns ++nss-pam-ldapd ++nss-pem ++ntp ++numpy ++ocl-icd ++oddjob ++oniguruma ++opencc ++OpenEXR ++openhpi ++open-isns ++openmpi ++openscap ++opensp ++openssh ++openvpn ++openvswitch ++p11-kit ++pacemaker ++pam_krb5 ++pam_wrapper ++pango ++passwd ++patchelf ++patchutils ++pavucontrol ++pcre2 ++perl-autovivification ++perl-B-COW ++perl-BSD-Resource ++perl-Class-XSAccessor ++perl-Clone ++perl-Compress-Bzip2 ++perl-Compress-Raw-Bzip2 ++perl-Compress-Raw-Zlib ++perl-Crypt-DES ++perl-Crypt-IDEA ++perl-Curses ++perl-Data-Dumper ++perl-Data-UUID ++perl-DateTime ++perl-DB_File ++perl-DBD-MariaDB ++perl-DBD-MySQL ++perl-DBD-Pg ++perl-DBD-SQLite ++perl-Devel-CallChecker ++perl-Devel-Caller ++perl-Devel-LexAlias ++perl-Digest-MD5 ++perl-Digest-SHA ++perl-Digest-SHA1 ++perl-Digest-SHA3 ++perl-Encode-EUCJPASCII ++perl-Encode-JIS2K ++perl-FCGI ++perl-Filter ++perl-GD ++perl-Glib ++perl-GSSAPI ++perl-HTML-Parser ++perl-IO-Tty ++perl-IPC-SysV ++perl-libintl-perl ++perl-List-MoreUtils-XS ++perl-Math-BigInt-FastCalc ++perl-MIME-Base64 ++perl-NetAddr-IP ++perl-Package-Stash-XS ++perl-PerlIO-utf8_strict ++perl-PkgConfig-LibPkgConf ++perl-Scalar-List-Utils ++perl-Socket ++perl-Socket6 ++perl-Storable ++perl-Sub-Identify ++perl-Sub-Name ++perl-Syntax-Keyword-Try ++perl-Sys-CPU ++perl-Sys-MemInfo ++perl-Sys-Syslog ++perl-TermReadKey ++perl-Test-LeakTrace ++perl-Text-Soundex ++perl-threads-shared ++perl-Time-HiRes ++perl-Unicode-Collate ++perl-Unicode-LineBreak ++perl-Unicode-Normalize ++perl-XML-LibXSLT ++perl-YAML-LibYAML ++phonon ++pigz ++pipewire ++pkgconf ++pngquant ++poco ++polkit-pkla-compat ++poppler ++popt ++postgresql ++postgresql-odbc ++procenv ++proj ++protobuf2 ++protobuf-c ++pulseaudio ++pycairo ++pyparted ++PyQt4 ++python3 ++python-argon2-cffi-bindings ++python-bcrypt ++python-cffi ++python-cheetah ++python-ethtool ++python-greenlet ++python-kiwisolver ++python-lazy-object-proxy ++python-markupsafe ++python-netifaces ++python-pillow ++python-psycopg2 ++python-pycryptodomex ++python-pycurl ++python-pymongo ++python-pynacl ++python-pyrsistent ++python-simplejson ++python-systemd ++python-urwid ++python-zope-interface ++python-zstandard ++pyxattr ++qpid-proton ++qrencode ++qscintilla ++qt6-qttools ++quota ++raptor2 ++rcs ++realmd ++recode ++rhash ++rpm ++rrdtool ++rsync ++rsyslog ++ruby ++ruby-augeas ++rubygem-bcrypt ++rubygem-bindex ++rubygem-bootsnap ++rubygem-ffi ++rubygem-hiredis ++rubygem-idn ++rubygem-msgpack ++rubygem-nio4r ++rubygem-nokogiri ++rubygem-pg ++rubygem-racc ++rubygem-rdiscount ++rubygem-redcarpet ++rubygem-RedCloth ++rubygem-regexp_property_values ++rubygem-ruby-shadow ++rubygem-sqlite3 ++rubygem-thin ++rubygem-unf_ext ++rubygem-websocket-driver ++rust ++satyr ++sbc ++sendmail ++setools ++sg3_utils ++slang ++snappy ++socat ++socket_wrapper ++softhsm ++sox ++soxr ++squid ++sratom ++srt ++sscg ++strace ++subunit ++swtpm ++symlinks ++sysbench ++sysfsutils ++sysprof ++sysstat ++systemd ++taglib ++tang ++tar ++tcl ++tclx ++tcp_wrappers ++tcsh ++teckit ++telepathy-glib ++tigervnc ++time ++timedatex ++tipcutils ++tokyocabinet ++tpm2-tools ++ttembed ++ub-dhcp ++uchardet ++uid_wrapper ++unbound ++units ++unrtf ++unzip ++uriparser ++usbguard ++userspace-rcu ++ustr ++utf8proc ++util-linux ++uuid ++varnish ++vid.stab ++vino ++virt-what ++volume_key ++wget ++wxGTK3 ++xcb-util ++xcb-util-image ++xcb-util-keysyms ++xcb-util-wm ++xcb-util-xrm ++xdelta ++xmlstarlet ++xmlto ++xorg-x11-server ++xorg-x11-xauth ++xxhash ++yajl ++yelp ++ykpers ++zenity ++zeromq ++zstd + diff --git a/macros b/macros -index 3cd2655..b3fcdb5 100644 +index 3cd2655..637a075 100644 --- a/macros +++ b/macros @@ -173,6 +173,7 @@ @@ -609,13 +588,22 @@ index 3cd2655..b3fcdb5 100644 %{?__brp_strip_static_archive} \ %{?py_auto_byte_compile:%{?__brp_python_bytecompile}} \ %{?__brp_python_hardlink} \ -@@ -261,7 +263,9 @@ +@@ -261,7 +263,18 @@ %_ld_as_needed 1 %_ld_as_needed_flags %{?_ld_as_needed:-Wl,--as-needed} -%_general_options -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong %[ "%{toolchain}" == "clang" ? "-fgcc-compatible" : "" ] -+%_get_lto_cflags %(/lib/rpm/openEuler/lto_flag) -+%_lto_cflags %{_get_lto_cflags} ++# only enable lto on whitelisted packages ++%_lto_cflags %{lua:\ ++ for line in io.lines(rpm.expand("/usr/lib/rpm/%{_vendor}/lto_white_list"))\ ++ do\ ++ if string.match(line, "^"..rpm.expand("%{name}").."$") then\ ++ print("-flto=auto -ffat-lto-objects")\ ++ break\ ++ end\ ++ end\ ++} ++ +%_general_options -O2 %{_lto_cflags} -g -grecord-gcc-switches -pipe -fstack-protector-strong %[ "%{toolchain}" == "clang" ? "-fgcc-compatible" : "" ] %_warning_options -Wall -Werror=format-security %_preprocessor_defines -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 938d5eb..3170f4b 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 30 -Release: 59 +Release: 60 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -115,7 +115,6 @@ Macros and scripts for building kernel module packages. %install mkdir -p %{buildroot}%{rpmvdir} install -p -m 644 -t %{buildroot}%{rpmvdir} macros rpmrc lto_white_list -install -p -m 755 -t %{buildroot}%{rpmvdir} lto_flag install -p -m 755 -t %{buildroot}%{rpmvdir} config.* install -p -m 755 -t %{buildroot}%{_rpmconfigdir} brp-* install -p -m 644 -t %{buildroot}%{_rpmconfigdir} generic-* @@ -137,7 +136,6 @@ sed -i "s/__vendor/%{vendor}/g" `grep "__vendor" -rl %{buildroot}%{_rpmconfigdir %dir %{rpmvdir} %{rpmvdir}/macros %{rpmvdir}/rpmrc -%{rpmvdir}/lto_flag %{rpmvdir}/lto_white_list %{_rpmconfigdir}/brp-* %{rpmvdir}/config.* @@ -155,6 +153,9 @@ sed -i "s/__vendor/%{vendor}/g" `grep "__vendor" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Tue Sep 3 2024 wangchunyang - 30-60 +- update patch for enable LTO + * Wed Aug 21 2024 wangchunyang - 30-59 - Enable LTO By Default -- Gitee