More Problems Compiling JVM From Source

My group is trying to compile Java 1.5 from source on RedHat 7.3, following directions from someone who managed to successfully compile it. (Previous attempts to compile it on Advanced Server 2.1 have so far not borne fruit.) We're getting the following error, but can't track down what might be going wrong.

We've got gcc (and g++) version 3.2.1 installed in /usr/local/bin, and have set the ALT_COMPILER_PATH accordingly. libstdc++.so is in LD_LIBRARY_PATH. We're not sure where else to look for the possible problem; none of the other environment variables seem like they'd be relevant, and we think we've set them correctly for our installation. Googling for similar errors suggests that this is normally something you'd see when compiling c++ files with gcc instead of g++,

but presumably the problem is in our configuration somewhere, and not in the makefiles.

I'm happy to answer any other questions that might clarify the issue.

Thanks,

Ariel

make[2]: Entering directory `/root/jdk/control/build/linux-i586/hotspot-i586/tmp/linux_i486_compiler2/product'

make[3]: Entering directory `/root/jdk/control/build/linux-i586/hotspot-i586/tmp/linux_i486_compiler2/product'

Making adlc

../generated/adfiles/filebuff.o: In function `printline(ostream &,charconst *, int,charconst *, int,int)':

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:160: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:160: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:160: undefined reference to `ostream::operator<<(int)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:160: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:144: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:147: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:170: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:170: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:170: undefined reference to `ostream::operator<<(int)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:170: undefined reference to `ostream::operator<<(charconst *)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:144: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:147: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:179: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:144: undefined reference to `ostream::operator<<(char)'

/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:144: undefined reference to `ostream::operator<<(char)'

../generated/adfiles/filebuff.o:/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:147: more undefined references to `ostream::operator<<(char)' follow

../generated/adfiles/filebuff.o: In function `FileBuffRegion::print(ostream &)':/root/jdk/hotspot/src/share/vm/adlc/filebuff.cpp:255: undefined reference to `ostream::operator<<(char const *)'

collect2: ld returned 1 exit status

make[3]: *** [../generated/adfiles/adlc] Error 1

make[3]: Leaving directory `/root/jdk/control/build/linux-i586/hotspot-i586/tmp/linux_i486_compiler2/product'

make[2]: *** [ad_stuff] Error 2

make[2]: Leaving directory `/root/jdk/control/build/linux-i586/hotspot-i586/tmp/linux_i486_compiler2/product'

make[1]: *** [product] Error 2

make[1]: Leaving directory `/root/jdk/control/build/linux-i586/hotspot-i586/tmp'make: *** [product] Error 2

[5574 byte] By [ariel_segalla] at [2007-10-3 2:02:51]
# 1
see http://forum.java.sun.com/thread.jspa?forumID=37&threadID=754933-kto
kellyohaira at 2007-7-14 19:01:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Hi,

I have been trying to compile the jvm source code on red hat 9. The following errors have been bothering me. Do I need to install gcc 3.2.2. for this version of linux? What about the remaning environment variables? I will post the errors here

linux i586 1.5.0-internal build started: 06-08-19 20:34

if [ -r ./../../deploy/make/Makefile ]; then \

( cd ./../../deploy/make; make sanity EXTERNALSANITYCONTROL=true CONTROL_TOPDIR=/root/control CONTROL_TOPDIR_NAME=control ALT_OUTPUTDIR=/root/control/build/linux-i586 ARCH_DATA_MODEL=32 MILESTONE=internal BUILD_NUMBER=user_19_aug_2006_20_34 ; ); \

fi

make[1]: Entering directory `/root/deploy/make'

make[1]: Leaving directory `/root/deploy/make'

make[1]: Entering directory `/root/j2se/make'

make[1]: Leaving directory `/root/j2se/make'

if [ -r ./../../install/make/Makefile ]; then \

( cd ./../../install/make; make sanity MAKEFLAGS= EXTERNALSANITYCONTROL=true

ALT_CONTROL_TOPDIR=/root/control ALT_J2SE_TOPDIR=/root/j2se ALT_OUTPUTDIR=/root/control/build/linux-i586 ALT_RTPATCH_DIR= ALT_BASE_IMAGE_ZIP= ALT_BASE_IMAGE_DIR= ALT_NEW_IMAGE_DIR= ALT_BUNDLE_DATE=19_aug_2006 ; ); \

fi

make[1]: Entering directory `/root/install/make'

