All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch
@ 2018-03-12 16:38 André Draszik
  2018-03-12 16:38 ` [meta-java][PATCH 2/2] openjdk-8: fix build with --as-needed host toolchains (Ubuntu 16.04) André Draszik
  2018-03-13 16:10 ` [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch Maxin B. John
  0 siblings, 2 replies; 6+ messages in thread
From: André Draszik @ 2018-03-12 16:38 UTC (permalink / raw)
  To: yocto

From: André Draszik <andre.draszik@jci.com>

The patch had a few typos, leading to errors during ./configure
   ../jdk8u-4be07cb28b21/common/autoconf/configure: line 8408: test: too many arguments

Change-Id: I867eba7aae3390aa869e69c86f29e77b505043e7
---
 recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
index 6454237..5192d1a 100644
--- a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
+++ b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
@@ -6,7 +6,7 @@
      # User has supplied a make, test it.
 -    if test ! -f "$MAKE"; then
 -      AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
-+    if test -a `dirname "$MAKE"` = "." -a ! -f "$MAKE"; then
++    if test `dirname "$MAKE"` = "." && ! test -f "$MAKE"; then
 +      AC_PATH_PROGS(CHECK_MAKE, $MAKE)
 +    else
 +      CHECK_MAKE="${MAKE}"
-- 
2.16.2



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

* [meta-java][PATCH 2/2] openjdk-8: fix build with --as-needed host toolchains (Ubuntu 16.04)
  2018-03-12 16:38 [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch André Draszik
@ 2018-03-12 16:38 ` André Draszik
  2018-03-13 16:10 ` [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch Maxin B. John
  1 sibling, 0 replies; 6+ messages in thread
From: André Draszik @ 2018-03-12 16:38 UTC (permalink / raw)
  To: yocto

From: André Draszik <andre.draszik@jci.com>

As per the commit message - build on hosts with --as-needed
toolchains (Ubuntu 16.04) using system provided zlib fails:

If the (host) toolchain has been configured to
unconditionally add --as-needed to the linker command line
then linking can fail when using system libraries.

The reason is that the order of command line arguments
becomes important with --as-needed and the JDK build system
places needed system libraries at the beginning of the
command line where it would normally place the object files
from its own bundled compiled version.

Having those system libraries early in the command line is
not useful, as they are discarded by the linker at that
point in time as it hasn't seen any reference to the
symbols provided yet.

As it seems a generic pattern in the makefiles here, just
place the $EXPECTED_OBJS early in the command line, before
any additional libraries, so as to fix this once and for
all.

Change-Id: I568067011bb8899700c63aa3ee9ca952045cce05
Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 recipes-core/openjdk/openjdk-8-release-16xbyy.inc  |  1 +
 ...fix-build-on-as-needed-toolchains-generic.patch | 91 ++++++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/0010-build-fix-build-on-as-needed-toolchains-generic.patch

diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
index ab72830..bd4a349 100644
--- a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
+++ b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
@@ -15,6 +15,7 @@ PATCHES_URI = "\
     file://0007-jdk-use-correct-include-for-poll.patch \
     file://0008-jdk-use-correct-include-for-signal.patch \
     file://0009-jdk-disable-backtrace-musl-build-fix.patch \
+    file://0010-build-fix-build-on-as-needed-toolchains-generic.patch \
 "
 # some patches extracted from http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
 # reported via http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
diff --git a/recipes-core/openjdk/patches-openjdk-8/0010-build-fix-build-on-as-needed-toolchains-generic.patch b/recipes-core/openjdk/patches-openjdk-8/0010-build-fix-build-on-as-needed-toolchains-generic.patch
new file mode 100644
index 0000000..2d02b7c
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/0010-build-fix-build-on-as-needed-toolchains-generic.patch
@@ -0,0 +1,91 @@
+From 84bcdb9cdab0e0be9cdfededfb518d3cea9009e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Mon, 12 Mar 2018 15:40:58 +0000
+Subject: [PATCH] build: fix build on --as-needed toolchains (generic)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If the (host) toolchain has been configured to
+unconditionally add --as-needed to the linker command line
+then linking fails when using the system zlib:
+  + ...gcc -lz -L<sysroot>/usr/lib -L<sysroot>/lib \
+               -Wl,-rpath-link,<sysroot>/usr/lib -Wl,-rpath-link,<sysroot>/lib \
+               -Wl,-rpath,<sysroot>/usr/lib -Wl,-rpath,<sysroot>/lib \
+           -Wl,-O1 -Xlinker --hash-style=both -Xlinker -z -Xlinker defs -Xlinker -O1 \
+           -Xlinker --allow-shlib-undefined -Xlinker -soname=libunpack.so \
+           -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker '$ORIGIN' \
+           -lc \
+           -Xlinker -version-script=<src>/jdk/make/mapfiles/libunpack/mapfile-vers-unpack200 \
+           -o $build/jdk/objs/unpackexe/unpack200 \
+           $build/jdk/objs/unpackexe/bands.o $build/jdk/objs/unpackexe/bytes.o \
+           $build/jdk/objs/unpackexe/coding.o $build/jdk/objs/unpackexe/main.o \
+           $build/jdk/objs/unpackexe/unpack.o $build/jdk/objs/unpackexe/utils.o \
+           $build/jdk/objs/unpackexe/zip.o -lstdc++
+  $build/jdk/objs/unpackexe/zip.o: In function `jar::deflate_bytes(bytes&, bytes&)':
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:464: undefined reference to `deflateInit2_'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:507: undefined reference to `deflate'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:514: undefined reference to `deflateEnd'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:502: undefined reference to `deflate'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:518: undefined reference to `deflateEnd'
+  $build/jdk/objs/unpackexe/zip.o: In function `jar::get_crc32(unsigned int, unsigned char*, unsigned int)':
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:61: undefined reference to `crc32'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:61: undefined reference to `crc32'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:61: undefined reference to `crc32'
+  $build/jdk/objs/unpackexe/zip.o: In function `gunzip::free()':
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:645: undefined reference to `inflateEnd'
+  $build/jdk/objs/unpackexe/zip.o: In function `read_input_via_gzip(unpacker*, void*, long, long)':
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:548: undefined reference to `inflate'
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:548: undefined reference to `inflate'
+  $build/jdk/objs/unpackexe/zip.o: In function `gunzip::start(int)':
+  $src/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp:637: undefined reference to `inflateInit2_'
+  collect2: error: ld returned 1 exit status
+
+(as happened on a Ubuntu 16.04 xenial host:
+  gcc --version
+  gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
+  Copyright (C) 2015 Free Software Foundation, Inc.
+  This is free software; see the source for copying conditions.  There is NO
+  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+)
+
+The reason is that the order of command line arguments
+becomes important with --as-needed and the JDK build system
+places -lz at the beginning of the command line where it
+would normally place the zlib object files from its own
+bundled compiled version.
+
+Having -lz early in the command line is not useful, as it
+is discarded by the linker at that point in time as it
+hasn't seen any reference to the symbols provided yet.
+
+As it seems a generic pattern in the makefiles here, just
+place the $EXPECTED_OBJS early in the command line, before
+any additional libraries, so as to fix this once and for
+all.
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+---
+Upstream-Status: Pending
+ make/common/NativeCompilation.gmk | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk
+index e7ea22ce..79f081fd 100644
+--- a/make/common/NativeCompilation.gmk
++++ b/make/common/NativeCompilation.gmk
+@@ -477,9 +477,8 @@ define SetupNativeCompilation
+ 
+     $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
+ 	$$(call LINKING_EXE_MSG,$$($1_BASENAME))
+-	$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
+-	$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
+-	$$($1_EXTRA_LDFLAGS_SUFFIX)
++	$$($1_LDEXE) $$($1_EXPECTED_OBJS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
++	$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
+         ifneq (,$$($1_GEN_MANIFEST))
+ 	  $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
+         endif
+-- 
+2.16.2
+
-- 
2.16.2



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

* Re: [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch
  2018-03-12 16:38 [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch André Draszik
  2018-03-12 16:38 ` [meta-java][PATCH 2/2] openjdk-8: fix build with --as-needed host toolchains (Ubuntu 16.04) André Draszik
@ 2018-03-13 16:10 ` Maxin B. John
  2018-03-15  9:10   ` André Draszik
  1 sibling, 1 reply; 6+ messages in thread
From: Maxin B. John @ 2018-03-13 16:10 UTC (permalink / raw)
  To: André Draszik; +Cc: yocto

Hi André,

On Mon, Mar 12, 2018 at 04:38:05PM +0000, André Draszik wrote:
> From: André Draszik <andre.draszik@jci.com>
> 
> The patch had a few typos, leading to errors during ./configure
>    ../jdk8u-4be07cb28b21/common/autoconf/configure: line 8408: test: too many arguments
> 
> Change-Id: I867eba7aae3390aa869e69c86f29e77b505043e7
> ---
>  recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
> index 6454237..5192d1a 100644
> --- a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
> +++ b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
> @@ -6,7 +6,7 @@
>       # User has supplied a make, test it.
>  -    if test ! -f "$MAKE"; then
>  -      AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
> -+    if test -a `dirname "$MAKE"` = "." -a ! -f "$MAKE"; then
> ++    if test `dirname "$MAKE"` = "." && ! test -f "$MAKE"; then
>  +      AC_PATH_PROGS(CHECK_MAKE, $MAKE)
>  +    else
>  +      CHECK_MAKE="${MAKE}"
> --

Merged, Thanks.

Best Regards,
Maxin


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

* Re: [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch
  2018-03-13 16:10 ` [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch Maxin B. John
@ 2018-03-15  9:10   ` André Draszik
  2018-03-15 10:47     ` Maxin B. John
  2018-03-15 12:09     ` Maxin B. John
  0 siblings, 2 replies; 6+ messages in thread
From: André Draszik @ 2018-03-15  9:10 UTC (permalink / raw)
  To: Maxin B. John; +Cc: yocto

On Tue, 2018-03-13 at 18:10 +0200, Maxin B. John wrote:
> Hi André,
> 
> On Mon, Mar 12, 2018 at 04:38:05PM +0000, André Draszik wrote:
> > From: André Draszik <andre.draszik@jci.com>
> > 
> > The patch had a few typos, leading to errors during ./configure
> >    ../jdk8u-4be07cb28b21/common/autoconf/configure: line 8408: test: too
> > many arguments
> > 
> > Change-Id: I867eba7aae3390aa869e69c86f29e77b505043e7
> > ---
> >  recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
> > | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-
> > for-make.patch b/recipes-core/openjdk/patches-openjdk-8/dont-expect-
> > fqpn-for-make.patch
> > index 6454237..5192d1a 100644
> > --- a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-
> > make.patch
> > +++ b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-
> > make.patch
> > @@ -6,7 +6,7 @@
> >       # User has supplied a make, test it.
> >  -    if test ! -f "$MAKE"; then
> >  -      AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
> > -+    if test -a `dirname "$MAKE"` = "." -a ! -f "$MAKE"; then
> > ++    if test `dirname "$MAKE"` = "." && ! test -f "$MAKE"; then
> >  +      AC_PATH_PROGS(CHECK_MAKE, $MAKE)
> >  +    else
> >  +      CHECK_MAKE="${MAKE}"
> > --
> 
> Merged, Thanks.

Thanks Maxin.

Did you forget the 2nd patch, or is there an issue with it?

BTW, I just noticed that master and master-next have diverged quite a lot -
what is the plan wrt that?

Cheers,
Andre'



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

* Re: [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch
  2018-03-15  9:10   ` André Draszik
@ 2018-03-15 10:47     ` Maxin B. John
  2018-03-15 12:09     ` Maxin B. John
  1 sibling, 0 replies; 6+ messages in thread
From: Maxin B. John @ 2018-03-15 10:47 UTC (permalink / raw)
  To: André Draszik; +Cc: yocto

Hi André,

On Thu, Mar 15, 2018 at 09:10:05AM +0000, André Draszik wrote:
> On Tue, 2018-03-13 at 18:10 +0200, Maxin B. John wrote:
> > Hi André,
> > 
> > On Mon, Mar 12, 2018 at 04:38:05PM +0000, André Draszik wrote:
> > > From: André Draszik <andre.draszik@jci.com>
> > > 
> > > The patch had a few typos, leading to errors during ./configure
> > >    ../jdk8u-4be07cb28b21/common/autoconf/configure: line 8408: test: too
> > > many arguments
> > > 
> > > Change-Id: I867eba7aae3390aa869e69c86f29e77b505043e7
> > > ---
> > >  recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-make.patch
> > > | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-
> > > for-make.patch b/recipes-core/openjdk/patches-openjdk-8/dont-expect-
> > > fqpn-for-make.patch
> > > index 6454237..5192d1a 100644
> > > --- a/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-
> > > make.patch
> > > +++ b/recipes-core/openjdk/patches-openjdk-8/dont-expect-fqpn-for-
> > > make.patch
> > > @@ -6,7 +6,7 @@
> > >       # User has supplied a make, test it.
> > >  -    if test ! -f "$MAKE"; then
> > >  -      AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
> > > -+    if test -a `dirname "$MAKE"` = "." -a ! -f "$MAKE"; then
> > > ++    if test `dirname "$MAKE"` = "." && ! test -f "$MAKE"; then
> > >  +      AC_PATH_PROGS(CHECK_MAKE, $MAKE)
> > >  +    else
> > >  +      CHECK_MAKE="${MAKE}"
> > > --
> > 
> > Merged, Thanks.
> 
> Thanks Maxin.
> 
> Did you forget the 2nd patch, or is there an issue with it?

Ah, I missed it (or rather due to some weird reasons, it didn't
show up in my inbox)

> BTW, I just noticed that master and master-next have diverged quite a lot -
> what is the plan wrt that?

master-next was meant to be a place for testing the new patches. Will
update it soon.

> Cheers,
> Andre'

Cheers,
Maxin


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

* Re: [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch
  2018-03-15  9:10   ` André Draszik
  2018-03-15 10:47     ` Maxin B. John
@ 2018-03-15 12:09     ` Maxin B. John
  1 sibling, 0 replies; 6+ messages in thread
From: Maxin B. John @ 2018-03-15 12:09 UTC (permalink / raw)
  To: André Draszik; +Cc: yocto

Hi Andre',

On Thu, Mar 15, 2018 at 09:10:05AM +0000, André Draszik wrote:
> On Tue, 2018-03-13 at 18:10 +0200, Maxin B. John wrote:
> > Hi André,

<snip>

> > 
> > Merged, Thanks.
> 
> Thanks Maxin.
> 
> Did you forget the 2nd patch, or is there an issue with it?
> 
> BTW, I just noticed that master and master-next have diverged quite a lot -
> what is the plan wrt that?

Merged the 2nd patch and updated the master-next branch.

> Cheers,
> Andre'

Cheers,
Maxin


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

end of thread, other threads:[~2018-03-15 12:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 16:38 [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch André Draszik
2018-03-12 16:38 ` [meta-java][PATCH 2/2] openjdk-8: fix build with --as-needed host toolchains (Ubuntu 16.04) André Draszik
2018-03-13 16:10 ` [meta-java][PATCH 1/2] openjdk-8: fix MAKE detection patch Maxin B. John
2018-03-15  9:10   ` André Draszik
2018-03-15 10:47     ` Maxin B. John
2018-03-15 12:09     ` Maxin B. John

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.