Bug 63693 - Forced 32 bits java VM even bulding the SDK for a x64 target
Summary: Forced 32 bits java VM even bulding the SDK for a x64 target
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:4.1.0 target:3.6.7 target:4.0.4
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 18:10 UTC by Javier Fernández
Modified: 2013-04-19 23:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernández 2013-04-18 18:10:25 UTC
PRECONDITIONS:

* OS: Ubuntu Quantal Linux x64
* Libreoffice: "master" branch
* Java: 
  - java version "1.7.0_21"
  - Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
  - Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
* Configure flags: 
--with-system-libs --enable-debug --enable-odk \
--with-jdk-home=~/java/default \
--with-ant-home=~/java/apache-ant-1.9.0/ --disable-kde --disable-kde4 \
--disable-kdeab --disable-epm --disable-mathmldtd --disable-gnome-vfs \
--disable-tde --disable-tdeab --disable-postgresql-sdbc \
--disable-ext-wiki-publisher --disable-ext-report-builder \
--disable-scripting-beanshell --disable-scripting-javascript \
--without-system-graphite --without-system-mdds --without-system-vigra \
--without-myspell-dicts --without-system-odbc --without-system-npapi-headers \
--without-system-sane --without-system-openldap --without-system-clucene \
--without-system-libmspub --without-system-libcmis --without-system-orcus \
--without-system-lpsolve --without-system-liblangtag --without-system-libmwaw \
--without-ppds --without-afms --without-krb5 --without-junit --without-gssapi

STEPS LEADING TO THE ISSUE:

1- Go to the sdk examples java folder (DocumentHandling, for instance) and build them just typing "make".
2- Execute any of the examples ("make DocumentLoader.run", for instance)

EXPECTED RESULTS:

The example is executed correctly, in this case, loading the test document.

ACTUAL OUTCOMES:

The example logs the following info:

mkdir -p ~/libreoffice4.0_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files
"~/java/default/bin/java" -d32 -Dcom.sun.star.lib.loader.unopath="~/libo.git/install//program" -jar ~/libreoffice4.0_sdk/LINUXexample.out/class/JavaDocumentHandlingExamples/DocumentConverter.jar "./test" "MS Word 97" "doc" "~/libreoffice4.0_sdk/LINUXexample.out/misc/JavaDocumentHandlingExamples/converted_files"
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
make: *** [DocumentConverter.run] Error 1
Comment 1 Javier Fernández 2013-04-18 18:30:16 UTC
My first impression is that the java option -d32 shouldn't be used in this scenario, except if it's mandatory to use a 32 bits Java VM for technical reasons. 

The Makefile's $(SDK_JAVA) environment variable is resolved by the odk/settings/std.mk file, as follows:

SDK_JAVA="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/java" $(JAVA_OPTIONS)

There is a test in the std.mk to check out the java VM arch target, which adds the -d32 option to the JAVA_OPTIONS variable in case of 64 bits arch. 

JAVA_OPTIONS=
ifneq "$(OO_SDK_JAVA_HOME)" ""
JAVA_BITS := $(shell $(OO_SDK_JAVA_HOME)/$(JAVABIN)/java -version 2>&1 | tail -1 | cut -d " " -f3)
ifeq "$(JAVA_BITS)" "64-Bit"
JAVA_OPTIONS=-d32
endif
endif

I guess this test is based on the assumption that the SDK was build for a 32 bit target, even using a 64 bits OS. I think it should also take into account the SDK build target, since LO should work fine as well on 64 bit architectures.
Comment 2 Javier Fernández 2013-04-18 18:39:15 UTC
Assigned to Stephan Bergman, since we have already talked about the issue.
Comment 3 Commit Notification 2013-04-19 07:38:23 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=391477d40ea718c46089e16484726dba085a6ad8

fdo#63693 Do not force java -d32 for a 64-bit SDK



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Javier Fernández 2013-04-19 07:52:06 UTC
so, I guess this bug is CONFIRMED and ASSIGNED.
Comment 5 Javier Fernández 2013-04-19 07:53:46 UTC
Added Andrés Gómez to the CC list of this bug.
Comment 6 Stephan Bergmann 2013-04-19 11:46:30 UTC
Requested backports to libreoffice-4-0 towards LO 4.0.4 (<https://gerrit.libreoffice.org/#/c/3480/>) and libreoffice-3-6 towards LO 3.6.7 (<https://gerrit.libreoffice.org/#/c/3481/>).

CC'ing Rene and Björn, apparently of more interest to Debian/Ubuntu than Fedora distros.
Comment 7 Commit Notification 2013-04-19 12:47:01 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0d243a4452acc2a4672901e2782617b82aa135d4&h=libreoffice-3-6

fdo#63693 Do not force java -d32 for a 64-bit SDK


It will be available in LibreOffice 3.6.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2013-04-19 12:47:19 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bcebecda16cb8783a720a2bcaff7a74e279c866b&h=libreoffice-4-0

fdo#63693 Do not force java -d32 for a 64-bit SDK


It will be available in LibreOffice 4.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Javier Fernández 2013-04-19 23:34:29 UTC
I've verified the bug is fixed in master branch.