hg: bsd-port/bsd-port/hotspot: . OpenBSD nm(1) doesn't have -U or -j, so provide an OpenBSD specific

Kurt Miller kurt at intricatesoftware.com
Mon May 5 21:16:23 UTC 2014


On Mon, 2014-05-05 at 16:12 -0400, Jung-uk Kim wrote:
> On 2014-05-05 14:59:32 -0400, ?? wrote:
> 2014년  5월  5일 14:59, Jung-uk Kim 쓴 글:> On 2014-05-05 13:27:44
> -0400, ?? wrote:
> >> On 2014-05-05 13:05:56 -0400, ?? wrote:
> >>> On Mon, 2014-05-05 at 12:42 -0400, Jung-uk Kim wrote:
> >>>> On 2014-05-05 02:37:38 -0400, ?? wrote:
> >>>>> Hi,
> >>>>> 
> >>>>> Thus wrote kurt at intricatesoftware.com 
> >>>>> (kurt at intricatesoftware.com):
> >>>>> 
> >>>>>> . OpenBSD nm(1) doesn't have -U or -j, so provide an 
> >>>>>> OpenBSD specific
> >>>>> 
> >>>>> neither have NetBSD's nor FreeBSD's. Generalization would
> >>>>> be appreciated.
> >>>> 
> >>>> FYI, this is what I did in FreeBSD port for jdk8.
> >>>> 
> >>>> /head/java/openjdk8/files/patch-bsd?revision=352721&view=markup#l155
> >>>>
> >>>>
> >>>>
> >
> >>>> 
> >>>> 
> > Jung-uk Kim
> > 
> >>> Thanks. OpenBSD doesn't have --defined-only. I believe the 
> >>> following change will work for *BSD:
> > 
> >> I see.
> > 
> >>> diff -r 0d6f95e05945 make/bsd/makefiles/build_vm_def.sh --- 
> >>> a/make/bsd/makefiles/build_vm_def.sh	Mon Apr 28 12:29:31 2014 
> >>> -0400 +++ b/make/bsd/makefiles/build_vm_def.sh	Mon May 05 
> >>> 12:50:51 2014 -0400 @@ -7,7 +7,10 @@ NM=nm fi
> > 
> >>> -if [ `uname` == "OpenBSD" ] ; then
> > 
> >> Please note '==' is a Linuxism/Bashism.  '=' is Posixly-correct 
> >> equivalent.
> > 
> >>> +OS_NAME=`uname -s` +BSD_OS=${OS_NAME##${OS_NAME%BSD}} + +if [
> >>>  "$BSD_OS" == "BSD" ] ; then $NM $* \ | awk '{ if ($2 != "U")
> >>> if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";"
> >> ...
> > 
> >> This file is just for *BSDs and Mac but Mac's toolchains are 
> >> always special.  Therefore, Darwin should be specialized, not 
> >> ours.
> > 
> >> Also, I am not sure why 'if ($2 != "U")' was repeated three
> >> times. awk(1) is not that dumb. ;-)
> > Actually, I realized it won't work for FreeBSD because the field 2
> > is not always a symbol type.
> > 
> > % nm -V GNU nm 2.17.50 [FreeBSD] 2007-07-03 Copyright 2007 Free
> > Software Foundation, Inc. This program is free software; you may
> > redistribute it under the terms of the GNU General Public License.
> > This program has absolutely no warranty. % nm mknodes.o U __error U
> > __isthreaded 0000000000000f50 t __sputc U __stderrp U __stdinp U
> > __swbuf 00000000000069d0 b curstr 0000000000000b00 t error ... % nm
> > mknodes.o | awk '{print $2}' __error __isthreaded t __stderrp 
> > __stdinp __swbuf b t ...
> > 
> > In fact, it is always $1 because undefined symbol does not have an 
> > address. :-/
> 
> It seems OpenBSD is the only one requiring the hack and working with
> it and other *BSDs seem to have '--defined-only' or '-U' option.
> Therefore, I am going to commit the following for my jdk8 port later.
> 
> https://redports.org/changeset/26342/#file1

Thanks... very busy day here at work. Your point about undefined not
being the second field also applies to OpenBSD. Please go ahead with
your change and I'll fix OpenBSD's section when I get free again.

Regards,
-Kurt



More information about the bsd-port-dev mailing list