iinc_w instruction and hsdis build instructions ...
Volker Simonis
volker.simonis at gmail.com
Mon Jan 12 14:38:46 UTC 2015
Glad you succeeded to build it.
I dont think you have to set ARCH on the command line. If you only
want to build the 64-bit version of hsdis it should be enough to build
the target "all64" as described in the README file.
Regards,
Volker
PS: you can easily check if your hsdis works by copying it into the
the directory where you libjvm.so is located (i.e.
jre/lib/amd64/server) or by exporting it's location in LD_LIBRARY_PATH
and running "java -XX:+UnlockDiagnosticVMOptions -XX:+PrintInterpreter
"
On Mon, Jan 12, 2015 at 3:19 PM, kedar mhaswade
<kedar.mhaswade at gmail.com> wrote:
> Thank you!
> I tried the -Wno-error=unused-but-set-variable workaround and it seems to
> have worked after running into another error [1].
> I now have hsdis-amd64.so.
>
> Regards,
> Kedar
> 1- make CFLAGS="-Wno-error=unused-but-set-variable" BINUTILS=binutils-2.23.2
> ARCH=amd64 is the command which runs into linking statically with libbfd.a
> (/tmp/ccUxTKNw.o: relocation R_X86_64_32 against `.rodata' can not be used
> when making a shared object; recompile with -fPIC). Instead of linking
> statically I chose to use the shared object, so, I installed the
> binutils-dev package that gives the symlink (/usr/lib/libbfd.so ->
> libbfd-2.24-system.so) and then used -lbfd like so: make
> CFLAGS="-Wno-error=unused-but-set-variable -lbfd" BINUTILS=binutils-2.23.2
> ARCH=amd64. This seems to have fixed the build. Hopefully I built the right
> hsdis so :-).
>
> On Mon, Jan 12, 2015 at 12:14 AM, Volker Simonis <volker.simonis at gmail.com>
> wrote:
>>
>> 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