How to build hsdis.dll for Windows 32-bit? - dll

I am trying to build hsdis.dll in my laptop 32-bit Windows. I read http://dropzone.nfshost.com/hsdis.htm instructions and got to know that I will have to follow those steps. I saw that I have to use the mingw64-i686-gcc-core. I followed the steps, but have always found this error.
make[2]: i686-w64-mingw32: Command not found
Makefile:246: recipe for target 'libiberty.a' failed
make[2]: *** [libiberty.a] Error 127
make[2]: Leaving directory '/home/User/hsdis/build/Linux-i586/libiberty'
Makefile:8045: recipe for target 'all-libiberty' failed
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory '/home/User/hsdis/build/Linux-i586'
Makefile:192: recipe for target 'build/Linux-i586/bfd/libbfd.a' failed
make: *** [build/Linux-i586/bfd/libbfd.a] Error 2
I would also like to know how to use the directive PrintAssembly, because i wanted to see the assembly code, of a Java class.
I have already saw other posts here, but none of them helped.
Thanks in advance

Here are the steps which help me to build it (x64 version, x86 should be almost the same):
download and unpack the latest hsdis sources as described in the building manual from the http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/tags;
download the latest bintuils-2.26.tar.gz package from the http://mirror.tochlab.net/pub/gnu/binutils/;
copy it to your Cygwin home directory and unpack it from the Cygwin terminal (this is very important, otherwise you may get permission problems):
tar -xzvf ./binutils-2.26.tar.gz
install the following Cygwin packages: mingw64-x86_64-gcc-core for x64 or mingw64-i686-gcc-core for x86, diffutils and make;
go to hsdis directory;
for x64 library build with the command: make OS=Linux MINGW=x86_64-w64-mingw32 'AR=x86_64-w64-mingw32-ar' BINUTILS=~/binutils-2.26 CONFIGURE_ARGS="--host=x86_64-w64-mingw32", for x86 library build with the command: make OS=Linux MINGW=i686-w64-mingw32 'AR=i686-w64-mingw32-ar' BINUTILS=~/binutils-2.26 CONFIGURE_ARGS="--host=i686-w64-mingw32"
if you have errors with undefined references to zlib (i.e. build/Linux-amd64/bfd/libbfd.a(compress.o):compress.c:(.text+0x7e): undefined reference to inflate), modify Makefile in hsdis: find the line $(CC) $(OUTFLAGS) $(CPPFLAGS) $(CFLAGS) $(SOURCE) $(DLDFLAGS) $(LIBRARIES) for the $(TARGET) target and append to the end -lz -L$(TARGET_DIR)/zlib, then run the build command again;
after that you should find the library hsdis-amd64.dll in hsdis\build\Linux-amd64\ for x64, or hsdis-i386.dll in hsdis\build\Linux-i586\ for x86.

Related

Version number mismatch: inconsistency between gmp.h and libgmp

I was trying to install NTL library on ubuntu, and after using "make", I get this error :
GMP version check (6.0.0/6.1.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
makefile:346: recipe for target 'setup3' failed
make[1]: *** [setup3] Error 134
make[1]: Leaving directory '/mnt/c/Users/pc-admin/ntl-11.0.0/ntl-11.0.0/src'
makefile:310: recipe for target 'setup-phase' failed
make: *** [setup-phase] Error 2
I saw the posts
https://gmplib.org/list-archives/gmp-discuss/2009-March/003663.html
http://www.mpfr.org/faq.html#undef_ref1
But still that didnt quite help.
Currently my usr/local/lib has
XXX#SECURE2:/usr/local/lib$ ls
libgmp.a libgmp.so libgmp.so.23.0.3 libmpfr.la libmpfr.so.6 libmpir.a libmpir.so libmpir.so.23.0.3 python3.5
libgmp.la libgmp.so.23 libmpfr.a libmpfr.so libmpfr.so.6.0.1 libmpir.la libmpir.so.23 pkgconfig
and /usr/local/include has
XXX#SECURE2:/usr/local/include$ ls
gmp.h mpf2mpfr.h mpfr.h mpir.h
Tried changing environment paths as
C_INCLUDE_PATH=usr/local/include
LIBRARY_PATH=usr/local/lib
LD_LIBRARY_PATH=usr/local/lib
Somehow I don't understand how to solve. Any help would be highly appreciated! Thanks for your patience
I encountered this problem today when I installed GMP after NTL Makefile lets me do so.
The following command seems to help:
sudo ldconfig
I met the same problem.It was because of the library's version.
First I installed gmp-6.1.2(using configure,make,make install command),and then I downloaded ntl-11.3.2,input configure and make commands.And the problem appeared:
GMP version check (6.1.2/6.1.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
makefile:353: recipe for target 'setup3' failed
I guessed maybe I need to install gmp 6.1.0.So I first entered gmp-6.1.2 directory,using command sudo make uninstall,then downloaded gmp-6.1.0 and the problem was solved.
Maybe you can have a try uninstalling gmp 6.0.0,installing 6.1.0.
I figured out a solution, start again and let the Wizard figure it out.
First, get rid of everything we did before
make clobber
./configure
Then edit the makefile and enable the wizard (around line 128)
#WIZARD=off
WIZARD=on

Cannot compile apache with fips

I need to run apache in fips 140-2 mode and I am following the instructions given here: https://wiki.openssl.org/index.php/FIPS_Library_and_Apache
However I am using a newer version of apache, I have these packages instead of the ones listed in the wiki:
openssl-fips-2.0.16.tar.gz
openssl-1.0.2n.tar.gz
httpd-2.4.29.tar.gz
apr-util-1.6.1.tar.gz
apr-1.6.3.tar.gz
pcre-8.41.tar.gz
Everything works fine until I attempt a make on the httpd package and it then fails. If I run a make without the two exports for the fingerprints, it completes without issue:
export CC=/usr/local/ssl/fips-2.0/bin/fipsld
export FIPSLD_CC=/usr/bin/gcc
However as the wiki describes when you enable SSLFIPS in httpd.conf it will fail to start with the fingerprint issue without these variables set. But when I attempt to run a make with these exports I get the following error:
/root/httpd-2.4.29/srclib/apr/libtool --silent --mode=link /usr/local/ssl/fips-2.0/bin/fipsld -g -O2 -pthread -L/usr/local/ssl/lib -lssl -lcrypto -luuid -lrt -lcrypt -lpthread -ldl \
-o ab ab.lo /root/httpd-2.4.29/srclib/apr-util/libaprutil-1.la -lexpat /root/httpd-2.4.29/srclib/apr/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl -lm
./.libs/ab: error while loading shared libraries: libaprutil-1.so.0: cannot open shared object file: No such file or directory
Makefile:73: recipe for target 'ab' failed
make[2]: *** [ab] Error 127
make[2]: Leaving directory '/root/httpd-2.4.29/support'
/root/httpd-2.4.29/build/rules.mk:75: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/httpd-2.4.29/support'
/root/httpd-2.4.29/build/rules.mk:75: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I'm no expert in compiling apache, so no idea why it fails when using those exported variables. Can anyone help?
After a lot of testing, the instructions seem to be working for the older versions, but for the newer version of apr and httpd the "--with-included-apr" appeared to be the problem.
Instead of using this, we built apr and apr-util first by its self, then ran the .config with "“-with-apr=/usr/local/apr/ -with-apr-util=/usr/local/apr-util/" instead. This allowed it to compile and I was able to set SSLFIPS on without issue.

mono build on cygwin have error ,how to do build?

I do it according to the instructions by (http://www.mono-project.com/docs/compiling-mono/windows/)
PATH=$PREFIX/bin:$PATH
git clone https://github.com/mono/mono.git
cd mono
do shell cmd ./autogen.sh --prefix=$PREFIX --host=x86_64-w64-mingw32 --disable-boehm
Git submodules updated successfully
mcs source: mcs
C# Compiler: roslyn
Engine:
Host: x86_64-w64-mingw32
Target: x86_64-w64-mingw32
GC: sgen (concurrent by default)
TLS: pthread
SIGALT STACK: no
Engine: Building and using the JIT
BigArrays: no
DTrace: no
LLVM Back End: no (dynamically loaded: no)
Libraries:
.NET 4.x: yes
Xamarin.Android: no
Xamarin.iOS: no
Xamarin.WatchOS: no
Xamarin.TVOS: no
Xamarin.Mac: no
Windows AOT: no
Orbis: no
Unreal: no
WebAssembly: no
Test profiles: AOT Full (no), AOT Hybrid (no)
JNI support: no
libgdiplus: assumed to be installed
zlib:
BTLS: no
jemalloc: no (always use: no)
Now type `make' to compile
do make and then have below error
C:/cygwin64/home/Administrator/mono/mono/mini/mono-sgen.exe:
error while loading shared libraries: ?: cannot open shared object file: No such file or directory
make[8]: *** [il.make:4:../../../class/lib/basic/corlib.unsafe.dll.tmp] 错误 127
make[7]: *** [../../../build/rules.make:211:do-all] 错误 2
make[6]: *** [../build/rules.make:232:all-recursive] 错误 1
make[5]: *** [build/rules.make:232:all-recursive] 错误 1
make[4]: *** [Makefile:54:profile-do--basic--all] 错误 2
make[3]: *** [Makefile:50:profiles-do--all] 错误 2
make[2]: *** [Makefile:613:all-local] 错误 2
make[2]: 离开目录“/home/Administrator/mono/runtime”
make[1]: *** [Makefile:558:all-recursive] 错误 1
make[1]: 离开目录“/home/Administrator/mono”
make: *** [Makefile:488:all] 错误 2
I have hit this myself twice, but... you aren't supposed to run that thing, actually. You use msbuild to build mono.exe and run make to build the BCL.
The problem you are seeing, is that, in following the directions, you have cross built a mingw mono.exe from a cygwin host. I know, they seem like the same thing, but they aren't quite. The mingw mono.exe fails to run in cygwin environment because it doesn't find libgcc_s.dll or so, and maybe others.
If you dir /s/b C:\cygwin64\libgcc*.dll and notice the mingw sysroot, you can add that directory or directories to your %PATH%, and then this mingw mono.exe will work. However, the right solution is probably a proper mingw install, not using the sysroot, and again, this mono.exe isn't the goal.
Once you use msbuild, you get native Visual C++, and its symbols, and its debugger or windbg, and therein to me is one of the huge values of windows -- the debuggers -- which cygwin and mingw don't give you.
Try to execute C:/cygwin64/home/Administrator/mono/mono/mini/mono-sgen.exe directly - it should complain it misses some cygwin files - copy them to this folder
It doesn't work because the mingw .dlls aren't in $PATH.
You have cross-build a mingw mono from Cygwin environment.
I strongly recommend though you use msbuild against the msvc/*.sln file instead, using Visual C++ instead of mingw to build, and thereby the Visual Studio and windbg debuggers work.

Unable to compile Riak on Raspberry Pi 3

currenty I'm trying to install Riak on the Raspberry Pi 3 for testing purposes. I used the following instruction from basho:
http://docs.basho.com/riak/kv/2.2.2/setup/installing/source/
I'm having problems compiling it from source. I tried to compile it on Raspbian Jessie and then switched to Ubuntu Server 16.04. Both times with the same result. It is not compiling and aborts at a certain point. I don't know what causes the problem since it only says: recipe for target 'util/perf_count.o' failed. Searching Google and the mailing list from basho weren't successful.
The version of gcc is gcc (Raspbian 4.9.2-10) 4.9.2. The version of Erlang is Erlang R16B02_basho8 (erts-5.10.3)
The commands i used are the following:
Installing Erlang:
wget http://s3.amazonaws.com/downloads.basho.com/erlang/otp_src_R16B02basho10.tar.gz
tar zxvf otp_src_R16B02-basho10.tar.gz
cd OTP_R16B02_basho10
./otp_build autoconf
./configure && make && sudo make install
Installing Riak:
wget http://s3.amazonaws.com/downloads.basho.com/riak/2.2/2.2.1/riak-2.2.1.tar.gz
tar zxvf riak-2.2.1.tar.gz
cd riak-2.2.1
make locked-deps
make rel
Any suggestions are welcome.
Output:
`./include/leveldb/atomics.h:155:15: note:
template argument deduction/substitution failed util/perf_count.cc:439:40:
note: deduced conflicting types for parameter ‘ValueT’
(‘unsigned int’ and‘int’ add_and_fetch(ptr_32, 1);`
`Makefile:190: recipe for target 'util/perf_count.o' failed
make[1]: *** [util/perf_count.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/pi/Riak/riak/deps/eleveldb/c_src/leveldb'
ERROR: Command [compile] failed!
Makefile:23: recipe for target 'compile' failed
make: *** [compile] Error 1`
After digging deeper I got some help from Basho's mailing list (many thanks).
The Link below shows the steps to solve this problem:
http://lists.basho.com/pipermail/riak-users_lists.basho.com/2017-April/019187.html
The next link is a detailed instruction, which helps to install Riak on the Raspberry Pi 3:
http://docs.basho.com/riak/kv/2.2.2/setup/installing/source/

Can't find jemalloc while building MariaDB on Raspbian Wheezy

I have installed the list of Required tools shown on the Build Environment Setup for Linux, including JEMALLOC, on my Raspberry Pi which has Raspbian Wheezy installed, fully updated, and setup for development. I have successfully built some of the listed tools (Bison, CMake 3.7.2). I have gcc and g++ (Raspbian 4.8.2-21rpi3rpi1) 4.8.2.
When I attempt to build mariadb 10.1.22 (master branch from the github repository) using cmake . -DBUILD_CONFIG=mysql_release I get an error:
CMake Error at cmake/jemalloc.cmake:38 (MESSAGE):
jemalloc is not found
Call Stack (most recent call first):
CMakeLists.txt:343 (CHECK_JEMALLOC)
After building JEMALLOC, I installed it into /usr/local using sudo make install. I have export JEMALLOC_PATH=/usr/local in my .bashrc.
I don't understand why CHECK_JEMALLOC is failing to find the correct files. A list of the file locations is:
/usr/local/bin/jemalloc.sh
/usr/local/bin/jemalloc-config
/usr/local/include/jemalloc
/usr/local/include/jemalloc/jemalloc.h
/usr/local/lib/pkgconfig/jemalloc.pc
/usr/local/lib/libjemalloc.so
/usr/local/lib/libjemalloc_pic.a
/usr/local/lib/libjemalloc.so.2
/usr/local/lib/libjemalloc.a
/usr/local/share/doc/jemalloc
/usr/local/share/doc/jemalloc/jemalloc.html
/usr/local/share/man/man3/jemalloc.3
I can attach a link to the CMake configure log, error log, and terminal output if needed.
UPDATE
I tried using just cmake . and the configuration part worked, but the make failed with the following error:
/home/user/Downloads/mariadb/server/storage/mroonga/vendor/groonga/lib/expr.c:6816:7: note: in expansion of macro ‘GRN_PTR_POP’
GRN_PTR_POP(&keywords, keyword);
^
cc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
storage/mroonga/vendor/groonga/lib/CMakeFiles/libgroonga.dir/build.make:257: recipe for target 'storage/mroonga/vendor/groonga/lib/CMakeFiles/libgroonga.dir/expr.c.o' failed
make[2]: *** [storage/mroonga/vendor/groonga/lib/CMakeFiles/libgroonga.dir/expr.c.o] Error 4
make[2]: Leaving directory '/home/user/Downloads/mariadb/server'
CMakeFiles/Makefile2:4420: recipe for target 'storage/mroonga/vendor/groonga/lib/CMakeFiles/libgroonga.dir/all' failed
make[1]: *** [storage/mroonga/vendor/groonga/lib/CMakeFiles/libgroonga.dir/all] Error 2
make[1]: Leaving directory '/home/user/Downloads/mariadb/server'
Makefile:152: recipe for target 'all' failed
make: *** [all] Error 2