mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8
@ 2018-10-31 15:12 Guillermo Rodríguez
  2018-11-08 16:26 ` Guillermo Rodriguez Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodríguez @ 2018-10-31 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: Guillermo Rodríguez

Also move back from staging.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
---
 .../0001-Fix-building-with-OpenJDK-1.8.patch       | 50 ++++++++++++++++++++++
 patches/classpath-0.99/series                      |  1 +
 rules/classpath.in                                 |  7 +--
 3 files changed, 52 insertions(+), 6 deletions(-)
 create mode 100644 patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
 create mode 100644 patches/classpath-0.99/series

diff --git a/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
new file mode 100644
index 0000000..fe7d3ba
--- /dev/null
+++ b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
@@ -0,0 +1,50 @@
+This patch makes it possible to build GNU Classpath using javac
+from OpenJDK 1.7 and 1.8.
+
+- From the javac docs: "Classes found through the classpath are
+subject to automatic recompilation if their sources are found."
+javac from OpenJDK 1.7+ will try (and fail) to recompile "standard"
+Java classes (e.g. java/lang/Object.java) when compiling the Java
+test class. Fix this by explicitly passing an empty -sourcepath.
+
+- Test for 1.6 instead of 1.5, as -source/-target 1.5 is deprecated
+in Java 8, and the Makefiles already use -source/-target 1.6 anyway.
+
+---
+ m4/ac_prog_java_works.m4  | 3 ++-
+ m4/ac_prog_javac_works.m4 | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
+index d3f2744..f36318b 100644
+--- a/m4/ac_prog_java_works.m4
++++ b/m4/ac_prog_java_works.m4
+@@ -62,7 +62,8 @@ EOF
+ changequote([, ])dnl
+ if test x$ac_cv_prog_uudecode_base64 != xyes; then
+    	AC_REQUIRE([AC_PROG_JAVAC_WORKS])
+-        if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
++   	CMD="$JAVAC $JAVACFLAGS -sourcepath '' $JAVA_TEST"
++        if AC_TRY_COMMAND($CMD) && test -s $CLASS_TEST; then
+                 :
+         else
+           echo "configure: failed program was:" >&AC_FD_CC
+diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
+index 7fb298d..fbe24ce 100644
+--- a/m4/ac_prog_javac_works.m4
++++ b/m4/ac_prog_javac_works.m4
+@@ -33,9 +33,9 @@ public class Object
+ }
+ EOF
+ if test x$JAVAC_IS_GCJ = xyes; then
+-  CMD="$JAVAC $JAVACFLAGS -fsource=1.5 -ftarget=1.5 $JAVA_TEST"
++  CMD="$JAVAC $JAVACFLAGS -fsource=1.6 -ftarget=1.6 $JAVA_TEST"
+ else
+-  CMD="$JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST"
++  CMD="$JAVAC $JAVACFLAGS -sourcepath '' -source 1.6 -target 1.6 $JAVA_TEST"
+ fi
+ if AC_TRY_COMMAND($CMD) >/dev/null 2>&1; then
+   ac_cv_prog_javac_works=yes
+-- 
+1.9.1
+
diff --git a/patches/classpath-0.99/series b/patches/classpath-0.99/series
new file mode 100644
index 0000000..1fffdbd
--- /dev/null
+++ b/patches/classpath-0.99/series
@@ -0,0 +1 @@
+0001-Fix-building-with-OpenJDK-1.8.patch
diff --git a/rules/classpath.in b/rules/classpath.in
index 67b5dca..16017b2 100644
--- a/rules/classpath.in
+++ b/rules/classpath.in
@@ -1,6 +1,4 @@
-## SECTION=staging
-## old section:
-### SECTION=bytecode_engines
+## SECTION=bytecode_engines
 
 config CLASSPATH
 	tristate
@@ -12,6 +10,3 @@ config CLASSPATH
 	  free core class libraries for use with virtual machines and compilers
 	  for the java programming language.
 
-	  STAGING: remove in ptxdist-2019.04.0
-	  Old, obsolete package that fails to build with OpenJDK 9.
-
-- 
1.9.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8
  2018-10-31 15:12 [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8 Guillermo Rodríguez
@ 2018-11-08 16:26 ` Guillermo Rodriguez Garcia
  2018-11-16  8:07   ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2018-11-08 16:26 UTC (permalink / raw)
  To: ptxdist

