Bug 437331 - OpenJDK doesn't honour optflags
Summary: OpenJDK doesn't honour optflags
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk
Version: rawhide
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Thomas Fitzsimmons
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-13 16:08 UTC by Lubomir Kundrak
Modified: 2008-03-20 18:34 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-03-20 18:34:35 UTC
Type: ---
Embargoed:


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

Description Lubomir Kundrak 2008-03-13 16:08:58 UTC
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):

java-1.6.0-openjdk-1.6.0.0-0.2.b06.fc9

Comment 1 Thomas Fitzsimmons 2008-03-13 16:22:19 UTC
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
-fasynchronous-unwind-tables


Comment 2 Lillian Angel 2008-03-13 18:09:13 UTC
I am not successful in building java-1.6.0-openjdk with those CFLAGS and
CPPFLAGS set.

Comment 3 Lillian Angel 2008-03-13 18:19:24 UTC
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
-fasynchronous-unwind-tables"

Comment 4 Lillian Angel 2008-03-13 18:22:57 UTC
Created attachment 297965 [details]
Output with stderr redirected.

Comment 5 Lillian Angel 2008-03-13 18:32:03 UTC
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 09:40:12 UTC
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 13:49:06 UTC
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 17:48:30 UTC
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:
org/apache/tools/ant/launch/Launcher
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 18:34:35 UTC
Finally fixed. Building into rawhide now.


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