RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Severin Gehwolf
Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently switched to
building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
more details are on the bug.

webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
 --with-extra-ldflags="-Xlinker -z -Xlinker defs"
 prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin


Re: RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Erik Joelsson

Hello Severin,

If adding the -lawt_headless makes the code compile with -Wl,-z,defs, 
then I would also like to see that filtering removed in the same patch. 
However, I think someone from 2d needs to shed some light on the origin 
of this. I would assume that at some point there was a reason for not 
adding -lawt_headless to libfontmanager, and for that to work, someone 
removed the -Wl,-z,defs from that linker command line. Tracing this 
back, the removal of -z defs was there in the initial Mercurial commit, 
so someone needs to go back into the really old archives to find answers 
here.


Regarding -Xlinker vs -Wl, I believe we tried to unify usage to one or 
the other at some point.


/Erik

On 2018-01-26 08:10, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently switched to
building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
more details are on the bug.

webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
  --with-extra-ldflags="-Xlinker -z -Xlinker defs"
  prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

 LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \
 $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin




Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Phil Race
When this was fixed for Solaris 
https://bugs.openjdk.java.net/browse/JDK-8071710
the observed problem was not building (although it could have been) but 
at runtime.

I think you can verify what you've done with "ldd" ..

This patch adds awt_headless.so, but does not remove awt.so.

Perhaps the line

LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
After your fix I expect "ldd" should not need to show awt .. just awt_headless

ie linux should not have this -lawt dependency any more and the -lawt 
dependency should be specific to windows + mac ..


On 01/26/2018 08:10 AM, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently switched to
building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
more details are on the bug.

webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
  --with-extra-ldflags="-Xlinker -z -Xlinker defs"
  prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.

-phil.

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

 LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \
 $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin




Re: RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Severin Gehwolf
Hi Erik,

Thanks for the feedback!

On Fri, 2018-01-26 at 08:27 -0800, Erik Joelsson wrote:
> Hello Severin,
> 
> If adding the -lawt_headless makes the code compile with -Wl,-z,defs, 
> then I would also like to see that filtering removed in the same patch.

Agreed.

> However, I think someone from 2d needs to shed some light on the origin 
> of this. I would assume that at some point there was a reason for not 
> adding -lawt_headless to libfontmanager, and for that to work, someone 
> removed the -Wl,-z,defs from that linker command line. Tracing this 
> back, the removal of -z defs was there in the initial Mercurial commit, 
> so someone needs to go back into the really old archives to find answers 
> here.

Interested to hear the answer to this. If that's still possible, that
is.

> Regarding -Xlinker vs -Wl, I believe we tried to unify usage to one or 
> the other at some point.

Fair enough. It's still sub-optimal that it might fail for one variant
but not the other. If it's filtering, it should do it for both
variants. W discovered this in the first place because the flags that
get set are -Wl,-z,defs yet the JDK 8 filter is for -Xlinker. Now with
JDK 11 it's the other way around.

With that being said, this discussion is a moot point if we can remove
this.

Thanks,
Severin

> /Erik
> 
> On 2018-01-26 08:10, Severin Gehwolf wrote:
> > Hi,
> > 
> > Could I please get a review for this rather small patch which
> > originally occurred for us on JDK 8 (Fedora) which recently switched to
> > building with "-Wl,-z,defs" linker flags. The result was a build
> > failure, due to unresolved symbols. Indeed libfontmanager.so should
> > have -lawt_headless in the list of dependent libs as symbols such as
> > AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
> > more details are on the bug.
> > 
> > webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8196218
> > 
> > Testing: Build fails with configure option
> >   --with-extra-ldflags="-Xlinker -z -Xlinker defs"
> >   prior the fix. Succeeds after.
> > 
> > Question for 2d-folks/build-dev folks:
> > 
> > There is this snippet in the libfontmanager block in
> > make/lib/Awt2dLibraries.gmk, line 686:
> > 
> >  LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
> > $(LDFLAGS_CXX_JDK) \
> >  $(call SET_SHARED_LIBRARY_ORIGIN), \
> > 
> > It's my understanding that this is supposed to filter "-Wl,-z,defs"
> > from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
> > reason when unresolved symbols at link time are OK? Besides, why does
> > it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
> > other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
> > Thoughts?
> > 
> > Thanks,
> > Severin
> 
> 


Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Erik Joelsson