Hello all,

Any feedback on this one ?

Guillermo
El mié., 31 oct. 2018 a las 16:12, Guillermo Rodríguez
(<guille.rodriguez@gmail.com>) escribió:
>
> Also move back from staging.
>
> Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> ---
>  .../0001-Fix-building-with-OpenJDK-1.8.patch       | 50 ++++++++++++++++++++++
>  patches/classpath-0.99/series                      |  1 +
>  rules/classpath.in                                 |  7 +--
>  3 files changed, 52 insertions(+), 6 deletions(-)
>  create mode 100644 patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
>  create mode 100644 patches/classpath-0.99/series
>
> diff --git a/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
> new file mode 100644
> index 0000000..fe7d3ba
> --- /dev/null
> +++ b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
> @@ -0,0 +1,50 @@
> +This patch makes it possible to build GNU Classpath using javac
> +from OpenJDK 1.7 and 1.8.
> +
> +- From the javac docs: "Classes found through the classpath are
> +subject to automatic recompilation if their sources are found."
> +javac from OpenJDK 1.7+ will try (and fail) to recompile "standard"
> +Java classes (e.g. java/lang/Object.java) when compiling the Java
> +test class. Fix this by explicitly passing an empty -sourcepath.
> +
> +- Test for 1.6 instead of 1.5, as -source/-target 1.5 is deprecated
> +in Java 8, and the Makefiles already use -source/-target 1.6 anyway.
> +
> +---
> + m4/ac_prog_java_works.m4  | 3 ++-
> + m4/ac_prog_javac_works.m4 | 4 ++--
> + 2 files changed, 4 insertions(+), 3 deletions(-)
> +
> +diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
> +index d3f2744..f36318b 100644
> +--- a/m4/ac_prog_java_works.m4
> ++++ b/m4/ac_prog_java_works.m4
> +@@ -62,7 +62,8 @@ EOF
> + changequote([, ])dnl
> + if test x$ac_cv_prog_uudecode_base64 != xyes; then
> +       AC_REQUIRE([AC_PROG_JAVAC_WORKS])
> +-        if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
> ++      CMD="$JAVAC $JAVACFLAGS -sourcepath '' $JAVA_TEST"
> ++        if AC_TRY_COMMAND($CMD) && test -s $CLASS_TEST; then
> +                 :
> +         else
> +           echo "configure: failed program was:" >&AC_FD_CC
> +diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
> +index 7fb298d..fbe24ce 100644
> +--- a/m4/ac_prog_javac_works.m4
> ++++ b/m4/ac_prog_javac_works.m4
> +@@ -33,9 +33,9 @@ public class Object
> + }
> + EOF
> + if test x$JAVAC_IS_GCJ = xyes; then
> +-  CMD="$JAVAC $JAVACFLAGS -fsource=1.5 -ftarget=1.5 $JAVA_TEST"
> ++  CMD="$JAVAC $JAVACFLAGS -fsource=1.6 -ftarget=1.6 $JAVA_TEST"
> + else
> +-  CMD="$JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST"
> ++  CMD="$JAVAC $JAVACFLAGS -sourcepath '' -source 1.6 -target 1.6 $JAVA_TEST"
> + fi
> + if AC_TRY_COMMAND($CMD) >/dev/null 2>&1; then
> +   ac_cv_prog_javac_works=yes
> +--
> +1.9.1
> +
> diff --git a/patches/classpath-0.99/series b/patches/classpath-0.99/series
> new file mode 100644
> index 0000000..1fffdbd
> --- /dev/null
> +++ b/patches/classpath-0.99/series
> @@ -0,0 +1 @@
> +0001-Fix-building-with-OpenJDK-1.8.patch
> diff --git a/rules/classpath.in b/rules/classpath.in
> index 67b5dca..16017b2 100644
> --- a/rules/classpath.in
> +++ b/rules/classpath.in
> @@ -1,6 +1,4 @@
> -## SECTION=staging
> -## old section:
> -### SECTION=bytecode_engines
> +## SECTION=bytecode_engines
>
>  config CLASSPATH
>         tristate
> @@ -12,6 +10,3 @@ config CLASSPATH
>           free core class libraries for use with virtual machines and compilers
>           for the java programming language.
>
> -         STAGING: remove in ptxdist-2019.04.0
> -         Old, obsolete package that fails to build with OpenJDK 9.
> -
> --
> 1.9.1
>


