lovubuntu / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

Feature request: build annotated jdk using ct.sym #315

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to build the annotated jdk using ct.sym instead of rt.jar? 
Having an extra copy of rt.jar could cause problems if it was accidentally used 
at runtime, and as long as it's only needed as a set of compile-time symbols 
the stubs in ct.sym can be used instead.

The change would be a tiny patch:

--- a/checker/jdk/Makefile  Tue Apr 01 21:18:03 2014 -0700
+++ b/checker/jdk/Makefile  Wed Apr 02 14:34:01 2014 -0700
@@ -2,12 +2,12 @@
 #   make all
 # which creates the jdk.jar file.

-RTJAR ?= $(JAVA_HOME)/jre/lib/rt.jar
+CTSYM ?= $(JAVA_HOME)/lib/ct.sym
@@ -59,7 +59,9 @@
 annotated/%.class:
    mkdir -p annotated
 # Ignore errors for now; we get errors when building the JDK for Java 6 but looking for files that are in the annotated JDK because of Java 7.
-   -cd annotated; unzip $(RTJAR) '$*.class' > /dev/null
+   -cd annotated; unzip $(CTSYM) 'META-INF/sym/rt.jar/*.class' > /dev/null
+   -cd annotated/META-INF/sym/rt.jar/; mv * ../../../
+   -rm -rf annotated/META-INF

 # Helper targets to invoke subdir make files
 # "$*" expands to the stem that matched the "%".

Original issue reported on code.google.com by cus...@google.com on 2 Apr 2014 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by michael.ernst@gmail.com on 15 Apr 2014 at 6:45

GoogleCodeExporter commented 9 years ago
This change was made in version 994b0cd9e226 which has been pushed to the 
repository. It will also go out as part of the next monthly checker framework 
release on June 1.

As it is now only symbols, using the annotated jdk on the bootclasspath of a VM 
will cause the
vm to crash immediately.

Original comment by mcarthur...@gmail.com on 13 May 2014 at 11:10

GoogleCodeExporter commented 9 years ago

Original comment by jtha...@cs.washington.edu on 3 Jun 2014 at 12:47