On 2018-01-26 08:44, Phil Race wrote:
When this was fixed for Solaris 
https://bugs.openjdk.java.net/browse/JDK-8071710
the observed problem was not building (although it could have been) 
but at runtime.

I think you can verify what you've done with "ldd" ..

This patch adds awt_headless.so, but does not remove awt.so.

Perhaps the line

LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
After your fix I expect "ldd" should not need to show awt .. just 
awt_headless


ie linux should not have this -lawt dependency any more and the -lawt 
dependency should be specific to windows + mac ..


So we already use -lawt_headless on solaris and aix, then I really can't 
see a reason not to do the same for linux.


On 01/26/2018 08:10 AM, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently switched to
building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
more details are on the bug.

webrev: 
http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/

Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
  --with-extra-ldflags="-Xlinker -z -Xlinker defs"
  prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.

This is from way ahead of my time. The filtering is simply the 
build-infra way of achieving the same thing as in the old build system. 
Here is the corresponding code in jdk7:


$ hg annotate make/sun/font/Makefile
...
   0: #
   0: # Created without -z defs on linux
   0: #
   0: ifeq ($(PLATFORM), linux)
   0:   LDFLAGS_DEFS_OPTION =
   0: endif
...

/Erik


-phil.

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

 LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \

 $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin






Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Severin Gehwolf
On Fri, 2018-01-26 at 08:54 -0800, Erik Joelsson wrote:
> On 2018-01-26 08:44, Phil Race wrote:
> > When this was fixed for Solaris 
> > https://bugs.openjdk.java.net/browse/JDK-8071710
> > the observed problem was not building (although it could have been) 
> > but at runtime.
> > I think you can verify what you've done with "ldd" ..
> > 
> > This patch adds awt_headless.so, but does not remove awt.so.
> > 
> > Perhaps the line
> > 
> > LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
> > After your fix I expect "ldd" should not need to show awt .. just 
> > awt_headless
> > 
> > ie linux should not have this -lawt dependency any more and the -lawt 
> > dependency should be specific to windows + mac ..

Thanks for the review, Phil. I'll post an updated webrev shortly.

Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
platforms that need it? solaris, linux, aix should already be fine
without filtering.

Thanks,
Severin

> So we already use -lawt_headless on solaris and aix, then I really can't 
> see a reason not to do the same for linux.
> > 
> > On 01/26/2018 08:10 AM, Severin Gehwolf wrote:
> > > Hi,
> > > 
> > > Could I please get a review for this rather small patch which
> > > originally occurred for us on JDK 8 (Fedora) which recently switched to
> > > building with "-Wl,-z,defs" linker flags. The result was a build
> > > failure, due to unresolved symbols. Indeed libfontmanager.so should
> > > have -lawt_headless in the list of dependent libs as symbols such as
> > > AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
> > > more details are on the bug.
> > > 
> > > webrev: 
> > > http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
> > > Bug: https://bugs.openjdk.java.net/browse/JDK-8196218
> > > 
> > > Testing: Build fails with configure option
> > >   --with-extra-ldflags="-Xlinker -z -Xlinker defs"
> > >   prior the fix. Succeeds after.
> > > 
> > > Question for 2d-folks/build-dev folks:
> > 
> > I don't know about this, build folks probably know.
> > 
> 
> This is from way ahead of my time. The filtering is simply the 
> build-infra way of achieving the same thing as in the old build system. 
> Here is the corresponding code in jdk7:
> 
> $ hg annotate make/sun/font/Makefile
> ...
> 0: #
> 0: # Created without -z defs on linux
> 0: #
> 0: ifeq ($(PLATFORM), linux)
> 0:   LDFLAGS_DEFS_OPTION =
> 0: endif
> ...
> 
> /Erik
> 
> > -phil.
> > > There is this snippet in the libfontmanager block in
> > > make/lib/Awt2dLibraries.gmk, line 686:
> > > 
> > >  LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
> > > $(LDFLAGS_CXX_JDK) \
> > >  $(call SET_SHARED_LIBRARY_ORIGIN), \
> > > 
> > > It's my understanding that this is supposed to filter "-Wl,-z,defs"
> > > from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
> > > reason when unresolved symbols at link time are OK? Besides, why does
> > > it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
> > > other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
> > > Thoughts?
> > > 
> > > Thanks,
> > > Severin
> 
> 


Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Phil Race
And the SCCS history which pre-dates mercurial says it was added by 
Kelly O'Hair

who was the JDK build lead at the time .. so not added by 2D.

D 1.86.1.1 07/03/21 18:00:55 ohair 187 185  7/0/00163
6537329: Move JdbcOdbc (JDBC-ODBC Bridge) to closed

https://bugs.openjdk.java.net/browse/JDK-6537329

There's no (or insufficient for me) clue as to why that change touched 
2D/AWTmakefiles.


Perhaps something to do with this comment :
> the Makefile will be fixed to use the same Linux fake libraries trick 
on all Unix platforms,


-phil.

On 01/26/2018 08:54 AM, Erik Joelsson wrote:


Testing: Build fails with configure option
  --with-extra-ldflags="-Xlinker -z -Xlinker defs"
  prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.

This is from way ahead of my time. The filtering is simply the 
build-infra way of achieving the same thing as in the old build 
system. Here is the corresponding code in jdk7:


$ hg annotate make/sun/font/Makefile
...
   0: #
   0: # Created without -z defs on linux
   0: #
   0: ifeq ($(PLATFORM), linux)
   0:   LDFLAGS_DEFS_OPTION =
   0: endif 




Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Erik Joelsson

Interesting, so this was probably just Kelly trying to get things to build.

/Erik


On 2018-01-26 09:09, Phil Race wrote:
And the SCCS history which pre-dates mercurial says it was added by 
Kelly O'Hair

who was the JDK build lead at the time .. so not added by 2D.

D 1.86.1.1 07/03/21 18:00:55 ohair 187 185  7/0/00163
6537329: Move JdbcOdbc (JDBC-ODBC Bridge) to closed

https://bugs.openjdk.java.net/browse/JDK-6537329

There's no (or insufficient for me) clue as to why that change touched 
2D/AWTmakefiles.


Perhaps something to do with this comment :
> the Makefile will be fixed to use the same Linux fake libraries 
trick on all Unix platforms,


-phil.

On 01/26/2018 08:54 AM, Erik Joelsson wrote:


Testing: Build fails with configure option
  --with-extra-ldflags="-Xlinker -z -Xlinker defs"
  prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.

This is from way ahead of my time. The filtering is simply the 
build-infra way of achieving the same thing as in the old build 
system. Here is the corresponding code in jdk7:


$ hg annotate make/sun/font/Makefile
...
   0: #
   0: # Created without -z defs on linux
   0: #
   0: ifeq ($(PLATFORM), linux)
   0:   LDFLAGS_DEFS_OPTION =
   0: endif 






Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Erik Joelsson

On 2018-01-26 09:02, Severin Gehwolf wrote:

On Fri, 2018-01-26 at 08:54 -0800, Erik Joelsson wrote:

On 2018-01-26 08:44, Phil Race wrote:

When this was fixed for Solaris
https://bugs.openjdk.java.net/browse/JDK-8071710
the observed problem was not building (although it could have been)
but at runtime.
I think you can verify what you've done with "ldd" ..

This patch adds awt_headless.so, but does not remove awt.so.

Perhaps the line

LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
After your fix I expect "ldd" should not need to show awt .. just
awt_headless

ie linux should not have this -lawt dependency any more and the -lawt
dependency should be specific to windows + mac ..

Thanks for the review, Phil. I'll post an updated webrev shortly.

Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
platforms that need it? solaris, linux, aix should already be fine
without filtering.
I would say try removing the filtering. The affected flags are currently 
only set on linux and solaris. I will do a test build on the latter and 
see if the filtering is actually needed.


/Erik

Thanks,
Severin


So we already use -lawt_headless on solaris and aix, then I really can't
see a reason not to do the same for linux.

On 01/26/2018 08:10 AM, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently switched to
building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. Some
more details are on the bug.

webrev:
http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
   --with-extra-ldflags="-Xlinker -z -Xlinker defs"
   prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.


This is from way ahead of my time. The filtering is simply the
build-infra way of achieving the same thing as in the old build system.
Here is the corresponding code in jdk7:

$ hg annotate make/sun/font/Makefile
...
 0: #
 0: # Created without -z defs on linux
 0: #
 0: ifeq ($(PLATFORM), linux)
 0:   LDFLAGS_DEFS_OPTION =
 0: endif
...

/Erik


-phil.

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

  LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))
$(LDFLAGS_CXX_JDK) \
  $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a legit
reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 it's the
other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin






Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Phil Race



On 01/26/2018 09:02 AM, Severin Gehwolf wrote:

Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
platforms that need it? solaris, linux, aix should already be fine
without filtering.


