Bug 437331 - OpenJDK doesn't honour optflags
OpenJDK doesn't honour optflags
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk (Show other bugs)
All Linux
high Severity high
: ---
: ---
Assigned To: Thomas Fitzsimmons
Fedora Extras Quality Assurance
: Reopened, Security
Depends On:
  Show dependency treegraph
Reported: 2008-03-13 12:08 EDT by Lubomir Kundrak
Modified: 2008-03-20 14:34 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-20 14:34:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Build output with flags set (131.10 KB, text/plain)
2008-03-13 14:19 EDT, Lillian Angel
no flags Details
Output with stderr redirected. (137.56 KB, text/plain)
2008-03-13 14:22 EDT, Lillian Angel
no flags Details

  None (edit)
Description Lubomir Kundrak 2008-03-13 12:08:58 EDT
Description of problem:

According to the packaging guidelines, all packages must pass predefined
%{_optflags} to C and C++ compiler. Not doing so has various security,
performance and compatibility implications.

OpenJDK ignores those.

Version-Release number of selected component (if applicable):

Comment 1 Thomas Fitzsimmons 2008-03-13 12:22:19 EDT
Gary, do you foresee zero having any problems with these flags?

-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
Comment 2 Lillian Angel 2008-03-13 14:09:13 EDT
I am not successful in building java-1.6.0-openjdk with those CFLAGS and
Comment 3 Lillian Angel 2008-03-13 14:19:24 EDT
Created attachment 297963 [details]
Build output with flags set

Built like so:
./configure --with-openjdk && make CFLAGS="-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables" CPPFLAGS="-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
Comment 4 Lillian Angel 2008-03-13 14:22:57 EDT
Created attachment 297965 [details]
Output with stderr redirected.
Comment 5 Lillian Angel 2008-03-13 14:32:03 EDT
This does work if we pass the CFLAGS to ./configure instead. I am testing builds
on x86_64 and x86.

Comment 6 Gary Benson 2008-03-14 05:40:12 EDT
I can't see it being a problem.  zero passes only -m{31,32,64} at the moment,
but I was wondering if I ought to be passing any -mtune options so that solves
that :)
Comment 7 Lillian Angel 2008-03-14 09:49:06 EDT
I have a patch to fix this. Once I complete a bit of smoke testing, I will
commit the changes to the spec file and rebuild java-1.6.0-openjdk.
Comment 8 Lillian Angel 2008-03-19 13:48:30 EDT
After testing out this fix, I noticed that ant is now broken. I have not built
this into rawhide yet.

Exception in thread "main" java.lang.NoClassDefFoundError:
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Comment 9 Lillian Angel 2008-03-20 14:34:35 EDT
Finally fixed. Building into rawhide now.

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