Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] java(icedtea6) on ARM5: "No such file or directory"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Sat Jun 26, 2010 6:25 am    Post subject: [solved] java(icedtea6) on ARM5: "No such file or direc Reply with quote

Hello all,

This is my first time ever attempting to use Java on Linux at all, so it's quite possible I've just got something simply setup wrong.

I'm basically trying to install Hudson (dev-util/hudson-bin), and so I needed to install Java. After finding out that there is no Sun JRE for ARM without a proper license (found from this bug report), I added the go-orion5x overlay, and icedtea6-bin was pulled in. The emerge for Hudson then went through just fine:
Code:
kuro-pro ~ # emerge -pv dev-util/hudson-bin

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] app-portage/portage-utils-0.3.1  USE="-static" 88 kB [0]
[ebuild  N    ] media-libs/giflib-4.1.6-r1  USE="-X -rle" 495 kB [0]
[ebuild  N    ] app-arch/rpm2targz-9.0.0.4g  5 kB [0]
[ebuild  N    ] dev-java/java-config-wrapper-0.16  8 kB [0]
[ebuild  N    ] dev-java/java-config-2.1.11  60 kB [1]
[ebuild  N    ] dev-java/icedtea6-bin-1.6.2  USE="-X -alsa -doc -examples -nsplugin -source" 35,260 kB [1]
[ebuild  N    ] virtual/jdk-1.6.0  0 kB [1]
[ebuild  N    ] dev-util/hudson-bin-1.362  28,597 kB [2]

Total: 8 packages (8 new), Size of downloads: 64,509 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /var/lib/layman/go-orion5x
 [2] /var/lib/layman/godin

After the emerge finished, I used java-config to set the proper VM location. java-config -L now shows:
Code:
kuro-pro ~ # java-config -L
The following VMs are available for generation-2:
*)      IcedTea6-bin 1.6.2 [icedtea6-bin]

However, Hudson won't start. To put it more correctly, the installed java executables don't even seem to work -- java, javac, javadoc, etc. just show "No such file or directory" when they are run. Which really doesn't make any sense at all, since they are there, and they exist.
Code:
kuro-pro ~ # java-config -J
/opt/icedtea6-bin-1.6.2/bin/java
kuro-pro ~ # ls -l `java-config -J`
-rwxr-xr-x 1 root root 40632 2009-07-25 02:38 /opt/icedtea6-bin-1.6.2/bin/java
kuro-pro ~ # /opt/icedtea6-bin-1.6.2/bin/java
bash: /opt/icedtea6-bin-1.6.2/bin/java: No such file or directory
kuro-pro ~ # file `java-config -J`
/opt/icedtea6-bin-1.6.2/bin/java: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

And here's what strace has to say about it...
Code:
kuro-pro ~ # strace /opt/icedtea6-bin-1.6.2/bin/java
execve("/opt/icedtea6-bin-1.6.2/bin/java", ["/opt/icedtea6-bin-1.6.2/bin/java"...], [/* 36 vars */]) = -1 ENOENT (No such file or directory)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
_llseek(3, 0, 0xbecbbd98, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or dir"..., 40strace: exec: No such file or directory
) = 40
close(3)                                = 0
munmap(0x4001e000, 4096)                = 0
exit_group(1)                           = ?
kuro-pro ~ #

I first thought that perhaps the fact that my kernel didn't have support for user supported binary formats (binfmt_misc) that it wasn't working. However, I added misc support, recompiled a new kernel, rebooted, and am still getting the same error.

If it helps at all, here's my emerge --info:
Code:
Portage 2.1.8.3 (default/linux/arm/10.0, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.29-gentoo armv5tel)
=================================================================
System uname: Linux-2.6.29-gentoo-armv5tel-Feroceon_rev_0_-v5l-with-gentoo-2.0.0
Timestamp of tree: Mon, 07 Jun 2010 05:15:01 +0000
app-shells/bash:     3.2_p48
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.4_p6, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc:       4.1.2, 4.3.3-r2
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="arm-unknown-linux-gnu"
CFLAGS="-Os -march=armv5te -pipe -fomit-frame-pointer"
CHOST="arm-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -march=armv5te -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests collision-protect distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/godin /var/lib/layman/go-orion5x /usr/portage-overlay"
SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
USE="apache2 arm authcram bash-completion bzip2 cjk clamav cli cracklib crypt ctype cups curl cxx dbus dovecot-sasl dso exif expat fam ffmpeg ftp gd gdbm gnutls hpijs iconv imap ithreads javascript jpeg modules mudflap mysql mysqli ncurses nptl nptlonly openmp orion_nas_devices_kurobox_pro pam pcre perl php png pppd python readline samba sasl session sharedext sieve spamassassin spl sqlite ssl subversion swat sysfs tcpd threads threadsafe tiff truetype unicode usb vhosts vim-syntax webdav-neon x264 xinetd xml xorg zip zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif status unique_id userdir" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage sis tdfx trident     voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


I'm really at a total loss here. I've tried to search Google for anything like this, but haven't uncovered anything useful yet.

Any suggestions, thoughts, or ideas of what to test from here would be very welcome. Thanks!

Edit: added [solved] tag.


Last edited by bpoint on Thu Jul 22, 2010 4:51 am; edited 1 time in total
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Sat Jun 26, 2010 9:17 am    Post subject: Reply with quote

maybe it's linked against different libc? I had the same problem with binaries generated with uclibc toolchain, regular system couldn't "see" them ( I had to chroot to use them). you could also compile your own icedtea (there are sourece ebuilds in the tree), that arm machine is probably pretty slow, but it should be done overnight.[/b]
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Sun Jun 27, 2010 6:23 pm    Post subject: Reply with quote

