Bug 133651 - /lib/libiw.so is compiled without RPM_OPT_FLAGS
/lib/libiw.so is compiled without RPM_OPT_FLAGS
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: wireless-tools (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brian Stein
:
Depends On:
Blocks: FC3BugWeekTracker
  Show dependency treegraph
 
Reported: 2004-09-25 14:01 EDT by Brian Stein
Modified: 2013-03-01 00:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-29 18:55:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Arjan van de Ven 2004-09-25 14:01:28 EDT
/lib/libiw.so is using -mtune=i386 as opposed to the i686 tuning options
Comment 1 Michael Schwendt 2004-09-27 14:58:57 EDT
Would this be considered bad form at Red Hat?

--- wireless-tools.spec.orig    2004-08-31 07:20:03.000000000 +0200
+++ wireless-tools.spec 2004-09-27 21:01:31.577324656 +0200
@@ -22,6 +22,8 @@
 %prep
 %setup -n wireless_tools.%{version}
 %patch1 -p1 -b .makefile
+sed -i 's/^\(CFLAGS.*\)-Os\(.*\)/\1\$(RPM_OPT_FLAGS) \2/' Makefile
+
 
 %build
 make clean
Comment 2 Rik van Riel 2004-09-27 15:11:02 EDT
Alternatively, patch the makefile so we can pass RPM_OPT_FLAGS on the
make command line ;)

--- wireless_tools.27/Makefile.makefile 2004-06-15 14:40:12.000000000
-0400
+++ wireless_tools.27/Makefile  2004-09-27 15:12:49.000000000 -0400
@@ -77,12 +77,15 @@
   LIBS= -lm
 endif
  
+ifndef RPM_OPT_FLAGS
+  RPM_OPT_FLAGS=
+endif
 # Other flags
 CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
        -Wpointer-arith -Wcast-qual -Winline -I.
 #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
 DEPFLAGS=-MMD
-XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG)
+XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG)
$(RPM_OPT_FLAGS) PICFLAG=-fPIC
  
 # Standard compilation targets
Comment 3 Rik van Riel 2004-09-27 15:29:48 EDT
OK, something like this seems to work. Just test compiled it.
Comment 4 Michael Schwendt 2004-09-27 15:41:13 EDT
The "sed" approach achieves a similar thing:

--- Makefile.orig       2004-09-27 21:41:23.863641856 +0200
+++ Makefile    2004-09-27 21:41:27.624070184 +0200
@@ -78,7 +78,7 @@
 endif
 
 # Other flags
-CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
+CFLAGS=$(RPM_OPT_FLAGS)  -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow \
        -Wpointer-arith -Wcast-qual -Winline -I.
 #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
 DEPFLAGS=-MMD


So, you can pass RPM_OPT_FLAGS on the command-line, too (rpmbuild
exports it already).

If you patch the Makefile, you probably want to apply this (OPT_FLAGS
is not used anywhere in the tarball):

--- wireless-tools.spec.orig    2004-08-31 07:20:03.000000000 +0200
+++ wireless-tools.spec 2004-09-27 21:43:23.557445632 +0200
@@ -25,7 +25,7 @@
 
 %build
 make clean
-make OPT_FLAGS="$RPM_OPT_FLAGS" BUILD_SHARED=1 FORCE_WEXT_VERSION=16
+make BUILD_SHARED=1 FORCE_WEXT_VERSION=16
 
 %install
 rm -rf $RPM_BUILD_ROOT
Comment 5 Rik van Riel 2004-09-27 15:48:46 EDT
It does, but it doesn't look quite as future-proof.  I could imagine
the upstream maintainers adding something in front of the -Os one day,
causing the sed to remove an option it shouldn't remove...

I've applied the patch from comment #2, except using OPT_FLAGS instead
of RPM_OPT_FLAGS.  This way the Makefile does use the OPT_FLAGS
argument passed to it and things get compiled right.

Thanks for helping fix this. wireless-tools-0.27-pre25-2 should be
correct.
Comment 6 Michael Schwendt 2004-09-27 15:55:39 EDT
Okay. The sed expression does not remove anything else than -Os,
however. \1 and \2 put back the parts around -Os.
Comment 7 Matthew Miller 2006-07-10 16:52:40 EDT
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!
Comment 8 Christopher Aillon 2006-08-29 18:55:49 EDT
This looks fixed anyway.

Note You need to log in before you can comment on or make changes to this bug.