Only to say I really don't understand it :-)
But I think it is historical baggage.


Erik said :-
> I would assume that at some point there was a reason for not adding 
-lawt_headless to libfontmanager


There was a time (1.4) when ONLY Solaris had a separate headless library.
I alluded to this in https://bugs.openjdk.java.net/browse/JDK-8071710
Headless for Linux was added in 1.5.

So we may be dealing with some really old technical debt.

-phil.


Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Erik Joelsson

This patch builds on Solaris:

diff -r 50cd89fe209f make/lib/Awt2dLibraries.gmk
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -683,15 +683,15 @@
 hidevf w_novirtualdescr arrowrtn2, \
 DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 
4819 4101, \

 MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
-    LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \

+    LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 $(call SET_SHARED_LIBRARY_ORIGIN), \
 LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 LDFLAGS_macosx := -undefined dynamic_lookup, \
 LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
-    LIBS_linux := -lc, \
+    LIBS_linux := -lawt_headless -lc, \
 LIBS_solaris := -lawt_headless -lc, \
 LIBS_aix := -lawt_headless,\

I could not remove -lawt however.

/Erik

On 2018-01-26 09:15, Erik Joelsson wrote:

On 2018-01-26 09:02, Severin Gehwolf wrote:

On Fri, 2018-01-26 at 08:54 -0800, Erik Joelsson wrote:

On 2018-01-26 08:44, Phil Race wrote:

When this was fixed for Solaris
https://bugs.openjdk.java.net/browse/JDK-8071710
the observed problem was not building (although it could have been)
but at runtime.
I think you can verify what you've done with "ldd" ..

This patch adds awt_headless.so, but does not remove awt.so.

Perhaps the line

LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
After your fix I expect "ldd" should not need to show awt .. just
awt_headless

ie linux should not have this -lawt dependency any more and the -lawt
dependency should be specific to windows + mac ..

Thanks for the review, Phil. I'll post an updated webrev shortly.

Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
platforms that need it? solaris, linux, aix should already be fine
without filtering.
I would say try removing the filtering. The affected flags are 
currently only set on linux and solaris. I will do a test build on the 
latter and see if the filtering is actually needed.


/Erik

Thanks,
Severin

So we already use -lawt_headless on solaris and aix, then I really 
can't

see a reason not to do the same for linux.

On 01/26/2018 08:10 AM, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently 
switched to

building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. 
Some

more details are on the bug.

webrev:
http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
   --with-extra-ldflags="-Xlinker -z -Xlinker defs"
   prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.


This is from way ahead of my time. The filtering is simply the
build-infra way of achieving the same thing as in the old build system.
Here is the corresponding code in jdk7:

$ hg annotate make/sun/font/Makefile
...
 0: #
 0: # Created without -z defs on linux
 0: #
 0: ifeq ($(PLATFORM), linux)
 0:   LDFLAGS_DEFS_OPTION =
 0: endif
...

/Erik


-phil.

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

  LDFLAGS := $(subst 
-Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))

$(LDFLAGS_CXX_JDK) \
  $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a 
legit

reason when unresolved symbols at link time are OK? Besides, why does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 
it's the

other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin








Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Severin Gehwolf
On Fri, 2018-01-26 at 09:18 -0800, Phil Race wrote:
> 
> On 01/26/2018 09:02 AM, Severin Gehwolf wrote:
> > Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
> > platforms that need it? solaris, linux, aix should already be fine
> > without filtering.
> 
> Only to say I really don't understand it :-)
> But I think it is historical baggage.
> 
> 
> Erik said :-
>  > I would assume that at some point there was a reason for not adding 
> -lawt_headless to libfontmanager
> 
> There was a time (1.4) when ONLY Solaris had a separate headless library.
> I alluded to this in https://bugs.openjdk.java.net/browse/JDK-8071710
> Headless for Linux was added in 1.5.
> 
> So we may be dealing with some really old technical debt.

OK. Thanks, Erik, Phil!

Cheers,
Severin


Re: [OpenJDK 2D-Dev] RFR: JDK-8196218: [linux] libfontmanager should be linked against headless awt library

2018-01-26 Thread Phil Race

> I could not remove -lawt however.

Ah yes, Erik sent me the errors and yes there are some 2D functions that are
defined in libawt that fontmanager needs for text rendering support, so 
we can't remove that.


libawt on these platforms with separate headless and xawt libraries 
could have
more aptly be called lib2d .. since most of the true AWT functionality 
is in the xawt library.



-phil.

On 01/26/2018 09:23 AM, Erik Joelsson wrote:

This patch builds on Solaris:

diff -r 50cd89fe209f make/lib/Awt2dLibraries.gmk
--- a/make/lib/Awt2dLibraries.gmk
+++ b/make/lib/Awt2dLibraries.gmk
@@ -683,15 +683,15 @@
 hidevf w_novirtualdescr arrowrtn2, \
 DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334 
4819 4101, \

 MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
-LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) 
$(LDFLAGS_CXX_JDK) \

+LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
 $(call SET_SHARED_LIBRARY_ORIGIN), \
 LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
 LDFLAGS_macosx := -undefined dynamic_lookup, \
 LIBS := $(BUILD_LIBFONTMANAGER_FONTLIB), \
 LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX), \
-LIBS_linux := -lc, \
+LIBS_linux := -lawt_headless -lc, \
 LIBS_solaris := -lawt_headless -lc, \
 LIBS_aix := -lawt_headless,\

I could not remove -lawt however.

/Erik

On 2018-01-26 09:15, Erik Joelsson wrote:

On 2018-01-26 09:02, Severin Gehwolf wrote:

On Fri, 2018-01-26 at 08:54 -0800, Erik Joelsson wrote:

On 2018-01-26 08:44, Phil Race wrote:

When this was fixed for Solaris
https://bugs.openjdk.java.net/browse/JDK-8071710
the observed problem was not building (although it could have been)
but at runtime.
I think you can verify what you've done with "ldd" ..

This patch adds awt_headless.so, but does not remove awt.so.

Perhaps the line

LIBS_unix := -lawt -ljava -ljvm $(LIBM) $(LIBCXX)
After your fix I expect "ldd" should not need to show awt .. just
awt_headless

ie linux should not have this -lawt dependency any more and the -lawt
dependency should be specific to windows + mac ..

Thanks for the review, Phil. I'll post an updated webrev shortly.

Any thoughts on the LDFLAGS filtering? Shouldn't this only be done on
platforms that need it? solaris, linux, aix should already be fine
without filtering.
I would say try removing the filtering. The affected flags are 
currently only set on linux and solaris. I will do a test build on 
the latter and see if the filtering is actually needed.


/Erik

Thanks,
Severin

So we already use -lawt_headless on solaris and aix, then I really 
can't

see a reason not to do the same for linux.

On 01/26/2018 08:10 AM, Severin Gehwolf wrote:

Hi,

Could I please get a review for this rather small patch which
originally occurred for us on JDK 8 (Fedora) which recently 
switched to

building with "-Wl,-z,defs" linker flags. The result was a build
failure, due to unresolved symbols. Indeed libfontmanager.so should
have -lawt_headless in the list of dependent libs as symbols such as
AWTLoadFont come from libawt_headless.so, not libawt.so on Linux. 
Some

more details are on the bug.

webrev:
http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8196218/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8196218

Testing: Build fails with configure option
   --with-extra-ldflags="-Xlinker -z -Xlinker defs"
   prior the fix. Succeeds after.

Question for 2d-folks/build-dev folks:

I don't know about this, build folks probably know.


This is from way ahead of my time. The filtering is simply the
build-infra way of achieving the same thing as in the old build 
system.

Here is the corresponding code in jdk7:

$ hg annotate make/sun/font/Makefile
...
 0: #
 0: # Created without -z defs on linux
 0: #
 0: ifeq ($(PLATFORM), linux)
 0:   LDFLAGS_DEFS_OPTION =
 0: endif
...

/Erik


-phil.

There is this snippet in the libfontmanager block in
make/lib/Awt2dLibraries.gmk, line 686:

  LDFLAGS := $(subst 
-Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))

$(LDFLAGS_CXX_JDK) \
  $(call SET_SHARED_LIBRARY_ORIGIN), \

It's my understanding that this is supposed to filter "-Wl,-z,defs"
from LDFLAGS_JDKLIB. Does anybody know why it does so? Is there a 
legit
reason when unresolved symbols at link time are OK? Besides, why 
does
it not also filter "-Xlinker -z -Xlinker defs"? FWIW, in JDK 8 
it's the

other way round. Xlinker flags are filtered, but -Wl,-z,defs is not.
Thoughts?

Thanks,
Severin










RFR: 8196197 - Enable the make system to calculate concurrency for JDK tests

2018-01-26 Thread Christian Tornqvist
Please review this small change that makes the JDK make test target use the 
same method for calculating jtreg concurrency as Hotspot. Verified locally and 
in Mach5.

Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8196197/webrev.00/ 


Thanks,
Christian

Re: RFR: 8196197 - Enable the make system to calculate concurrency for JDK tests

2018-01-26 Thread Erik Joelsson

This looks good to me.

Note to other reviewers. This change only applies when concurrency isn't 
being set by some other entity. Other entities include the top level 
makefiles (typically when running "make test TEST=") or by 
setting CONCURRENCY= on the make command line. The reason for this 
change is to have the test makefiles themselves provide reasonable 
defaults, which is needed when running in our distributed internal test 
system. The neat thing about this implementation is the ability to scale 
concurrency with a relative number using the concurrency factor.


/Erik


On 2018-01-26 14:44, Christian Tornqvist wrote:

Please review this small change that makes the JDK make test target use the 
same method for calculating jtreg concurrency as Hotspot. Verified locally and 
in Mach5.

Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8196197/webrev.00/ 


Thanks,
Christian




Re: RFR: 8196197 - Enable the make system to calculate concurrency for JDK tests

2018-01-26 Thread Tim Bell

Code motion (in Makefiles)...

Looks good to me as well.

Tim

On 01/26/18 14:49, Erik Joelsson wrote:

This looks good to me.

Note to other reviewers. This change only applies when concurrency isn't
being set by some other entity. Other entities include the top level
makefiles (typically when running "make test TEST=") or by
setting CONCURRENCY= on the make command line. The reason for this
change is to have the test makefiles themselves provide reasonable
defaults, which is needed when running in our distributed internal test
system. The neat thing about this implementation is the ability to scale
concurrency with a relative number using the concurrency factor.

/Erik


On 2018-01-26 14:44, Christian Tornqvist wrote:

Please review this small change that makes the JDK make test target
use the same method for calculating jtreg concurrency as Hotspot.
Verified locally and in Mach5.

Webrev: http://cr.openjdk.java.net/~ctornqvi/webrev/8196197/webrev.00/


Thanks,
Christian






RFR: JDK-8196108: Add build support for VS 2015/2017

2018-01-26 Thread Erik Joelsson
Oracle is planning on changing the toolchain versions used to produce 
Oracle builds of OpenJDK in JDK 11. As a first step towards changing the 
Windows toolchain versions, I'm implementing the basic support in the 
build system for both recognizing the newer versions of Visual Studio as 
well as generating a portable devkit for them.


With this patch, it becomes possible (but not default) to create a 
configuration using Visual Studio 2015 and 2017. Note though that the 
build will still fail very early on. Fixing all the source code issues 
to get this to work will require a concerted effort from each affected 
component team and will be handled in a series of followup issues. The 
build system support naturally needs to happen first though to enable 
others to proceed.


For now, this patch causes configure to issue warnings if you try to use 
the new versions of Visual Studio as we know it won't actually work.


Bug: https://bugs.openjdk.java.net/browse/JDK-8196108

Webrev: http://cr.openjdk.java.net/~erikj/8196108/webrev.02/

If anyone inside Oracle would like to use the new devkit for 2017, you 
can apply the patch below in addition to the webrev:


diff -r 7e5fbd3a2254 make/conf/jib-profiles.js
--- a/make/conf/jib-profiles.js Mon Jan 22 23:37:23 2018 -0800
+++ b/make/conf/jib-profiles.js Sat Jan 27 00:39:57 2018 +0100
@@ -769,7 +769,7 @@
 macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
 solaris_x64: "SS12u4-Solaris11u1+1.0",
 solaris_sparcv9: "SS12u4-Solaris11u1+1.0",
-    windows_x64: "VS2013SP4+1.0",
+    windows_x64: "VS2017-15.5.5+1.0",
 linux_aarch64: 
"gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux+1.0",
 linux_arm: (input.profile != null && 
input.profile.indexOf("hflt") >= 0
 ? 
"gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0"

@@ -784,8 +784,8 @@
 + "-" + input.build_cpu;

 var freetype_version = {
-    windows_x64: "2.7.1-v120+1.1",
-    windows_x86: "2.7.1-v120+1.1",
+    windows_x64: "2.7.1-v141+1.0",
+    windows_x86: "2.7.1-v141+1.0",
 macosx_x64: "2.7.1-Xcode6.3-MacOSX10.9+1.0"
 }[input.target_platform];