Extra Zero/Shark patches for review

Kurt Miller kurt at intricatesoftware.com
Wed Nov 18 05:18:30 PST 2009


Hi Greg,

Greg Lewis wrote:
> I think that you've divined it was needing to set JAVA_TOOLS_DIR (I'm
> hoping that is temporary -- maybe we can even remove it already?).

When I pulled the new tree down langtools complained about multiple
heads, so I moved it aside and repulled a new one. I forgot to
do the update and I didn't notice because my recursive greps were
finding source in the .hg dir I believe.

I didn't need to set JAVA_TOOLS_DIR to complete the build. My build
script looks like this for OpenBSD:

cd ~/jdk/bsd-port
env -i
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
gmake \
ALT_BOOTDIR=/usr/local/jdk-1.6.0 \
ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \
ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \
ALT_JIBX_LIBS_PATH=$HOME/jdk/jibx/lib \
ANT_HOME=/usr/local \
NO_DOCS=true \
DONT_ENABLE_IPV6="YES" \
DEFAULT_LIBPATH="/usr/lib:/usr/X11R6/lib:/usr/local/lib" \
HOTSPOT_BUILD_JOBS=4 2>&1 | tee -a ~/jdk/bsd-port.log

IIRC jibx isn't needed anymore either, so that may be extraneous.

> Anyway, I'm looking for alternatives before I breakdown and write
> any assembler.  Any suggestions gratefully accepted.
> 

On OpenBSD we continue to use gcc 3.x on most archs since 4.x is
substantially slower on older and slower architectures (among other
reasons). In the cases where custom asm has been written to support
an arch I think we should use it and fall back to the gcc builtins
if gcc is being used.

For example:

>  inline jint Atomic::add(jint add_value, volatile jint* dest) {
> -#ifdef ARM
> -  return arm_add_and_fetch(dest, add_value);
> -#else
> -#ifdef M68K
> -  return m68k_add_and_fetch(dest, add_value);
> -#else
> -  return __sync_add_and_fetch(dest, add_value);
> -#endif // M68K
> -#endif // ARM
> +  atomic_add_int((volatile u_int*) dest, add_value);
> +  return *dest;
>  }

Would look something like:

inline jint Atomic::add(jint add_value, volatile jint* dest) {
#if defined(ARM)
  return arm_add_and_fetch(dest, add_value);
#elif defined(M68K)
  return m68k_add_and_fetch(dest, add_value);
#elif defined(__GNUC__)
  #if defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1
<= __GNUC_MINOR__))
    return __sync_add_and_fetch(dest, add_value);
  #else
    atomic_add_int((volatile u_int*) dest, add_value);
  #endif // GCC ver
#else
  #error "No atomic add implementation"
#endif // GNUC

Does that sound reasonable?

Regards,
-Kurt



More information about the bsd-port-dev mailing list