Skip to content

Commit 0c468ca

Browse files
committed
Remove RPM_OPT_FLAGS from source rpm
It seems that we somehow are getting the -flto flag added to the RPM through the system-level rpm option flags. Since those are totally optional, let's opt to simply not use them. Signed-off-by: Ralph Castain <[email protected]>
1 parent 43dce07 commit 0c468ca

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

Diff for: contrib/dist/linux/prrte.spec

+4-38
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Copyright (c) 2015 Research Organization for Information Science
1616
# and Technology (RIST). All rights reserved.
1717
# Copyright (c) 2017-2022 Intel, Inc. All rights reserved.
18-
# Copyright (c) 2022 Nanook Consulting. All rights reserved.
18+
# Copyright (c) 2022-2025 Nanook Consulting All rights reserved.
1919
# $COPYRIGHT$
2020
#
2121
# Additional copyrights may follow
@@ -107,18 +107,6 @@
107107
# type: bool (0/1)
108108
%{!?use_check_files: %define use_check_files 1}
109109

110-
# By default, RPM supplies a bunch of optimization flags, some of
111-
# which may not work with non-gcc compilers. We attempt to weed some
112-
# of these out (below), but sometimes it's better to just ignore them
113-
# altogether (e.g., PGI 6.2 will warn about unknown compiler flags,
114-
# but PGI 7.0 will error -- and RPM_OPT_FLAGS contains a lot of flags
115-
# that PGI 7.0 does not understand). The default is to use the flags,
116-
# but you can set this variable to 0, indicating that RPM_OPT_FLAGS
117-
# should be erased (in which case you probabl want to supply your own
118-
# optimization flags!).
119-
# type: bool (0/1)
120-
%{!?use_default_rpm_opt_flags: %define use_default_rpm_opt_flags 1}
121-
122110
# Some compilers can be installed via tarball or RPM (e.g., Intel,
123111
# PGI). If they're installed via RPM, then rpmbuild's auto-dependency
124112
# generation stuff will work fine. But if they're installed via
@@ -178,9 +166,7 @@
178166

179167
%{!?configure_options: %define configure_options %{nil}}
180168

181-
%if !%{use_default_rpm_opt_flags}
182169
%define optflags ""
183-
%endif
184170

185171
#############################################################################
186172
#
@@ -365,31 +351,11 @@ fi
365351
using_gcc=0
366352
%endif
367353

368-
# If we're not using the default RPM_OPT_FLAGS, then wipe them clean
354+
# We're not using the default RPM_OPT_FLAGS, so wipe them clean
369355
# (the "optflags" macro has already been wiped clean, above).
370356

371-
%if !%{use_default_rpm_opt_flags}
372357
RPM_OPT_FLAGS=
373358
export RPM_OPT_FLAGS
374-
%endif
375-
376-
# If we're not GCC, strip out any GCC-specific arguments in the
377-
# RPM_OPT_FLAGS before potentially propagating them everywhere.
378-
379-
if test "$using_gcc" = 0; then
380-
381-
# Non-gcc compilers cannot handle FORTIFY_SOURCE (at least, not as
382-
# of Oct 2006)
383-
RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e 's@-D_FORTIFY_SOURCE[=0-9]*@@'`"
384-
385-
# Non-gcc compilers will generate warnings for several flags
386-
# placed in RPM_OPT_FLAGS by RHEL5, but -mtune=generic will cause
387-
# an error for icc 9.1.
388-
RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e 's@-mtune=generic@@'`"
389-
fi
390-
391-
CFLAGS="%{?cflags:%{cflags}}%{!?cflags:$RPM_OPT_FLAGS}"
392-
export CFLAGS
393359

394360
%configure %{configure_options}
395361
%{__make} %{?mflags}
@@ -678,9 +644,9 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
678644
of "prrte" with "prte"
679645

680646
* Thu Apr 7 2022 Adam Goldman <[email protected]>
681-
- Several minor fixes: added _includedir to build_all_in_one_rpm,
647+
- Several minor fixes: added _includedir to build_all_in_one_rpm,
682648
escape macro in comment, and use %{name} instead of hard-coded value
683-
649+
684650
* Tue Mar 28 2017 Jeff Squyres <[email protected]>
685651
- Reverting a decision from a prior changelog entry: if
686652
install_in_opt==1, then even put the modulefile under /opt.

0 commit comments

Comments
 (0)