make[1]: Leaving directory `/root/install/make'

Build Machine Information:

build machine = localhost.localdomain

Build Directory Structure:

CWD = /root/control/make

TOPDIR = ./../..

CONTROL_TOPDIR = ./../../control

HOTSPOT_TOPDIR = ./../../hotspot

J2SE_TOPDIR = ./../../j2se

MOTIF_TOPDIR = ./../../motif

DEPLOY_TOPDIR = ./../../deploy

INSTALL_TOPDIR = ./../../install

External File/Binary Locations:

PREVIOUS_JRE_BUNDLE = /java/re/j2se/1.4.2/archive/fcs/bundles/linux-i586/j2re-1_4_2-linux-i586.tar.gz

PREVIOUS_JDK_BUNDLE = /java/re/j2se/1.4.2/archive/fcs/bundles/linux-i586/j2sdk-1_4_2-linux-i586.tar.gz

Build Directives:

BUILD_HOTSPOT = true

BUILD_MOTIF= true

BUILD_INSTALL = true

Hotspot Settings:

HOTSPOT_BUILD_JOBS =

Bootstrap Settings:

JAVAWS_BOOTDIR = /root/control/build/linux-i586

BOOTSTRAP J2SDK VERSION:

OUTPUTDIR = /root/control/build/linux-i586

Build Tool Settings:

UNIXCOMMAND_PATH = /bin/

COMPILER_PATH = /usr/bin/

DEVTOOLS_PATH = /java/devtools/linux/bin/

USRBIN_PATH = /usr/bin/

GCC29_COMPILER_PATH = /usr/bin/

MOZILLA_PATH = /java/devtools

MOZILLA_HEADERS_PATH = /home/user/share/plugin/mozilla_headers_ns7/

CC_VER = 3.2.2

PATH = /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/user/bin

Build Directives:

PEDANTIC =

INSANE =

Build Platform Settings:

PLATFORM = linux

ARCH = i586

LIBARCH = i386

ARCH_FAMILY = i586

ARCH_DATA_MODEL = 32

RH_VERSION = release 9

OS_VERSION = 2.4.20-8

FREE_SPACE = 7243172

GNU Make Settings:

MAKE = make

MAKE VERSION = 3.79.1,

MAKECMDGOALS = sanity

MAKEFLAGS = w -- BUILD_NUMBER=user_19_aug_2006_20_34 MILESTONE=internal ARCH_DATA_MODEL=32 ALT_OUTPUTDIR=/root/control/build/linux-i586 CONTROL_TOPDIR_NAME=control CONTROL_TOPDIR=/root/control EXTERNALSANITYCONTROL=true

SHELL = /bin/sh

Target Build Versions:

JAVAWS_VERSION = 1.5.0

MILESTONE = internal

BUILD_NUMBER = user_19_aug_2006_20_34

Bootstrap Settings:

BOOTDIR = /java/re/j2se/1.4.2/archive/fcs/binaries/linux-i586

BOOTSTRAP J2SDK VERSION:

OUTPUTDIR = /root/control/build/linux-i586

Build Tool Settings:

UNIXCOMMAND_PATH = /bin/

COMPILER_PATH = /usr/bin/

DEVTOOLS_PATH = /java/devtools/linux/bin/

USRBIN_PATH = /usr/bin/

MOTIF_DIR = /root/control/build/linux-i586/motif-i586

CC_VER = 3.2.2

ZIP_VER = 2.3

PATH = /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/user/bin

TMPDIR = /root/control/build/linux-i586/tmp

Build Directives:

USE_ONLY_BOOTDIR_TOOLS =

USE_HOTSPOT_INTERPRETER_MODE =

PEDANTIC =

DEV_ONLY =

J2RE_ONLY =

NO_DOCS =

NO_IMAGES =

TOOLS_ONLY =

INSANE =

PARALLEL_COMPILES = false

PARALLEL_COMPILE_JOBS = 2

FASTDEBUG = false

INCREMENTAL_BUILD = false

Build Platform Settings:

PLATFORM = linux

ARCH = i586

LIBARCH = i386

ARCH_FAMILY = i586

ARCH_DATA_MODEL = 32

LINUX_VERSION = release 9

OS_VERSION = 2.4.20-8

ALSA_VERSION =

FREE_SPACE = 7243164

GNU Make Settings:

MAKE = make

MAKE VERSION = 3.79.1,

MAKECMDGOALS = sanity

MAKEFLAGS =

SHELL = /bin/sh

Target Build Versions:

JDK_VERSION = 1.5.0

MILESTONE = internal

BUILD_NUMBER = user_19_aug_2006_20_34

External File/Binary Locations:

HOTSPOT_SERVER_PATH = /root/control/build/linux-i586/hotspot-i586/server

HOTSPOT_CLIENT_PATH = /root/control/build/linux-i586/hotspot-i586/client

HOTSPOT_IMPORT_PATH = /root/control/build/linux-i586/hotspot-i586/import

MOTIF_DIR = /root/control/build/linux-i586/motif-i586

CACERTS_FILE = ./../src/share/lib/security/cacerts

No setting required for Unix Systems

WARNING: You are using an unsupported release of Linux.

The supported version is Red Hat Linux release Advanced Server release

2.1AS.

Your release is version release 9

WARNING: You are using an unsupported release of Linux.

The supported version is Red Hat Linux release Advanced Server release

2.1AS.

Your release is version release 9

ERROR: You do not have a valid DEVTOOLS_PATH setting.

Please check your access to

/java/devtools/linux/bin/

and/or check your value of ALT_DEVTOOLS_PATH.

ERROR: The Linux GCC compiler must be version 3.2.1-7a.

You are using the following compiler version: 3.2.2

The compiler was obtained from the following location:

/usr/bin/

Please change your compiler.

ERROR: You do not have access to valid Mozilla header files.

Please check your access to

/home/user/share/plugin/mozilla_headers_ns7//mozilla_headers_ns7/bool.h

and/or check your value of ALT_MOZILLA_PATH, ALT_MOZILLA_HEADERS_PATH,

ERROR: You do not have a valid DEVTOOLS_PATH setting.

Please check your access to

/java/devtools/linux/bin/

and/or check your value of ALT_DEVTOOLS_PATH.

ERROR: The Linux GCC compiler must be version 3.2.1-7a.

You are using the following compiler version: 3.2.2

The compiler was obtained from the following location:

/usr/bin/

Please change your compiler.

ERROR: BOOTDIR does not point to a valid Java 2 SDK

Check that you have access to

/java/re/j2se/1.4.2/archive/fcs/binaries/linux-i586/bin/java

and/or check your value of ALT_BOOTDIR.

ERROR: You seem to not have installed ALSA 0.9.1 or higher.

Please install ALSA (drivers and lib). You can download the

source distribution from http://www.alsa-project.org or go to

http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages.

ERROR: You do not have access to the previous java release jre bundles.

Please check your access to

/java/re/j2se/1.4.2/archive/fcs/bundles/linux-i586/j2re-1_4_2-linux-i586.tar.gz

and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JRE_FILE

This will affect you if you build the images target.

ERROR: You do not have access to the previous java release sdk bundles.

Please check your access to

and/or check your value of ALT_PREVIOUS_RELEASE_PATH or ALT_PREVIOUS_JDK_FILE.

This will affect you if you build the images target.

Exiting because of the above error(s).

make: *** [post-sanity] Error 1

Please help me out.

Regards

Aparna

ap_mitraa at 2007-7-14 19:01:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

What variables do you have set? It looks like a whole lot of environment variables are not configured correctly; going down the list of errors in that message should help you, and make sure to take a close look at the compilation instructions, which will generally tell you what locations the variables should point to.

You'll need gcc 3.2.1-7a or 3.2.2 installed; the make process is *very* picky, and you will want to make sure that the version of gcc that's first in your path (run gcc --version on the command line to check) is actually the 3.2.1 or 3.2.2 version, because the make process doesn't always check the COMPILER_PATH variable when running gcc, and you can get compatibility errors. (That's what turned out to be the cause of the weird c++ errors in the first message on this topic.)

ariel_segalla at 2007-7-14 19:01:36 > top of Java-index,Java HotSpot Virtual Machine,Specifications...