Thanks for the suggestion! Building icedtea from the sources sounds like a good idea.

I've run into a strange problem though, and can't seem to get the java USE flag enabled for dev-java/antlr (one of the required packages). I'm also getting a slot conflict, but I haven't looked into that yet.
Code:
kuro-pro ~ # emerge -pv -1 dev-java/icedtea

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

x11-proto/inputproto:0

  ('ebuild', '/', 'x11-proto/inputproto-2.0', 'merge') pulled in by
    >=x11-proto/inputproto-2.0 required by ('ebuild', '/', 'x11-libs/libXi-1.3', 'merge')

  ('installed', '/', 'x11-proto/inputproto-1.5.0', 'nomerge') pulled in by
    x11-proto/inputproto required by ('ebuild', '/', 'x11-libs/libXtst-1.1.0', 'merge')
    x11-proto/inputproto required by ('ebuild', '/', 'dev-java/icedtea-6.1.7', 'merge')
    x11-proto/inputproto required by ('ebuild', '/', 'x11-libs/libX11-1.3.4', 'merge')

x11-libs/libX11:0

  ('installed', '/', 'x11-libs/libX11-1.1.5', 'nomerge') pulled in by
    >=x11-libs/libX11-1.1.3 required by ('ebuild', '/', 'dev-java/icedtea-6.1.7', 'merge')
    x11-libs/libX11 required by ('ebuild', '/', 'x11-libs/libXtst-1.1.0', 'merge')
    x11-libs/libX11 required by ('ebuild', '/', 'x11-libs/libXp-1.0.0', 'merge')
    (and 1 more)

  ('ebuild', '/', 'x11-libs/libX11-1.3.4', 'merge') pulled in by
    >=x11-libs/libX11-1.1.99.1 required by ('ebuild', '/', 'x11-libs/libXext-1.1.2', 'merge')
    >=x11-libs/libX11-1.3 required by ('ebuild', '/', 'x11-libs/libXi-1.3', 'merge')


It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is also
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously. If such a conflict exists in the
dependencies of two different packages, then those packages can not be
installed simultaneously. You may want to try a larger value of the
--backtrack option, such as --backtrack=30, in order to see if that will
solve this conflict automatically.

For more information, see MASKED PACKAGES section in the emerge man page
or refer to the Gentoo Handbook.


emerge: there are no ebuilds built with USE flags to satisfy "dev-java/antlr:0[java]".
!!! One of the following packages is required to complete your request:
- dev-java/antlr-2.7.7 (Change USE: +java)
(dependency required by "dev-java/jaxme-0.5.2" [ebuild])
(dependency required by "dev-java/dom4j-1.6.1-r3" [ebuild])
(dependency required by "dev-java/jaxen-1.1.1" [ebuild])
(dependency required by "dev-java/jdom-jaxen-1.0-r1" [ebuild])
(dependency required by "dev-java/jdom-1.0-r4" [ebuild])

I originally didn't have java set in my USE flags, but adding it into make.conf and re-emerging didn't seem to help. Even exporting USE="java" on the command line doesn't have any affect either.

If I try to emerge dev-java/antlr directly, emerge shows this:
Code:
kuro-pro ~ # USE="java" emerge -pv -1 =dev-java/antlr-2.7.7

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-java/antlr-2.7.7  USE="cxx python -debug -doc -examples (-java) (-mono) -script -source" 1,774 kB

Total: 1 package (1 new), Size of downloads: 1,774 kB


I don't actually know what Gentoo means with the parentheses around the USE flags, but I'm guessing it means that the user can't change them for some reason. And without the java USE flag set, I can't emerge icedtea. :)

Any suggestions on where to go from here?
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Sun Jun 27, 2010 7:06 pm    Post subject: Reply with quote

Aaah... nevermind. I figured it out. :)

I just remembered I'd dealt with something similar to this a while back -- I needed to force unmask the java USE flag in /etc/profile/use.mask. I'm guessing java is masked by the profile for ARM systems for exactly this reason.

Anyway, I'm still working on unmasking keywords for all of the required packages. I'll deal with the slot conflict once that's finished.
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Thu Jul 22, 2010 4:50 am    Post subject: Reply with quote

This followup post is mostly to help anyone else should they come across a similar problem.

First of all, the reason why the icedtea6 binaries originally didn't work is because they were compiled for the new ARM EABI and not the old legacy ABI (which my current system is using).

Performing the same tests as shown on ArmEabiPort:

Code:
bpoint@kuro-pro ~ $ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
bpoint@kuro-pro ~ $ readelf -h /bin/ls | grep Flags
  Flags:                             0x2, has entry point, GNU EABI

bpoint@kuro-pro ~ $ file /opt/icedtea6-bin-1.6.2/bin/java
/opt/icedtea6-bin-1.6.2/bin/java: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
bpoint@kuro-pro ~ $ readelf -h /opt/icedtea6-bin-1.6.2/bin/java | grep Flags
  Flags:                             0x5000002, has entry point, Version5 EABI


...it's easy to spot the difference.

Incidentally, it's also impossible to compile icedtea from the sources on an old legacy ARM ABI, due to a compile failure in pango (pango is required by gtk+, which is required by icedtea). A similar post can be found here, but the root of the problem is the following structure in pango is not compiled to be 2 bytes in size, but instead 4 bytes:

Code:
struct USHORT {
 char v[2];
}


Looking again at the EABI specification, the problem is that "In particular the minimum size and alignment of a structure was 4 bytes" for the old ABI.

So it just seems that it's not possible to use icedtea at all on a system that uses the legacy ARM ABI.

Hope this helps save someone else some time (and less pulled hair...)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum