iinc_w instruction and hsdis build instructions ...
Volker Simonis
volker.simonis at gmail.com
Mon Jan 12 08:14:01 UTC 2015
Hi Kedar,
the hsdis build error is probably because of a new warning in recent
versions of GCC. See https://gcc.gnu.org/gcc-4.6/porting_to.html
Quoted from there:
New warnings for unused variables and parameters
The behavior of -Wall has changed and now includes the new warning
flags -Wunused-but-set-variable and (with -Wall -Wextra)
-Wunused-but-set-parameter. This may result in new warnings in code
that compiled cleanly with previous versions of GCC.
For example,
void fn (void)
{
int foo;
foo = bar (); /* foo is never used. */
}
Gives the following diagnostic:
warning: variable "foo" set but not used [-Wunused-but-set-variable]
Although these warnings will not result in compilation failure, often
-Wall is used in conjunction with -Werror and as a result, new
warnings are turned into new errors.
To fix, first see if the unused variable or parameter can be removed
without changing the result or logic of the surrounding code. If not,
annotate it with __attribute__((__unused__)).
As a workaround, add -Wno-error=unused-but-set-variable or
-Wno-error=unused-but-set-parameter.
Regards,
Volker
On Sat, Jan 10, 2015 at 12:50 AM, kedar mhaswade
<kedar.mhaswade at gmail.com> wrote:
> Hello JVM developers!
> I hope I am posting to the right mailing list, if not, please let me know
> where I should direct these two questions.
>
> 1) When generating the bytecode by javac-7 and javac-8, I see iinc_w
> instruction (and javap shows subtle differences in disassembly on the same
> java class file). I don't find a direct reference to this instruction at:
> http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.
>
> Where should I be looking for the documentation?
>
> 2) I want to build hsdis on Ubuntu 14.04. I have tried with a bunch of
> binutils versions, but it fails rather obscurely [1]. Are there any
> instructions for a successful build on Ubuntu/Debian?
>
> Thanks!
> -Kedar
>
> 1- /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd
> -I. -I.
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/../include
> -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -fPIC -O -c
> -o elf64-x86-64.lo
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I.
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd
> -I. -I.
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd
> -I/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/../include
> -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -fPIC -O -c
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c
> -o elf64-x86-64.o
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:
> In function 'elf64_x86_64_relocate_section':
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:2394:16:
> error: variable 'warned' set but not used [-Werror=unused-but-set-variable]
> bfd_boolean warned;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:2870:29:
> error: variable 'type2' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type, type2;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:3116:29:
> error: variable 'type2' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type, type2;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:3116:23:
> error: variable 'type' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type, type2;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:3116:18:
> error: variable 'val' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type, type2;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:3147:23:
> error: variable 'type' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type;
> ^
> /media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/binutils-2.19.1/bfd/elf64-x86-64.c:3147:18:
> error: variable 'val' set but not used [-Werror=unused-but-set-variable]
> unsigned int val, type;
> ^
> cc1: all warnings being treated as errors
> make[4]: *** [elf64-x86-64.lo] Error 1
> make[4]: Leaving directory
> `/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/build/linux-amd64/bfd'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory
> `/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/build/linux-amd64/bfd'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/build/linux-amd64/bfd'
> make[1]: *** [all-bfd] Error 2
> make[1]: Leaving directory
> `/media/kedar/2tb1/Projects/hsdis/openjdk/hotspot/src/share/tools/hsdis/build/linux-amd64'
> make: *** [build/linux-amd64/bfd/libbfd.a] Error 2
More information about the hotspot-dev
mailing list