From mboxrd@z Thu Jan 1 00:00:00 1970 From: paul@dawa.demon.co.uk To: gcc-gnats@gcc.gnu.org Subject: libgcj/1906: difference between gcj and jdk for MessageFormat Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010207221251.32389.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg01027.html List-Id: >Number: 1906 >Category: libgcj >Synopsis: difference between gcj and jdk for MessageFormat >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Feb 07 14:16:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: paul@dawa.demon.co.uk >Release: gcc version 2.97 20010206 (experimental) >Organization: >Environment: Linux RedHat 7 x86 >Description: The following code import java.text.MessageFormat; public class Test { public static void main(String args[]) { MessageFormat messageformat = new MessageFormat("test Message = {0}"); Object aobj[] = new Object[1]; aobj[0] = new String("a jolly string"); System.out.println(messageformat.format((Object) aobj)); } } produces different results when compiled with gcj than it does if run in either Sun's (1.2) or IBM's (1.3) JDK $ javac Test.java $ java Test test Message a jolly string $ gcj Test.java --main=Test -o test $ ./test test Message [Ljava.lang.Object;@807dfc0 >How-To-Repeat: >Fix: Presumably the Sun JDK has a(n undocumented) test in the java.text.format(Object obj) method to see if the object is really an array and behave differently if so. >Release-Note: >Audit-Trail: >Unformatted: >>From wanderer@rsu.ru Sun Apr 01 00:00:00 2001 From: "Vladimir A. Merzliakov" To: nathan@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/1506 Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010119061600.21178.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg00464.html Content-length: 640 The following reply was made to PR c++/1506; it has been noted by GNATS. From: "Vladimir A. Merzliakov" To: , , "Vladimir A. Merzliakov" Cc: Subject: Re: c++/1506 Date: Fri, 19 Jan 2001 09:07:21 +0300 Still have internal compiler error on source compile: gcc version 2.97 20010118 (experimental) 1506.cc:5: definition of `struct W' inside template parameter list 1506.cc:5: Internal error #60. 1506.cc:5: Internal compiler error in note_got_semicolon, at cp/lex.c:1034 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%26pr=1506%26database=gcc >>From ericy@iname.com Sun Apr 01 00:00:00 2001 From: "=?big5?B?QnJhbmRvbiBZYW5nILeortG7yg==?=" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: target/2032 Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-id: <20010223085600.30642.qmail@sourceware.cygnus.com> X-SW-Source: 2001-q1/msg01616.html Content-length: 13113 The following reply was made to PR target/2032; it has been noted by GNATS. From: "=?big5?B?QnJhbmRvbiBZYW5nILeortG7yg==?=" To: Cc: Subject: Re: target/2032 Date: Fri, 23 Feb 2001 16:45:22 +0800 Here is the make-cross.sh #! /bin/bash # Build a cross-toolchain for target $TARGET. It expects $BASE_PATH/src to # contain $BINUTILS-$BINUTILS_VERSION.EXTN, $GCC-$GCC_VERSION.EXTN, # and $LIBC-$LIBC_VERSION.EXTN. Any type of tar-based archive is fine. # If you are building libc you will also need $LINUX-$LINUX_VERSION.EXTN. # Optional patches may be compressed or not and are expected to apply to # the source tree from within $PACKAGE-$VERSION with -pX. Patch names # may not contain a % character (oh damn, I'll have to rename all my patches!). # USAGE: make-cross.sh [[binutils] [gcc] [libc] [destroy]] [restart] [kernel] # If no options are given, all parts of the toolchain are rebuilt and any # existing toolchain is replaced. Specifying one or more parts will build # only those parts (any previous must exist already). Specifying destroy # will blow away the existing toolchain before building - you probably should # not use this if you are only building gcc or glibc for example. # The restart option does not destroy existing sources and object files, but # relies on package makefiles to do the right things. This is useful if you're # hacking the toolchain. Note that if a package was not properly extracted # or patched you probably don't want this option. # What shall we build for? TARGET=armv5-linux TGT_LINARCH=armv5 # Contains the src/ directory with sources and patches # $BASE_PATH/src/$PACKAGE-$VERSION/ will be created during the build process. BASE_PATH=/scratch/crossdev-build # The directory to build in. $BUILD_PATH/$TARGET/$PACKAGE-$VERSION-obj will # be created during the build process. BUILD_PATH="$BASE_PATH" # Where to install. $INST_PREFIX/$TARGET will be created for you. INST_PREFIX=/scratch/crossdev # Environment variables to be passed to configure for all packages. GLOBAL_ENV= # Arguments to be passed to configure for all packages. GLOBAL_ARGS= # Empty unless building on sparc64-linux #SPARC32=sparc32 # Number of CPUs in this box. Set to 0, not 1, for UP CPUS=0 # Package names and any patches you want applied. BINUTILS=binutils GCC=gcc LIBC=glibc LINUX=linux BINUTILS_VERSION=010118 GCC_VERSION=20010122 LIBC_VERSION=2.2.1 LINUX_VERSION=2.2.12 # Patches are in src/ and should be expressed as name%%X, where X is the -pX # option to pass to patch. Patches are applied within the source tree; that is, # in src/package-version/. #BINUTILS_PATCHES= #GCC_PATCHES="gcse-regcopy.diff%%1 gcc-sizet.diff%%1" #LIBC_PATCHES="glibc-fcr31.diff%%1" #LINUX_PATCHES="compile-bits-000708.diff%%0 kernel-newcpp-000707.diff%%0 timers-000707.diff%%0" # Build environment. Probably this is all fine. BINUTILS_ENV="CC=cc" BINUTILS_ARGS= GCC_ENV="AR=$TARGET-ar RANLIB=$TARGET-ranlib" GCC_ARGS="--enable-shared --with-newlib --enable-languages=c" LIBC_ENV="CC=$TARGET-gcc BUILD_CC=cc AR=$TARGET-ar RANLIB=$TARGET-ranlib" LIBC_ARGS="--enable-kernel=2.2.12 --enable-add-ons --with-elf --disable-prof ile" # --- END --- SRC_PATH="$BASE_PATH/src" TAR=tar TAR_FLAGS=x EXTNS=".tar.bz2 .tar.gz .tar.z .tar.Z .tgz .tbz2 .tbz .taz .tar" #function extract () { # for extn in $(echo $EXTNS); do # if [ -f "$SRC_PATH/$1$extn" ]; then # case "$extn" in # .tar.bz2|.tbz2|.tbz) # TAR_FLAGS="$TAR_FLAGS"I # ;; # .tar) # ;; # *) # TAR_FLAGS="$TAR_FLAGS"z # ;; # esac # _extract_pkg_file="$SRC_PATH/$1$extn" # echo "Extracting $_extract_pkg_file as a $extn package" # $TAR "${TAR_FLAGS}f" "$_extract_pkg_file" # return # fi # done # echo "Sorry no package $1 found" # exit 1 #} #function apply_patch () { # # Extract the -pX option from the name # level=$(echo "$1" | sed -e s/.*%%//) # patch=$(echo "$1" | sed -e s/%%.*//) # if [ -f "$SRC_PATH/$patch" ]; then # echo -n "Applying patch $patch with -p$level " # case "$patch" in # *.*bz*) # echo "as a bzip2'd patch" # bzcat "$SRC_PATH/$patch" | patch -p$level # return # ;; # *Z|*z) # echo "as a gzip'd patch" # zcat "$SRC_PATH/$patch" | patch -p$level # return # ;; # *) # echo "as a plain patch" # patch -p$level < "$SRC_PATH/$patch" # return # ;; # esac # fi # echo "Sorry, no such patch $patch" # exit 1 #} keep_old=yes restart=no arg_count="$#" build_binutils=no build_gcc=no build_libc=no build_kernel=no while [ "$#" -gt 0 ]; do case "$1" in *libc) build_libc=yes ;; *gcc) build_gcc=yes ;; *binutils) build_binutils=yes ;; *destroy) keep_old=no ;; *restart) restart=yes ;; *kernel) build_kernel=yes ;; esac shift done if [ "$build_binutils$build_gcc$build_libc$build_kernel" = "nononono" ]; then build_binutils=yes build_gcc=yes build_libc=yes build_kernel=yes fi if [ -d "${INST_PREFIX}/$TARGET" ] && [ "$keep_old" != "yes" ]; then rm -rf "${BUILD_PATH}/${TARGET}" fi if [ "$build_binutils" != "no" ] && [ "$restart" != "yes" ]; then #rm -rf "${SRC_PATH}/${BINUTILS}-${BINUTILS_VERSION}" cd "${SRC_PATH}" || exit 1 #for _patch in $(echo "$BINUTILS_PATCHES"); do # cd "${SRC_PATH}/${BINUTILS}-${BINUTILS_VERSION}" \ # && apply_patch "$_patch" || exit 1 #done fi if [ "$build_gcc" != "no" ] && [ "$restart" != "yes" ]; then #rm -rf "${SRC_PATH}/${GCC}-${GCC_VERSION}" cd "${SRC_PATH}" || exit 1 #for _patch in $(echo "$GCC_PATCHES"); do # cd "${SRC_PATH}/${GCC}-${GCC_VERSION}" \ # && apply_patch "$_patch" || exit 1 #done fi if [ "$build_libc" != "no" ] && [ "$restart" != "yes" ]; then #rm -rf "${SRC_PATH}/${LIBC}-${LIBC_VERSION}" cd "${SRC_PATH}" || exit 1 #for _patch in $(echo "$LIBC_PATCHES"); do # cd "${SRC_PATH}/${LIBC}-${LIBC_VERSION}" \ # && apply_patch "$_patch" || exit 1 #done fi if [ "$build_libc" != "no" -o "$build_kernel" != "no" ] \ && [ "$restart" != "yes" ]; then #rm -rf "${SRC_PATH}/${LINUX}-${LINUX_VERSION}" cd "${SRC_PATH}" || exit 1 #for _patch in $(echo "$LINUX_PATCHES"); do # cd "${SRC_PATH}/${LINUX}-${LINUX_VERSION}" \ # && apply_patch "$_patch" || exit 1 #done fi export PATH="$PATH:${INST_PREFIX}/${TARGET}/bin" if [ "$build_binutils" != "no" ]; then _srcdir="${SRC_PATH}/${BINUTILS}-${BINUTILS_VERSION}" _builddir="${BUILD_PATH}/${TARGET}/${BINUTILS}-${BINUTILS_VERSION}-obj" echo "Building $BINUTILS $BINUTILS_VERSION from $_srcdir in $_builddir" if [ "$restart" != "yes" ]; then rm -rf "${_builddir}" fi mkdir -p "${_builddir}" || exit 1 cd "${_builddir}" || exit 1 env $(echo $GLOBAL_ENV $BINUTILS_ENV) $SPARC32 \ "${_srcdir}/configure" "--prefix=$INST_PREFIX/${TARGET}" \ "--target=$TARGET" $GLOBAL_ARGS $BINUTILS_ARGS || exit 1 $SPARC32 make MAKE="make -j$(($CPUS + 1))" || exit 1 echo "Installing $BINUTILS $BINUTILS_VERSION in $INST_PREFIX/$TARGET" $SPARC32 make install || exit 1 fi if [ "$build_gcc" != "no" ]; then _srcdir="${SRC_PATH}/${GCC}-${GCC_VERSION}" _builddir="${BUILD_PATH}/${TARGET}/${GCC}-${GCC_VERSION}-obj" echo "Building $GCC $GCC_VERSION from $_srcdir in $_builddir" if [ "$restart" != "yes" ]; then rm -rf "${_builddir}" fi mkdir -p "${_builddir}" || exit 1 cd "${_builddir}" || exit 1 env $(echo $GLOBAL_ENV $GCC_ENV) $SPARC32 \ "${_srcdir}/configure" "--prefix=$INST_PREFIX/$TARGET" \ "--target=$TARGET" $GLOBAL_ARGS $GCC_ARGS || exit 1 $SPARC32 make LANGUAGES=c ALL_TARGET_MODULES= \ CONFIGURE_TARGET_MODULES= INSTALL_TARGET_MODULES= \ SUBDIRS="libiberty gcc" MAKE="make -j$(($CPUS + 1))" || exit 1 # I think this should just be $SPARC32 make ??? But it works. ??? echo "Installing $GCC $GCC_VERSION in $INST_PREFIX/$TARGET" $SPARC32 make -C gcc \ LANGUAGES=c ALL_TARGET_MODULES= SUBDIRS="libiberty gcc" \ CONFIGURE_TARGET_MODULES= INSTALL_TARGET_MODULES= install || exit 1 fi if [ "$build_libc" != "no" ]; then _srcdir="${SRC_PATH}/${LIBC}-${LIBC_VERSION}" _builddir="${BUILD_PATH}/${TARGET}/${LIBC}-${LIBC_VERSION}-obj" _instdir="${BUILD_PATH}/${TARGET}/${LIBC}-${LIBC_VERSION}-inst" _destdir="${INST_PREFIX}/$TARGET" echo "Installing linux headers from ${SRC_PATH}/${LINUX}-${LINUX_VERSION}/include to ${INST_PREFIX}/${TARGET}/${TARGET}/include" # The only reason we even need linux here is for the asm headers and # the linux headers. So copy them out and go on. mkdir -p "${INST_PREFIX}/${TARGET}/${TARGET}/include" || exit 1 rm -rf "${INST_PREFIX}/${TARGET}/${TARGET}/include/asm" rm -rf "${INST_PREFIX}/${TARGET}/${TARGET}/include/linux" cd ${SRC_PATH}/${LINUX}-${LINUX_VERSION} && make ARCH="$TGT_LINARCH" \ oldconfig include/linux/version.h || exit 1 cp -rd \ "${SRC_PATH}/${LINUX}-${LINUX_VERSION}/include/asm-${TGT_LINARCH}" \ "${INST_PREFIX}/${TARGET}/${TARGET}/include/asm" || exit 1 cp -rd \ "${SRC_PATH}/${LINUX}-${LINUX_VERSION}/include/linux" \ "${INST_PREFIX}/${TARGET}/${TARGET}/include/linux" || exit 1 echo "Building $LIBC $LIBC_VERSION from $_srcdir in $_builddir" if [ "$restart" != "yes" ]; then rm -rf "${_builddir}" fi mkdir -p "${_builddir}" && mkdir -p "${_instdir}" || exit 1 cd "${_builddir}" || exit 1 env $(echo $GLOBAL_ENV $LIBC_ENV) $SPARC32 \ "${_srcdir}/configure" "--prefix=/usr" "--host=$TARGET" \ "--with-headers=${INST_PREFIX}/$TARGET/$TARGET/include" \ $GLOBAL_ARGS $LIBC_ARGS || exit 1 $SPARC32 make PARALLELMFLAGS=-j$(($CPUS + 1)) || exit 1 echo "Installing $LIBC $LIBC_VERSION in $instdir" $SPARC32 make install install_root=${_instdir} || exit 1 echo "Installing $LIBC $LIBC_VERSION into $_destdir/$TARGET" cd "${_instdir}/usr/include" && \ (find . -print | cpio -pumd "${_destdir}/$TARGET/include") \ || exit 1 cd "${_instdir}/usr/lib" && \ (find . -print | cpio -pumd "${_destdir}/$TARGET/lib") || exit 1 cd "${_instdir}/lib" && \ (find . -print | cpio -pumd "${_destdir}/$TARGET/lib") || exit 1 # *sigh* This is the fun part. We need to fix up libc.so so that # it points to files in our filesystem, not the mythical /usr dirs # we would have if this were native. echo "Fixing up libc.so locations" sed -e s%/lib/libc.so.6%"${_destdir}/$TARGET/lib/libc.so.6"%g \ -e s%/usr/lib/%"${_destdir}/$TARGET/lib/"%g \ < "${_destdir}/$TARGET/lib/libc.so" \ > "${_destdir}/$TARGET/lib/.new.libc.so" || exit 1 mv -f "${_destdir}/$TARGET/lib/.new.libc.so" \ "${_destdir}/$TARGET/lib/libc.so" || exit 1 echo "Creating install package ${BUILD_PATH}/${TARGET}/${LIBC}-${LIBC_VERSION}-inst.tar.gz" cd "$_instdir" && tar czf "../${LIBC}-${LIBC_VERSION}-inst.tar.gz" . \ || exit 1 rm -rf "${_instdir}" fi echo "All done, successfully built a cross-environment for $TARGET" # The kernel has already been unpacked for us, just go. while [ "$build_kernel" != "no" ]; do echo -n "Enter a tag to associate with the kernel (eg. IP22-4400): " read kernel_tag make_target=boot out_elf="vmlinux-${LINUX_VERSION}-${kernel_tag}" out_ecoff="vmlinux.ecoff-${LINUX_VERSION}-${kernel_tag}" out_bzimage="bzImage-${LINUX_VERSION}-${kernel_tag}" out_config="linux.config-${LINUX_VERSION}-${kernel_tag}" out_map="System.map-${LINUX_VERSION}-${kernel_tag}" out_archive="${BUILD_PATH}/${TARGET}/${LINUX}-${LINUX_VERSION}-${kernel_tag} .tar.gz" echo "This will produce" echo "$out_archive" echo "containing" echo "$out_config" echo "$out_elf" if [ "$TGT_LINARCH" = "mips" ]; then echo "$out_ecoff" elif [ "$TGT_LINARCH" = "i686" ]; then echo "$out_bzimage" make_target=bzImage fi echo "$out_map" echo echo -n "Is this ok? " read confirm if [ "$confirm" != "y" ]; then echo -n "Build another kernel? " read confirm if [ "$confirm" != "y" ]; then exit 0 else continue fi fi _srcdir="${SRC_PATH}/${LINUX}-${LINUX_VERSION}" echo "Building $LINUX version $LINUX_VERSION in ${_srcdir}" cd "${_srcdir}" || exit 1 if [ "$restart" != "yes" ]; then make mrproper || exit 1 fi make menuconfig || make config || exit 1 make dep || exit 1 if [ "$restart" != "yes" ]; then make clean || exit 1 fi make -j$(($CPUS + 1)) ${make_target} || exit 1 mv -f .config "${out_config}" mv -f vmlinux "${out_elf}" if [ "$TGT_LINARCH" = "mips" ]; then mv -f arch/mips/boot/vmlinux.ecoff "${out_ecoff}" out_bzimage= elif [ "$TGT_LINARCH" = "i686" ]; then mv -f arch/i686/boot/bzImage "${out_bzimage}" out_ecoff= else out_ecoff= out_bzimage= fi mv -f System.map "${out_map}" $TAR czf ${out_archive} ${out_config} ${out_elf} ${out_ecoff} \ ${out_bzimage} ${out_map} || exit 1 echo "${out_archive} successfully built" echo -n "Build another kernel? " read confirm if [ "$confirm" != "y" ]; then exit 0 else continue fi done