Skip to main content

Linker error with mr2-dev-b26 on/for Linux: runMidlet_g

3 replies [Last post]
kkleine
Offline
Joined: 2007-10-25
Points: 0

Hi,

I'm trying to compile "phoneme_feature-mr2-rel-src-b23-08_may-2007.zip" on my machine (build+target). I also tried this SVN build "svn checkout https://phoneme.dev.java.net/svn/phoneme/builds/phoneme_feature-mr2-dev-... phoneme --username guest" and got the same problems

SYSTEM: Linux newyork 2.6.20-16-386 #2 Sun Sep 23 19:47:10 UTC 2007 i686 GNU/Linux
GCC: gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
JDK: 1.4.2_16

Here is the build script I wrote to compile PCSL, CLDC and MIDP. Sometimes I have to call the script twice for each component I want to build (PCSL, CLDC). But the MIDP never builds (see error report at the bottom). I also had to uncomment a "EXTRA_CFLAGS += -Werror" to get MIDP compile at least have the way. Also, please note, that I didn't edit any configuration file.

==================================================
==================================================
==================================================

#!/bin/bash

###########################################################
# Purpose: Install phoneME feature on i386 Linux as
# build and target machine.
# This script installs PCSL, CLDC, and the
# phoneME feature (=open source J2ME version)
# to this directory
# $HOME/phoneme/build
#
# Precondition: You should have downloaded phoneME feature
# from https://phoneme.dev.java.net/ and
# unzipped somewhere.
# (This script has been tested with MR2.)
# You'll also need a JDK 1.4.x installation.
#
# Issues: I have to add '#' to comment out
# EXTRA_CFLAGS += -Werror in file
# $MEHOME/midp/build/common/makefiles/gcc.gmk
# line 122.
#
# Usage: Adjust the JAVA_HOME export in this script
# to point to your JDK installation.
# Run this script in the directory
# to which you unzipped phoneme.
# A phoneme_feature directory must be
# present. To build pcsl, pcsl-doc, cldc
# or midp just pass the component name
# in lowercase letters to the script.
#
# Author: kkleine
#
# Date: 10/25/2008
#
# Version: 1.0
###########################################################

#==========================================================
# Adjust this path to point to your JDK 1.4.x installation
#==========================================================
export JAVA_HOME=/usr/lib/jvm/j2sdk1.4.2_16/

# NO CONFIGURATION NEEDED BELOW THIS LINE #################

#==========================================================
# Setup some environment variables and create dirs.
#==========================================================
export MEHOME=`pwd`/phoneme_feature
export LOG=`pwd`/log.txt
export BUILD_OUTPUT_DIR=`pwd`/build
export PATH=$JDK_DIR/bin:$PATH
export PCSL_PLATFORM=linux_i386_gcc
if ! [ -d $BUILD_OUTPUT_DIR ]
then
mkdir $BUILD_OUTPUT_DIR
fi

#==========================================================
# Figure out which component to build
#==========================================================
COMPONENT="none"