-- 
Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8
  2018-11-08 16:26 ` Guillermo Rodriguez Garcia
@ 2018-11-16  8:07   ` Michael Olbrich
  2018-11-16 11:18     ` Guillermo Rodriguez Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2018-11-16  8:07 UTC (permalink / raw)
  To: ptxdist

Hi,
On Thu, Nov 08, 2018 at 05:26:11PM +0100, Guillermo Rodriguez Garcia wrote:
> Any feedback on this one ?

I was just waiting to get the release out of the door. I've applied this
now. It build on must of my test setups, so it gets enough test coverage to
notice if the build fails.
Note that on my Debian testing machine, configure fails with:

configure:24594: checking if /usr/lib/jvm/default-java/bin/javac works
configure:24619: /usr/lib/jvm/default-java/bin/javac  -source 1.5 -target 1.5 Object.java
warning: [options] bootstrap class path not set in conjunction with -source 5
error: Source option 5 is no longer supported. Use 6 or later.
error: Target option 1.5 is no longer supported. Use 1.6 or later.
configure:24622: $? = 2
configure:24626: error: The Java compiler /usr/lib/jvm/default-java/bin/javac failed (see config.log, check the CLASSPATH?)

So there will be problems again in the future that need to be fixed. For
now I can disable the package for individual test builds.

Michael

> El mié., 31 oct. 2018 a las 16:12, Guillermo Rodríguez
> (<guille.rodriguez@gmail.com>) escribió:
> >
> > Also move back from staging.
> >
> > Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
> > ---
> >  .../0001-Fix-building-with-OpenJDK-1.8.patch       | 50 ++++++++++++++++++++++
> >  patches/classpath-0.99/series                      |  1 +
> >  rules/classpath.in                                 |  7 +--
> >  3 files changed, 52 insertions(+), 6 deletions(-)
> >  create mode 100644 patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
> >  create mode 100644 patches/classpath-0.99/series
> >
> > diff --git a/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
> > new file mode 100644
> > index 0000000..fe7d3ba
> > --- /dev/null
> > +++ b/patches/classpath-0.99/0001-Fix-building-with-OpenJDK-1.8.patch
> > @@ -0,0 +1,50 @@
> > +This patch makes it possible to build GNU Classpath using javac
> > +from OpenJDK 1.7 and 1.8.
> > +
> > +- From the javac docs: "Classes found through the classpath are
> > +subject to automatic recompilation if their sources are found."
> > +javac from OpenJDK 1.7+ will try (and fail) to recompile "standard"
> > +Java classes (e.g. java/lang/Object.java) when compiling the Java
> > +test class. Fix this by explicitly passing an empty -sourcepath.
> > +
> > +- Test for 1.6 instead of 1.5, as -source/-target 1.5 is deprecated
> > +in Java 8, and the Makefiles already use -source/-target 1.6 anyway.
> > +
> > +---
> > + m4/ac_prog_java_works.m4  | 3 ++-
> > + m4/ac_prog_javac_works.m4 | 4 ++--
> > + 2 files changed, 4 insertions(+), 3 deletions(-)
> > +
> > +diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
> > +index d3f2744..f36318b 100644
> > +--- a/m4/ac_prog_java_works.m4
> > ++++ b/m4/ac_prog_java_works.m4
> > +@@ -62,7 +62,8 @@ EOF
> > + changequote([, ])dnl
> > + if test x$ac_cv_prog_uudecode_base64 != xyes; then
> > +       AC_REQUIRE([AC_PROG_JAVAC_WORKS])
> > +-        if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
> > ++      CMD="$JAVAC $JAVACFLAGS -sourcepath '' $JAVA_TEST"
> > ++        if AC_TRY_COMMAND($CMD) && test -s $CLASS_TEST; then
> > +                 :
> > +         else
> > +           echo "configure: failed program was:" >&AC_FD_CC
> > +diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
> > +index 7fb298d..fbe24ce 100644
> > +--- a/m4/ac_prog_javac_works.m4
> > ++++ b/m4/ac_prog_javac_works.m4
> > +@@ -33,9 +33,9 @@ public class Object
> > + }
> > + EOF
> > + if test x$JAVAC_IS_GCJ = xyes; then
> > +-  CMD="$JAVAC $JAVACFLAGS -fsource=1.5 -ftarget=1.5 $JAVA_TEST"
> > ++  CMD="$JAVAC $JAVACFLAGS -fsource=1.6 -ftarget=1.6 $JAVA_TEST"
> > + else
> > +-  CMD="$JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST"
> > ++  CMD="$JAVAC $JAVACFLAGS -sourcepath '' -source 1.6 -target 1.6 $JAVA_TEST"
> > + fi
> > + if AC_TRY_COMMAND($CMD) >/dev/null 2>&1; then
> > +   ac_cv_prog_javac_works=yes
> > +--
> > +1.9.1
> > +
> > diff --git a/patches/classpath-0.99/series b/patches/classpath-0.99/series
> > new file mode 100644
> > index 0000000..1fffdbd
> > --- /dev/null
> > +++ b/patches/classpath-0.99/series
> > @@ -0,0 +1 @@
> > +0001-Fix-building-with-OpenJDK-1.8.patch
> > diff --git a/rules/classpath.in b/rules/classpath.in
> > index 67b5dca..16017b2 100644
> > --- a/rules/classpath.in
> > +++ b/rules/classpath.in
> > @@ -1,6 +1,4 @@
> > -## SECTION=staging
> > -## old section:
> > -### SECTION=bytecode_engines
> > +## SECTION=bytecode_engines
> >
> >  config CLASSPATH
> >         tristate
> > @@ -12,6 +10,3 @@ config CLASSPATH
> >           free core class libraries for use with virtual machines and compilers
> >           for the java programming language.
> >
> > -         STAGING: remove in ptxdist-2019.04.0
> > -         Old, obsolete package that fails to build with OpenJDK 9.
> > -
> > --
> > 1.9.1
> >
> 
> 
> -- 
> Guillermo Rodriguez Garcia
> guille.rodriguez@gmail.com
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8
  2018-11-16  8:07   ` Michael Olbrich
