/[gentoo-x86]/dev-java/icedtea/files/icedtea-6-pass_javac_memory_args_to_vm.patch
Gentoo

Contents of /dev-java/icedtea/files/icedtea-6-pass_javac_memory_args_to_vm.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Feb 13 18:56:55 2013 UTC (3 months, 1 week ago) by sera
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Bump, security fixes for 7, regression fixes for 6
Remove vulnerable

(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key 3C5CF75A)

1 # HG changeset patch
2 # User Andrew John Hughes <ahughes@redhat.com>
3 # Date 1336602703 -3600
4 # Node ID fe14de44c8a8961a9ebc7f9d6a896dea26fa8afb
5 # Parent 643fb6254e8086111966e01877d19a0deff6dceb
6 Allow builds where the memory limit of the VM needs to be increased to run javac.
7
8 2012-05-09 Andrew John Hughes <ahughes@redhat.com>
9
10 * Makefile.am:
11 (MEMORY_LIMIT): Always set this.
12 * javac.in:
13 Split out '-J' prefixed options and pass them
14 to the VM rather than ecj. Filter out
15 '-J-Xbootclasspath/p:', which makes no sense
16 as there's nothing to prepend, and confuses
17 the VM.
18
19 diff --git a/Makefile.am b/Makefile.am
20 --- a/Makefile.am
21 +++ b/Makefile.am
22 @@ -89,6 +89,7 @@
23 $(SHARE)/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java
24
25 # Flags
26 +MEMORY_LIMIT = -J-Xmx1024m
27 IT_CFLAGS=$(CFLAGS) $(ARCHFLAG)
28 IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE)
29 IT_LANGUAGE_SOURCE_VERSION=6
30 @@ -120,15 +121,6 @@
31 PULSE_JAVA_CLEAN_TARGET = clean-pulse-java
32 endif
33
34 -# FIXME: This should not depend on bootstrapping
35 -# but on whether MEMORY_LIMIT is accepted
36 -# as an argument to javac
37 -if BOOTSTRAPPING
38 - MEMORY_LIMIT =
39 -else
40 - MEMORY_LIMIT = -J-Xmx1024m
41 -endif
42 -
43 if ENABLE_CACAO
44 ICEDTEA_BUILD_TARGET=jdk_only
45 ICEDTEA_DEBUG_BUILD_TARGET = jdk_fastdebug_only
46 diff --git a/javac.in b/javac.in
47 --- a/javac.in
48 +++ b/javac.in
49 @@ -1,7 +1,7 @@
50 #!/usr/bin/perl -w
51 use strict;
52 use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
53 -use constant STRIP_ARGS => qw(-Werror -implicit:none);
54 +use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
55
56 my $ECJ_WARNINGS="-nowarn";
57
58 @@ -31,24 +31,34 @@
59 splice @new_args, $_, 1 for @indices;
60 }
61
62 - return @new_args;
63 + return \@new_args;
64 +}
65 +
66 +sub split_vm_args
67 +{
68 + my @new_args = @{$_[0]};
69 +
70 + my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
71 + my @javac_args = grep $_ !~ /^-J/, @new_args;
72 +
73 + return (\@vm_args, \@javac_args);
74 }
75
76 if ( -e "@abs_top_builddir@/native-ecj" )
77 {
78 - my @ecj_args = gen_ecj_opts( \@ARGV );
79 - exec '@abs_top_builddir@/native-ecj', @ecj_parms, @ecj_args ;
80 + my $ecj_args = gen_ecj_opts( \@ARGV );
81 + exec '@abs_top_builddir@/native-ecj', @ecj_parms, @$ecj_args ;
82 }
83 elsif ( -e "@ECJ_JAR@" )
84 {
85 - my @ecj_args = gen_ecj_opts( \@ARGV );
86 + my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV ));
87 my @CLASSPATH = ('@ECJ_JAR@');
88 push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
89 $ENV{"CLASSPATH"} = join ':', @CLASSPATH;
90 - exec '@JAVA@', 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @ecj_args;
91 + exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @$javac_args;
92 }
93 else
94 {
95 - my @ecj_args = gen_ecj_opts( \@ARGV );
96 - exec '@ECJ@', @ecj_parms, @ecj_args ;
97 + my $ecj_args = gen_ecj_opts( \@ARGV );
98 + exec '@ECJ@', @ecj_parms, @$ecj_args ;
99 }

  ViewVC Help
Powered by ViewVC 1.1.13