if [ $# -ne 0 ]
then
COMPONENT=$1
fi

#==========================================================
# Build PCSL
#==========================================================
if [ "$COMPONENT" = "pcsl" ]
then
cd $MEHOME/pcsl &&\
make ENABLE_PCSL=true \
NETWORK_MODULE=bsd/generic \
PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
USE_DEBUG=false
fi

#==========================================================
# Build PCSL documentation
#==========================================================
if [ "$COMPONENT" = "pcsl-doc" ]
then
cd $MEHOME/pcsl &&\
make doc
fi

#==========================================================
# Build CLDC
#==========================================================
if [ "$COMPONENT" = "cldc" ]
then
cd $MEHOME/cldc/build/linux_i386 &&\
make ENABLE_PCSL=true \
JVMWorkSpace=$MEHOME/cldc \
JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc \
PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
ENABLE_ISOLATES=true \
JDK_DIR=$JAVA_HOME \
ENABLE_JAVA_DEBUGGER=true \
ENABLE_SYSTEM_CLASSES_DEBUG=true \
ENABLE_ROM_JAVA_DEBUGGER=true \
USE_DEBUG=true
fi

#==========================================================
# Build phoneME feature (open source compliant to Java
# Wireless Toolkit)
#==========================================================
if [ "$COMPONENT" = "midp" ]
then
cd $MEHOME/midp/build/linux_fb_gcc &&\
make PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
CLDC_DIST_DIR=$BUILD_OUTPUT_DIR/cldc/linux_i386/dist \
TOOLS_DIR=$MEHOME/tools \
TARGET_CPU=i386 \
JDK_DIR=$JAVA_HOME \
USE_MULTIPLE_ISOLATES=true \
MIDP_OUTPUT_DIR=$BUILD_OUTPUT_DIR/midp \
USE_DEBUG=true \
USE_JAVA_DEBUGGER=true
fi

echo
echo "======================================"
echo "FINISHED"
echo

==================================================
==================================================
==================================================

Here is the error I got (sorry, it's in German):

==================================================
==================================================
==================================================

Produce raw image: /home/kkleine/phoneme/build/midp/appdb/trustedmidlet_icon.raw
Produce raw image: /home/kkleine/phoneme/build/midp/appdb/splash_screen_176x210.
raw
Produce raw image: /home/kkleine/phoneme/build/midp/appdb/splash_screen_210x176.
raw
exporting parameter values to /home/kkleine/phoneme/build/midp/Settings.gmk ...
created /home/kkleine/phoneme/build/midp/Settings.gmk
... /home/kkleine/phoneme/build/midp/obj_g/i386/runMidlet.o
... linking /home/kkleine/phoneme/build/midp/bin/i386/runMidlet_g
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c08): undefined reference to `Java_com_sun_midp_links_Link_close'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c14): undefined reference to `Java_com_sun_midp_links_Link_finalize'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c20): undefined reference to `Java_com_sun_midp_links_Link_init0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c2c): undefined reference to `Java_com_sun_midp_links_Link_isOpen'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c38): undefined reference to `Java_com_sun_midp_links_Link_receive0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2c44): undefined reference to `Java_com_sun_midp_links_Link_send0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2cc8): undefined reference to `Java_com_sun_midp_links_LinkPortal_getLink
Count0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2cd4): undefined reference to `Java_com_sun_midp_links_LinkPortal_getLink
s0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(nativeFunctionTable.o):(.ro
data+0x2ce0): undefined reference to `Java_com_sun_midp_links_LinkPortal_setLink
s0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25ba
0): undefined reference to `Java_com_sun_midp_links_Link_init0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25be 0): undefined reference to `Java_com_sun_midp_links_Link_receive0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25c0 0): undefined reference to `Java_com_sun_midp_links_Link_send0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25c4 8): undefined reference to `Java_com_sun_midp_links_LinkPortal_getLinkCount0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25c6 8): undefined reference to `Java_com_sun_midp_links_LinkPortal_getLinks0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x25c8 8): undefined reference to `Java_com_sun_midp_links_LinkPortal_setLinks0'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x57fa 0): undefined reference to `Java_com_sun_midp_links_Link_close'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x57fc 0): undefined reference to `Java_com_sun_midp_links_Link_isOpen'
/home/kkleine/phoneme/build/midp/obj_g/i386/libobj.a(ROMImage.o):(.rodata+0x5808 c): undefined reference to `Java_com_sun_midp_links_Link_finalize'
collect2: ld gab 1 als Ende-Status zurück
make: *** [/home/kkleine/phoneme/build/midp/bin/i386/runMidlet_g] Fehler 1

======================================
FINISHED

==================================================
==================================================
==================================================

Do I have to build using a GCC 3 or are there any failures in my script?

Kind regards
kkleine

The line to comment out was 122 and not 166.
Corrected filepath: $MEHOME/midp/build/common/makefiles/gcc.gmk

Added the correct error report.

Message was edited by: kkleine

Message was edited by: kkleine

Modified the script, so that it expects a "phoneme_feature" directory in the directory from where you execute the script.

Message was edited by: kkleine

Message was edited by: kkleine

Message was edited by: kkleine

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kkleine
Offline
Joined: 2007-10-25
Points: 0

The script works for compiling phoneME on linux as build and target machine.

psharma_123
Offline
Joined: 2007-10-22
Points: 0

hi,

try with gcc-3.3. I also faced some problem with 4.0.

Regards,

psharma

kkleine
Offline
Joined: 2007-10-25
Points: 0

Thank you for your answer. Meanwhile I successfully compiled the sources using gcc-4.0 . The only change I had to make was to uncomment the [b]EXTRA_CFLAGS=-Werror[/b] in MIDP's [b]gcc.gmk[/b] file.

Here is my script. Call [b]./script COMPONENT TARGET_PLATFORM[/b] where [b]COMPONENT[/b] can be either [b]pcsl, pcsl-doc, clcd, cldc-doc or midp[/b]. [b]TARGET_PLATFORM[/b] can be either [b]i386[/b] or [b]arm[/b].

#!/bin/bash

#==========================================================
# Adjust this path to point to your JDK 1.4.x installation
#==========================================================
export JAVA_HOME=$HOME/j2sdk1.4.2_16/

# NO CONFIGURATION NEEDED BELOW THIS LINE #################

#==========================================================
# Figure out which component to build for which platform
#==========================================================
COMPONENT="none"
TARGET_PLATFORM="i386"

if [ $# -eq 1 ]
then
COMPONENT=$1
fi

if [ $# -eq 2 ]
then
TARGET_PLATFORM=$2
fi

#==========================================================
# Setup some environment variables and create dirs.
#==========================================================
export MEHOME=`pwd`/phoneme_feature
export LOG=`pwd`/log.txt
export BUILD_OUTPUT_DIR=`pwd`/build-$TARGET_PLATFORM
export JDK_DIR=$JAVA_HOME
export PATH=$JDK_DIR/bin:$PATH

if [ "$TARGET_PLATFORM" = "arm" ]
then
export PCSL_PLATFORM=linux_arm_gcc
else
export PCSL_PLATFORM=linux_i386_gcc
fi

if ! [ -d $BUILD_OUTPUT_DIR ]
then
mkdir $BUILD_OUTPUT_DIR
fi

#==========================================================
# Build PCSL
#==========================================================
if [ "$COMPONENT" = "pcsl" ]
then
export PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl
cd $MEHOME/pcsl

if [ "$TARGET_PLATFORM" = "i386" ]
then
make NETWORK_MODULE=bsd/generic
# cd $MEHOME/pcsl &&\
# make ENABLE_PCSL=true \
# NETWORK_MODULE=bsd/generic \
# PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
# USE_DEBUG=false
else
make NETWORK_MODULE=bsd/qte GNU_TOOLS_DIR=$MONTAVISTA
fi
fi

#==========================================================
# Build PCSL documentation
#==========================================================
if [ "$COMPONENT" = "pcsl-doc" ]
then
cd $MEHOME/pcsl &&\
make doc
fi

#==========================================================
# Build CLDC
#==========================================================
if [ "$COMPONENT" = "cldc" ]
then
export JVMWorkSpace=$MEHOME/cldc
export JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc

if [ "$TARGET_PLATFORM" = "i386" ]
then
cd $JVMWorkSpace/build/linux_i386
make ENABLE_PCSL=true \
PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
ENABLE_ISOLATES=true
# cd $MEHOME/cldc/build/linux_i386 &&\
# make ENABLE_PCSL=true \
# JVMWorkSpace=$MEHOME/cldc \
# JVMBuildSpace=$BUILD_OUTPUT_DIR/cldc \
# PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
# ENABLE_ISOLATES=true \
# JDK_DIR=$JAVA_HOME \
# ENABLE_JAVA_DEBUGGER=true \
# ENABLE_SYSTEM_CLASSES_DEBUG=true \
# ENABLE_ROM_JAVA_DEBUGGER=true \
# USE_DEBUG=true
else
cd $JVMWorkSpace/build/linux_arm
make ENABLE_PCSL=true \
PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
ENABLE_ISOLATES=true \
GNU_TOOLS_DIR=$MONTAVISTA
fi
fi

#==========================================================
# Build CLDC documentation
#==========================================================
if [ "$COMPONENT" = "cldc-doc" ]
then
export JVMWorkSpace=$MEHOME/cldc
cd $JVMWorkSpace/build/linux_i386
make docs_html
fi

#==========================================================
# Build MIDP
#==========================================================
if [ "$COMPONENT" = "midp" ]
then
export MIDP_OUTPUT_DIR=$BUILD_OUTPUT_DIR/midp

if [ "$TARGET_PLATFORM" = "i386" ]
then
cd $MEHOME/midp/build/linux_fb_gcc
make PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
CLDC_DIST_DIR=$BUILD_OUTPUT_DIR/cldc/linux_i386/dist \
TOOLS_DIR=$MEHOME/tools \
TARGET_CPU=i386 \
USE_MULTIPLE_ISOLATES=true
#cd $MEHOME/midp/build/linux_fb_gcc &&\
# make PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
# CLDC_DIST_DIR=$BUILD_OUTPUT_DIR/cldc/linux_i386/dist \
# TOOLS_DIR=$MEHOME/tools \
# TARGET_CPU=i386 \
# JDK_DIR=$JAVA_HOME \
# USE_MULTIPLE_ISOLATES=true \
# MIDP_OUTPUT_DIR=$BUILD_OUTPUT_DIR/midp \
# USE_DEBUG=true \
# USE_JAVA_DEBUGGER=true
else
make PCSL_OUTPUT_DIR=$BUILD_OUTPUT_DIR/pcsl \
CLDC_DIST_DIR=$BUILD_OUTPUT_DIR/cldc/linux_arm/dist \
TOOLS_DIR=$MEHOME/tools \
TARGET_CPU=arm \
USE_MULTIPLE_ISOLATES=true \
GNU_TOOLS_DIR=$MONTAVISTA
fi
fi

echo
echo "======================================"
echo "FINISHED"
echo