hg: bsd-port/bsd-port/hotspot: . OpenBSD nm(1) doesn't have -U or -j, so provide an OpenBSD specific
Jung-uk Kim
jkim at FreeBSD.org
Mon May 5 18:59:32 UTC 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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. :-/
Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)
iQEcBAEBAgAGBQJTZ9+UAAoJEHyflib82/FGoOYH/2Qe91+DwO2ZKwpnDXc1LKwp
ts4LQd6QA+tqc6a4ZZkojf7l6YxcbOJqq8/G55C/7/Y/1Bal9+s6PfAQco4etcxb
/Pm1AsXW0puuhsNPpm6rF0/YvFOrFPj+XBVQC0hvj5SQRr5uE/9cZzfs8VMU/d/E
EkJ3aZ5KdzWgXQ4xR4ZQW6psps82adIIbIRdCt7cFAL4cKM7aLwRZS64fCdkHcJa
kXnKYzu/xp+6pB8Rw0rP28KNbwdfDjxaJVUaCpP1/nyNdMIbVBKXIVOfxAhzzn2b
WNvBo/u3UU4zICTpCEwKw3VlbfMNwRUV7OfjqfxryL7mY9ESSH35461Yj0nUfTg=
=W60y
-----END PGP SIGNATURE-----
More information about the bsd-port-dev
mailing list