Hi Waldemar,

sorry for the delay, here are some comments on your patch:

On 2011-08-31 9:26 PM, Waldemar Brodkorb wrote:
Hello OpenWrt developers,

I would like to contribute a OpenJDK 6 package.
Attached is my first shot with svn diff.

The patch contains following changes:
- new tools to build a OpenJDK bootstrap for the host including Qemu
   for special actions when cross-compiling OpenJDK later
- two packages as prerequisite (libXinerama, libXp) for OpenJDK
- a patch for libffi package, to fix the wrong include path given
   by the pkg-config script
- a patch for uClibc to resolve $ORIGIN in RPATH
- the openjdk package

Open issues:

1.) gcc/g++ binaries in toolchain

OpenJDK uses the variable ALT_COMPILER_PATH to find the cross-compiler in
short form (gcc/g++). But when using the compiler from 
$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/bin
g++ fails, because a wrong relative path to cc1plus is used. As a
workaround I copy the binaries to the parent directory and everything compiles 
fine:
staging_dir/toolchain-i386_gcc-4.5-linaro_uClibc-0.9.32/i486-openwrt-linux-uclibc/bin$
 cp * ..
How to solve this in a smarter acceptable way?
How about creating something that matches the expected structure for OpenJDK within its PKG_BUILD_DIR by using hard links or symlinks? I'd like to avoid having package specific workarounds in the structure of the toolchain dir.

2.) $ORIGIN in RPATH

The java binary uses following to find dependent libraries:
Dynamic Section:
   NEEDED               libz.so.1
   NEEDED               libpthread.so.0
   NEEDED               libjli.so
   NEEDED               libdl.so.2
   NEEDED               libc.so.6
   SONAME               lib.so
   RPATH                $ORIGIN/../lib/i386/jli:$ORIGIN/../jre/lib/i386/jli

But uClibc does not support $ORIGIN. It is a patch for uClibc included, which
adds support for $ORIGIN. It is fetched from here:
http://www.mail-archive.com/[email protected]/msg06444.html
The patch seems a bit intrusive and it apparently wasn't merged upstream. Could we not change the linker command to use absolute paths for RPATH instead of using $ORIGIN?

3.) package dependencies

When activating the package dependencies, DISPLAY_SUPPORT is automatically 
added and
I can't choose the package for Routerboard 532 or Alix 2. Java is headless 
useful, but
requires X11 to compile (for the optional AWT).
How can I fix this?
Can't we just add a patch to OpenJDK making compiling of AWT, SWING, etc. optional?

4.) host dependencies for bootstrap openjdk

How to handle this? OpenJDK requires alsa and other x11 related stuff
to compile on the host. Should any prerequisite checks be implemented? Where is 
the
right place to add them?
You can add packages that build the required host components. I'd like to avoid adding prereq checks that make the build less portable.

5.) recompile issues in tools

The gcc package is always recompiled, when the tools compile is not
completely finished. It is just annoying, when adding or debugging tools.
Odd, I've never seen that on any of my systems.

- Felix

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to