@ 2018-11-16 11:18     ` Guillermo Rodriguez Garcia
  0 siblings, 0 replies; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2018-11-16 11:18 UTC (permalink / raw)
  To: ptxdist

Hi Michael,

El vie., 16 nov. 2018 a las 9:08, Michael Olbrich
(<m.olbrich@pengutronix.de>) escribió:
>
> Hi,
> On Thu, Nov 08, 2018 at 05:26:11PM +0100, Guillermo Rodriguez Garcia wrote:
> > Any feedback on this one ?
>
> I was just waiting to get the release out of the door. I've applied this
> now. It build on must of my test setups, so it gets enough test coverage to
> notice if the build fails.
> Note that on my Debian testing machine, configure fails with:
>
> configure:24594: checking if /usr/lib/jvm/default-java/bin/javac works
> configure:24619: /usr/lib/jvm/default-java/bin/javac  -source 1.5 -target 1.5 Object.java
> warning: [options] bootstrap class path not set in conjunction with -source 5
> error: Source option 5 is no longer supported. Use 6 or later.
> error: Target option 1.5 is no longer supported. Use 1.6 or later.

OK it seems that my patch was not complete. With my changes properly
applied, the m4 macros should be using 1.6 and not 1.5.
autogen.sh must be run so that the configure script is regenerated. I
missed this when I submitted the patch. Sorry for that.

I am sending a new patch to fix this.

Best,

Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-16 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 15:12 [ptxdist] [PATCH] classpath: Fix building with OpenJDK 1.8 Guillermo Rodríguez
2018-11-08 16:26 ` Guillermo Rodriguez Garcia
2018-11-16  8:07   ` Michael Olbrich
2018-11-16 11:18     ` Guillermo Rodriguez Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox