radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
19.85k stars 2.95k forks source link

Unable to compile using mingw32 6.2 on Win8 #1099

Closed KarjamP closed 9 years ago

KarjamP commented 9 years ago

While the fact that Windows doesn't include bash by default can be gotten around with by installing MSYS (so that one can run the required "configure" bash script), I ran into another problem, namely, the fact that I received a series of warnings and at least 2 fatal error messages that stops the compiling when I tried to compile using mingw32 on Windows 8.

Apparently, the error's got to do with the fact that "ws2tcpip.h" is not compatible with "winsock.h". mingw32 itself suggests that one should instead, use "winsock2.h".

Incidentally, if it helps, the compiler refers to itself as "i686-unknown-mingw32_nt-6.2-gnu".

Here's what it says in the command prompt:

make -C libr/util
make[1]: Entering directory '/c/radare2/libr/util'
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o mem.o mem.c
mem.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2014 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o pool.o pool.c
pool.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2010-2011 pancake<nopcode.org> */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o num.o num.c
num.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2014 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o str.o str.c
str.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2014 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o hex.o hex.c
hex.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2014 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o file.o file.c
file.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2014 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o alloca.o alloca.c
alloca.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2010 pancake<nopcode.org> */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o range.o range.c
range.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2008-2010 pancake<nopcode.org> */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o log.o log.c
log.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2007-2013 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o prof.o prof.c
prof.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2009-2012 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o cache.o cache.c
cache.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2013 - pancake */
 ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o sys.o sys.c
sys.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2009-2013 - pancake */
 ^
sys.c: In function 'r_sys_backtrace':
sys.c:143:2: warning: #warning TODO: r_sys_bt : unimplemented [-Wcpp]
 #warning TODO: r_sys_bt : unimplemented
  ^
sys.c: In function 'r_sys_cmdbg':
sys.c:417:2: warning: #warning r_sys_cmdbg is not implemented for this platform [-Wcpp]
 #warning r_sys_cmdbg is not implemented for this platform
  ^
sys.c: At top level:
sys.c:187:13: warning: 'signal_handler' defined but not used [-Wunused-function]
 static void signal_handler(int signum) {
             ^
sys.c:199:12: warning: 'checkcmd' defined but not used [-Wunused-function]
 static int checkcmd(const char *c) {
            ^
gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/c/radare2/libr/include -DGIT_TAP=\"0.9.8.git\" -o buf.o buf.c
buf.c:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
 /* radare - LGPL - Copyright 2009-2014 - pancake */
 ^
In file included from c:/radare2/libr/include/r_socket.h:27:0,
                 from c:/radare2/libr/include/r_io.h:6,
                 from buf.c:5:
c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
 #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
  ^
In file included from c:/radare2/libr/include/r_socket.h:27:0,
                 from c:/radare2/libr/include/r_io.h:6,
                 from buf.c:5:
c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq'
 struct ip_mreq {
        ^
In file included from c:\mingw\include\windows.h:93:0,
                 from c:/radare2/libr/include/r_types.h:41,
                 from buf.c:3:
c:\mingw\include\winsock.h:315:8: note: originally defined here
 struct ip_mreq {
        ^
make[1]: *** [buf.o] Error 1
make[1]: Leaving directory `/c/radare2/libr/util'
make: *** [all] Error 2
XVilka commented 9 years ago

Try with that one https://github.com/XVilka/radare2/commit/04376da670ff90ce4cb041316e02c1ec65543ce7

XVilka commented 9 years ago

What is output of uname -a btw?

KarjamP commented 9 years ago
MINGW32_NT-6.2 KARJAMPLAPPY 1.0.18(0.48/3/2) 2012-11-21 22:34 i686 Msys

Oh, and I doubt a commit made to improve Cygwin support would do anything - my bash shell comes from MSYS, an optional component of MinGW32.

I'm not trying to compile through Cygwin.

XVilka commented 9 years ago

Just try, please.

KarjamP commented 9 years ago

I seem to be struggling to figure out how to cherry-pick that commit into the copy of the source code I have, as I'm unable to find it your Git repository. (heck, it doesn't even say which branch it is in).

I did, however, find what appears to equivalent patch in your cygwin branch: https://github.com/XVilka/radare2/commit/f157137e80a8f19193e78c197cc90448053c75f7

Would you want me to try out this one instead of the other to see if it'll work to fix my problem?

XVilka commented 9 years ago

yes. i mean it (i've changed it after wrote previous message, thats why sha1 diffs)

KarjamP commented 9 years ago

Same errors as before.

Your fixes didn't work.

XVilka commented 9 years ago

Ok, I'll install windows+mingw virtual machines to fix those errors. Stay tuned for a 2 days.

XVilka commented 9 years ago

Compilation should be fixed, using those two https://github.com/radare/sdb/pull/45 and https://github.com/radare/radare2/pull/1100 - please test

KarjamP commented 9 years ago

Somehow, it didn't work.

I think you may need to look in how the program implements networking support inside of Windows instead of attempting to fix it via editing the makefiles and the like.

After all, according to that console dump I just gave, apparently, ws2tcpip.h explicitly requires the use of winsock2.h instead of winsock.h as it currently stands.

XVilka commented 9 years ago

@KarjamP The thing is, that this file (ws2tcpip.h) is not needed for MINGW at all - it only need for pure windows compilation, without CYGWIN and MINGW.

KarjamP commented 9 years ago

Then how do I compile it using MINGW?

Afrer all, there's only instructions for crosscompiling on Windows within another OS. There's no instructions for compiling directly within Windows itself.

radare commented 9 years ago

Last time i used windows at home was 15 years ago on w98. I cant help here. But xvilka is working on this by fixing the makefiles. Latest windows are a bit more unix friendly and the makefiles should work on cygwin or unixtools.

On 10 Jul 2014, at 12:12, KarjamP notifications@github.com wrote:

Then how do I compile it using MINGW?

Afrer all, there's only instructions for crosscompiling on Windows within another OS and not compiling directly within Windows itself.

— Reply to this email directly or view it on GitHub.

radare commented 9 years ago

Anyway, there's also bjam support which works on windows too and maybe its easier to fix than the makefiles

On 10 Jul 2014, at 12:12, KarjamP notifications@github.com wrote:

Then how do I compile it using MINGW?

Afrer all, there's only instructions for crosscompiling on Windows within another OS and not compiling directly within Windows itself.

— Reply to this email directly or view it on GitHub.

radare commented 9 years ago

What's the current status of this issue?

KarjamP commented 9 years ago

I think the true problem is that there's little to no instructions on how to compile using MinGW within Windows itself (instead of just cross-compiling).

XVilka commented 9 years ago

@KarjamP Same as for linux - open Mingw32 console in Windows and type:

./configure
make
make install
KarjamP commented 9 years ago

Technically, the default MS DOS-style command prompt of Windows doesn't support running bash scripts (ie, ./configure wouldn't run because Windows doesn't understand it).

In fact, I had to rely on the bash shell that comes with MSYS (an optional supplement to the Windows native version of MinGW).

And I guess the reasons why your patches didn't work the first time is because I didn't know you made it so that I didn't have to tell ./configure that my "os-type" was Windows (and thus, was technically compiling it incorrectly).

Oh, and apparently, Git is required on the system in order for it to be compiled in the first place.

Once I got past the "Git" problem, though, the fact that it still throws a fatal error related to "ws2tcpip.h" requiring "Winsock2" while running the "make" command.

XVilka commented 9 years ago

@KarjamP can you now paste full build log somewhere? (including output of ./configure)

KarjamP commented 9 years ago

Forgot to do this for a couple of days:

C:\radare2-0.9.7>set path=%path%;C:\Users\Richard De Goede\AppData\Local\GitHub\PortableGit_054f2e797ebafd44a30203088cd3d58663c627ef\bin

C:\radare2-0.9.7>bash bash-3.1$ ./configure configure-plugins: Loading ./plugins.cfg .. -t.The system cannot find the file specified. -t.The system cannot find the file specified. configure-plugins: Generating libr/config.h .. configure-plugins: Generating libr/config.mk .. checking build system type... i686-unknown-mingw32_nt-6.2-gnu checking host system type... i686-unknown-mingw32_nt-6.2-gnu checking target system type... i686-unknown-mingw32_nt-6.2-gnu checking for working directories... current using prefix '/usr/local' checking for c compiler... gcc checking for dynamic library... libc checking host endianness... little checking for libmagic ... no checking pkg-config flags for capstone... no checking for libz ... no checking for libzip ... no checking for libewf ... no checking pkg-config flags for libewf... no checking for libssl ... no checking pkg-config flags for openssl... no checking for liblua5.1 ... no creating ./config-user.mk creating libr/include/r_userconf.h creating pkgcfg/r_io.pc creating pkgcfg/r_db.pc creating pkgcfg/r_magic.pc creating pkgcfg/r_asm.pc creating pkgcfg/r_bin.pc creating pkgcfg/r_anal.pc creating pkgcfg/r_hash.pc creating pkgcfg/r_cons.pc creating pkgcfg/r_diff.pc creating pkgcfg/r_core.pc creating pkgcfg/r_lang.pc creating pkgcfg/r_socket.pc creating pkgcfg/r_debug.pc creating pkgcfg/r_reg.pc creating pkgcfg/r_config.pc creating pkgcfg/r_flags.pc creating pkgcfg/r_syscall.pc creating pkgcfg/r_util.pc creating pkgcfg/r_search.pc creating pkgcfg/r_bp.pc creating pkgcfg/r_parse.pc creating pkgcfg/r_fs.pc cleaning temporally files... done

Final report:

make[1]: Leaving directory '/c/radare2-0.9.7/libr/socket' make -C shlr make[1]: Entering directory '/c/radare2-0.9.7/shlr' cd gdb ; make all make[2]: Entering directory '/c/radare2-0.9.7/shlr/gdb' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/c/radare2-0.9.7/shlr/gdb' if [ ! -d capstone ]; then \ git clone https://github.com/aquynh/capstone.git ; \ fi cd capstone ; \ git checkout v3 ; \ git reset --hard 590f23af543fe34a7d3979cda92b3587d3b2207f || \ ( if [ -d .git ]; then \ git pull ; git reset --hard 590f23af543fe34a7d3979cda92b3587d3b2207f ; \ else true ; fi) Already on 'v3' HEAD is now at 590f23a arm: do not need to initialize local variable opcode in DecodeRegListOperand() cd capstone && CFLAGS="-Dmips=mips -g -MD" LDFLAGS="" \ make CC="gcc" AR_EXT=a IS_CYGWIN=0 CAPSTONE_STATIC=yes CAPSTONE_SHARED=no \ RANLIB="ranlib" AR="ar" IS_MINGW=0 \ ./libcapstone.a make[2]: Entering directory '/c/radare2-0.9.7/shlr/capstone' make[2]: 'libcapstone.a' is up to date. make[2]: Leaving directory '/c/radare2-0.9.7/shlr/capstone' make -C sdb make[2]: Entering directory '/c/radare2-0.9.7/shlr/sdb' make -C src make[3]: Entering directory '/c/radare2-0.9.7/shlr/sdb/src' make static make[4]: Entering directory '/c/radare2-0.9.7/shlr/sdb/src' make libsdb.a make[5]: Entering directory '/c/radare2-0.9.7/shlr/sdb/src' make[5]: 'libsdb.a' is up to date. make[5]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/src' make[4]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/src' make shared make[4]: Entering directory '/c/radare2-0.9.7/shlr/sdb/src' make libsdb.dll make[5]: Entering directory '/c/radare2-0.9.7/shlr/sdb/src' make[5]: 'libsdb.dll' is up to date. make[5]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/src' make[4]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/src' make[3]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/src' make -C memcache make[3]: Entering directory '/c/radare2-0.9.7/shlr/sdb/memcache' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory '/c/radare2-0.9.7/shlr/sdb/memcache' make[2]: Leaving directory '/c/radare2-0.9.7/shlr/sdb' make -C udis86 make[2]: Entering directory '/c/radare2-0.9.7/shlr/udis86' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/c/radare2-0.9.7/shlr/udis86' make -C java make[2]: Entering directory '/c/radare2-0.9.7/shlr/java' gcc -MD -I../../libr/include -c -o code.o code.c In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_anal.h:13, from code.c:6: c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

^ In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_anal.h:13, from code.c:6: c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq' struct ip_mreq { ^ In file included from c:\mingw\include\windows.h:93:0, from ../../libr/include/r_types.h:41, from code.c:3: c:\mingw\include\winsock.h:315:8: note: originally defined here struct ip_mreq { ^ make[2]: *\ [code.o] Error 1 make[2]: Leaving directory '/c/radare2-0.9.7/shlr/java' make -C tcc make[2]: Entering directory '/c/radare2-0.9.7/shlr/tcc' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/c/radare2-0.9.7/shlr/tcc' make -C zip make[2]: Entering directory '/c/radare2-0.9.7/shlr/zip' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/c/radare2-0.9.7/shlr/zip' make -C grub make[2]: Entering directory '/c/radare2-0.9.7/shlr/grub' gcc -Iinclude -I../../libr/include -DGRUB_TARGET_NO_MODULES -g -c -o fs/fat.o fs/fat.c In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_fs.h:6, from fs/fat.c:20: c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

^ In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_fs.h:6, from fs/fat.c:20: c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq' struct ip_mreq { ^ In file included from c:\mingw\include\windows.h:93:0, from ../../libr/include/r_types.h:41, from ../../libr/include/r_fs.h:4, from fs/fat.c:20: c:\mingw\include\winsock.h:315:8: note: originally defined here struct ip_mreq { ^ make[2]: * [fs/fat.o] Error 1 make[2]: Leaving directory '/c/radare2-0.9.7/shlr/grub' make[1]: * [preall] Error 2 make[1]: Leaving directory '/c/radare2-0.9.7/shlr' make: *\ [all] Error 2 bash-3.1$

radare commented 9 years ago

you may probably be interested into writing your own mk/* file to setup the environment for windows.

See mk/i386-mingw32-gcc.mk as example, but name id i686-unknown-mingw32_nt-6.2-gnu.mk or use a different —host flag.

Also, i see two -t errors.. looks like it comes from ‘sort -t.’ which is not supported, can you tell me if there’s another way to do this with yours sort program.

On 08 Aug 2014, at 18:38, KarjamP notifications@github.com wrote:

Forgot to do this for a couple of days:

C:\radare2-0.9.7>set path=%path%;C:\Users\Richard De Goede\AppData\Local\GitHub\PortableGit_054f2e797ebafd44a30203088cd3d58663c627ef\bin

C:\radare2-0.9.7>bash bash-3.1$ ./configure configure-plugins: Loading ./plugins.cfg .. -t.The system cannot find the file specified. -t.The system cannot find the file specified. configure-plugins: Generating libr/config.h .. configure-plugins: Generating libr/config.mk .. checking build system type... i686-unknown-mingw32_nt-6.2-gnu checking host system type... i686-unknown-mingw32_nt-6.2-gnu checking target system type... i686-unknown-mingw32_nt-6.2-gnu checking for working directories... current using prefix '/usr/local' checking for c compiler... gcc checking for dynamic library... libc checking host endianness... little checking for libmagic ... no checking pkg-config flags for capstone... no checking for libz ... no checking for libzip ... no checking for libewf ... no checking pkg-config flags for libewf... no checking for libssl ... no checking pkg-config flags for openssl... no checking for liblua5.1 ... no creating ./config-user.mk creating libr/include/r_userconf.h creating pkgcfg/r_io.pc creating pkgcfg/r_db.pc creating pkgcfg/r_magic.pc creating pkgcfg/r_asm.pc creating pkgcfg/r_bin.pc creating pkgcfg/r_anal.pc creating pkgcfg/r_hash.pc creating pkgcfg/r_cons.pc creating pkgcfg/r_diff.pc creating pkgcfg/r_core.pc creating pkgcfg/r_lang.pc creating pkgcfg/r_socket.pc creating pkgcfg/r_debug.pc creating pkgcfg/r_reg.pc creating pkgcfg/r_config.pc creating pkgcfg/r_flags.pc creating pkgcfg/r_syscall.pc creating pkgcfg/r_util.pc creating pkgcfg/r_search.pc creating pkgcfg/r_bp.pc creating pkgcfg/r_parse.pc creating pkgcfg/r_fs.pc cleaning temporally files... done

Final report:

PREFIX = /usr/local HAVE_LIB_EWF = 0 HAVE_LIB_GMP = 0 HAVE_OPENSSL = 0 USE_CAPSTONE = 0 VERSION = 0.9.8.git USE_LIB_ZIP = 0 USE_LIB_MAGIC = 0 DEBUGGER = 1 CC = gcc USERCC = gcc USEROSTYPE = auto LIL_ENDIAN = 1 LIBVERSION = 0.9.8.git bash-3.1$ make make -C libr/util make[1]: Entering directory /c/radare2-0.9.7/libr/util' gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o mem.o mem.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o pool.o pool.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o num.o num.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o str.o str.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o hex.o hex.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o file.o file.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o alloca.o alloca.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o range.o range.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o prof.o prof.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o cache.o cache.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o sys.o sys.c sys.c: In function 'r_sys_backtrace': sys.c:143:2: warning: #warning TODO: r_sys_bt : unimplemented [-Wcpp] #warning TODO: r_sys_bt : unimplemented ^ sys.c: In function 'r_sys_cmdbg': sys.c:417:2: warning: #warning r_sys_cmdbg is not implemented for this platform [-Wcpp] #warning r_sys_cmdbg is not implemented for this platform ^ sys.c: At top level: sys.c:187:13: warning: 'signal_handler' defined but not used [-Wunused-function] static void signal_handler(int signum) { ^ sys.c:199:12: warning: 'checkcmd' defined but not used [-Wunused-function] static int checkcmd(const char _c) { ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o buf.o buf.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o w32-sys.o w32-sys.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o base64.o base64.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o base85.o base85.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o list.o list.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o flist.o flist.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o ht.o ht.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o ht64.o ht64.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o mixed.o mixed.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o btree.o btree.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o chmod.o chmod.c chmod.c:10:12: warning: 'chmodr' declared 'static' but never defined [-Wunused-function] static int chmodr(const char , int recursive); ^ chmod.c:11:12: warning: 'parsemode' declared 'static' but never defined [-Wunused-function] static int parsemode(const char ); ^ chmod.c:12:13: warning: 'recurse' declared 'static' but never defined [-Wunused-function] static void recurse(const char path, int rec, int (fn)(const char ,int)); ^ chmod.c:14:13: warning: 'oper' defined but not used [-Wunused-variable] static char oper = '='; ^ chmod.c:15:15: warning: 'mode' defined but not used [-Wunused-variable] static mode_t mode = 0; ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o graph.o graph.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o regex/regcomp.o regex/regcomp.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o regex/regerror.o regex/regerror.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o regex/regexec.o regex/regexec.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o uleb128.o uleb128.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o sandbox.o sandbox.c sandbox.c: In function 'r_sandbox_check_path': sandbox.c:16:7: warning: unused variable 'ch' [-Wunused-variable] char ch; ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o calc.o calc.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o thread.o thread.c thread.c: In function 'r_th_new': thread.c:52:3: warning: passing argument 3 of 'CreateThread' from incompatible pointer type [enabled by default] th->tid = CreateThread(NULL, 0, _r_th_launcher, th, 0, &th->tid); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from thread.c:3: c:\mingw\include\winbase.h:1164:26: note: expected 'LPTHREAD_STARTROUTINE' but argument is of type 'void * ()(void _)' WINBASEAPI HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD); ^ thread.c:52:3: warning: passing argument 6 of 'CreateThread' from incompatible pointer type [enabled by default] th->tid = CreateThread(NULL, 0, _r_th_launcher, th, 0, &th->tid); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from thread.c:3: c:\mingw\include\winbase.h:1164:26: note: expected 'PDWORD' but argument is of type 'void _' WINBASEAPI HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD); ^ thread.c: In function 'r_th_wait': thread.c:97:8: warning: unused variable 'thret' [-Wunused-variable] void _thret; ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o lock.o lock.c lock.c: In function 'r_th_lock_new': lock.c:15:3: warning: passing argument 1 of 'InitializeCriticalSection' from incompatible pointer type [enabled by default] InitializeCriticalSection(&thl->lock); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from lock.c:3: c:\mingw\include\winbase.h:1469:24: note: expected 'LPCRITICAL_SECTION' but argument is of type 'struct _CRITICALSECTION *' WINBASEAPI VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION); ^ lock.c: In function 'r_th_lock_enter': lock.c:38:2: warning: passing argument 1 of 'EnterCriticalSection' from incompatible pointer type [enabled by default] EnterCriticalSection(&thl->lock); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from lock.c:3: c:\mingw\include\winbase.h:1196:24: note: expected 'LPCRITICAL_SECTION' but argument is of type 'struct _CRITICALSECTION *' WINBASEAPI void WINAPI EnterCriticalSection(LPCRITICAL_SECTION); ^ lock.c: In function 'r_th_lock_leave': lock.c:47:2: warning: passing argument 1 of 'LeaveCriticalSection' from incompatible pointer type [enabled by default] LeaveCriticalSection(&thl->lock); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from lock.c:3: c:\mingw\include\winbase.h:1532:24: note: expected 'LPCRITICAL_SECTION' but argument is of type 'struct _CRITICALSECTION *' WINBASEAPI void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION); ^ lock.c: In function 'r_th_lock_free': lock.c:65:3: warning: passing argument 1 of 'DeleteCriticalSection' from incompatible pointer type [enabled by default] DeleteCriticalSection (&thl->lock); ^ In file included from c:\mingw\include\windows.h:62:0, from c:/radare2-0.9.7/libr/include/r_types.h:41, from c:/radare2-0.9.7/libr/include/r_th.h:4, from lock.c:3: c:\mingw\include\winbase.h:1177:24: note: expected 'PCRITICAL_SECTION' but argument is of type 'struct _CRITICAL_SECTION *' WINBASEAPI void WINAPI DeleteCriticalSection(PCRITICAL_SECTION); ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o strpool.o strpool.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o bitmap.o bitmap.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o strht.o strht.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o p_date.o p_date.c p_date.c: In function 'r_print_date_get_now': p_date.c:80:2: warning: #warning r_print_date_now NOT IMPLEMENTED FOR THIS PLATFORM [-Wcpp] #warning r_print_date_now NOT IMPLEMENTED FOR THIS PLATFORM ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o p_format.o p_format.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o print.o print.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o p_seven.o p_seven.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o slist.o slist.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o randomart.o randomart.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o utf8.o utf8.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o strbuf.o strbuf.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o lib.o lib.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o name.o name.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o log.o log.c gcc -shared -o libr_util.dll -Wl,-soname=libr_util.dll mem.o pool.o num.o str.o hex.o file.o alloca.o range.o prof.o cache.o sys.o buf.o w32-sys.o base64.o base85.o list.o fli st.o ht.o ht64.o mixed.o btree.o chmod.o graph.o regex/regcomp.o regex/regerror.o regex/regexec.o uleb128.o sandbox.o calc.o thread.o lock.o strpool.o bitmap.o strht.o pdate.o p format.o print.o p_seven.o slist.o randomart.o utf8.o strbuf.o lib.o name.o log.o make[1]: Leaving directory/c/radare2-0.9.7/libr/util' make -C libr/socket make[1]: Entering directory `/c/radare2-0.9.7/libr/socket' gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o socket.o socket.c socket.c: In function 'r_socket_connect': socket.c:148:2: warning: #warning TODO: implement connect timeout on w32 [-Wcpp] #warning TODO: implement connect timeout on w32 ^ gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o proc.o proc.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o http.o http.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o http_server.o http_server.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o rap_server.o rap_server.c gcc -c -MD -g -Wall -DMINGW32=1 -I/c/radare2-0.9.7/libr/include -DGIT_TAP=\"0.9.8.git\" -o run.o run.c run.c: In function 'r_run_start': run.c:536:3: warning: passing argument 2 of 'execv' from incompatible pointer type [enabled by default] exit (execv (p->_program, (char const)p->_args)); ^ In file included from c:\mingw\include\unistd.h:37:0, from run.c:8: c:\mingw\include\process.h:150:42: note: expected 'const char const' but argument is of type 'char const' _CRTIMP intptr_t cdecl MINGW_NOTHROW execv (const char, const char const); ^ gcc -lws2_32 -shared -o libr_socket.dll -Wl,-soname=libr_socket.dll socket.o proc.o http.o http_server.o rap_server.o run.o -L/c/radare2-0.9.7/libr/util -lr_util -lws2_32 make[1]: Leaving directory /c/radare2-0.9.7/libr/socket' make -C shlr make[1]: Entering directory/c/radare2-0.9.7/shlr' cd gdb ; make all make[2]: Entering directory /c/radare2-0.9.7/shlr/gdb' make[2]: Nothing to be done forall'. make[2]: Leaving directory /c/radare2-0.9.7/shlr/gdb' if [ ! -d capstone ]; then \ git clone https://github.com/aquynh/capstone.git ; \ fi cd capstone ; \ git checkout v3 ; \ git reset --hard 590f23af543fe34a7d3979cda92b3587d3b2207f || \ ( if [ -d .git ]; then \ git pull ; git reset --hard 590f23af543fe34a7d3979cda92b3587d3b2207f ; \ else true ; fi) Already on 'v3' HEAD is now at 590f23a arm: do not need to initialize local variable opcode in DecodeRegListOperand() cd capstone && CFLAGS="-Dmips=mips -g -MD" LDFLAGS="" \ make CC="gcc" AR_EXT=a IS_CYGWIN=0 CAPSTONE_STATIC=yes CAPSTONE_SHARED=no \ RANLIB="ranlib" AR="ar" IS_MINGW=0 \ ./libcapstone.a make[2]: Entering directory/c/radare2-0.9.7/shlr/capstone' make[2]: libcapstone.a' is up to date. make[2]: Leaving directory/c/radare2-0.9.7/shlr/capstone' make -C sdb make[2]: Entering directory /c/radare2-0.9.7/shlr/sdb' make -C src make[3]: Entering directory/c/radare2-0.9.7/shlr/sdb/src' make static make[4]: Entering directory /c/radare2-0.9.7/shlr/sdb/src' make libsdb.a make[5]: Entering directory/c/radare2-0.9.7/shlr/sdb/src' make[5]: libsdb.a' is up to date. make[5]: Leaving directory/c/radare2-0.9.7/shlr/sdb/src' make[4]: Leaving directory /c/radare2-0.9.7/shlr/sdb/src' make shared make[4]: Entering directory/c/radare2-0.9.7/shlr/sdb/src' make libsdb.dll make[5]: Entering directory /c/radare2-0.9.7/shlr/sdb/src' make[5]:libsdb.dll' is up to date. make[5]: Leaving directory /c/radare2-0.9.7/shlr/sdb/src' make[4]: Leaving directory/c/radare2-0.9.7/shlr/sdb/src' make[3]: Leaving directory /c/radare2-0.9.7/shlr/sdb/src' make -C memcache make[3]: Entering directory/c/radare2-0.9.7/shlr/sdb/memcache' make[3]: Nothing to be done for all'. make[3]: Leaving directory/c/radare2-0.9.7/shlr/sdb/memcache' make[2]: Leaving directory /c/radare2-0.9.7/shlr/sdb' make -C udis86 make[2]: Entering directory/c/radare2-0.9.7/shlr/udis86' make[2]: Nothing to be done for all'. make[2]: Leaving directory/c/radare2-0.9.7/shlr/udis86' make -C java make[2]: Entering directory /c/radare2-0.9.7/shlr/java' gcc -MD -I../../libr/include -c -o code.o code.c In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_anal.h:13, from code.c:6: c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

^ In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_anal.h:13, from code.c:6: c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq' struct ip_mreq { ^ In file included from c:\mingw\include\windows.h:93:0, from ../../libr/include/r_types.h:41, from code.c:3: c:\mingw\include\winsock.h:315:8: note: originally defined here struct ip_mreq { ^ make[2]: *** [code.o] Error 1 make[2]: Leaving directory/c/radare2-0.9.7/shlr/java' make -C tcc make[2]: Entering directory /c/radare2-0.9.7/shlr/tcc' make[2]: Nothing to be done forall'. make[2]: Leaving directory /c/radare2-0.9.7/shlr/tcc' make -C zip make[2]: Entering directory/c/radare2-0.9.7/shlr/zip' make[2]: Nothing to be done for all'. make[2]: Leaving directory/c/radare2-0.9.7/shlr/zip' make -C grub make[2]: Entering directory /c/radare2-0.9.7/shlr/grub' gcc -Iinclude -I../../libr/include -DGRUB_TARGET_NO_MODULES -g -c -o fs/fat.o fs/fat.c In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_fs.h:6, from fs/fat.c:20: c:\mingw\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."

^ In file included from ../../libr/include/r_socket.h:27:0, from ../../libr/include/r_io.h:6, from ../../libr/include/r_fs.h:6, from fs/fat.c:20: c:\mingw\include\ws2tcpip.h:147:8: error: redefinition of 'struct ip_mreq' struct ip_mreq { ^ In file included from c:\mingw\include\windows.h:93:0, from ../../libr/include/r_types.h:41, from ../../libr/include/r_fs.h:4, from fs/fat.c:20: c:\mingw\include\winsock.h:315:8: note: originally defined here struct ip_mreq { ^ make[2]: [fs/fat.o] Error 1 make[2]: Leaving directory/c/radare2-0.9.7/shlr/grub' make[1]: [preall] Error 2 make[1]: Leaving directory`/c/radare2-0.9.7/shlr' make: *\ [all] Error 2 bash-3.1$

— Reply to this email directly or view it on GitHub.

KarjamP commented 9 years ago

Don't assume just because I know how to compile using Make to compile progams using MinGW that I'm proficient in programming in C++ for Windows, especially especially when it comes to making Makefiles for Make - In order for me to make a custom one, I'd need to learn how to make Makefiles.

radare commented 9 years ago

no need to learn how to write makefiles for this. just copy any other mk and change the variables in there to point to your compiler executables and so on. this will force the identification of the system and should fix the build.

can you show the help of the ‘sort’ program in your system?

On 08 Aug 2014, at 22:42, KarjamP notifications@github.com wrote:

Don't assume just because I know how to compile using Make to compile progams using MinGW that I'm proficient in programming in C++ for Windows, especially especially when it comes to making Makefiles for Make - In order for me to make a custom one, I'd need to learn how to make Makefiles.

— Reply to this email directly or view it on GitHub.

KarjamP commented 9 years ago

This's what happens when I try to run "sort --help":

bash-3.1$ sort --help --helpThe system cannot find the file specified.

Anyway, I tried to force it via creating a modified makefile, hoping that I didn't do anything wrong, but it brings up the same error message.

XVilka commented 9 years ago

Still has this error (can't figure whats wrong):

DIR config
make[3]: Entering directory `/d/Work/radare/radare2/libr/config'
gcc -c  -MD    -g -Wall -DMINGW32=1 -I/d/Work/radare/radare2/libr/include -DGIT_TAP=\"0.9.8-rc3-402-g2dd9bd7\" -o config.o config.c
gcc -c  -MD    -g -Wall -DMINGW32=1 -I/d/Work/radare/radare2/libr/include -DGIT_TAP=\"0.9.8-rc3-402-g2dd9bd7\" -o callback.o callback.c
gcc  -shared -o libr_config.dll -Wl,-soname=libr_config.dll config.o callback.o   -L/d/Work/radare/radare2/libr/util -lr_util      
make[3]: Leaving directory `/d/Work/radare/radare2/libr/config'
DIR socket
make[3]: Entering directory `/d/Work/radare/radare2/libr/socket'
make[3]: Leaving directory `/d/Work/radare/radare2/libr/socket'
make[2]: Leaving directory `/d/Work/radare/radare2/libr'
make syscall lang io crypto flags
make[2]: Entering directory `/d/Work/radare/radare2/libr'
DIR syscall
make[3]: Entering directory `/d/Work/radare/radare2/libr/syscall'
make -C d
make[4]: Entering directory `/d/Work/radare/radare2/libr/syscall/d'
make[5]: Entering directory `/d/Work/radare/radare2/libr/syscall/d'
/bin/sh gen.sh < linux-x86-32 | ../../../libr/../shlr/sdb/sdb linux-x86-32.sdb =
/bin/sh: ../../../libr/../shlr/sdb/sdb: Bad file number
make[5]: *** [linux-x86-32.sdb] Error 126
make[5]: Leaving directory `/d/Work/radare/radare2/libr/syscall/d'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/d/Work/radare/radare2/libr/syscall/d'
make[3]: *** [do] Error 2
make[3]: Leaving directory `/d/Work/radare/radare2/libr/syscall'
make[2]: *** [syscall] Error 2
make[2]: Leaving directory `/d/Work/radare/radare2/libr'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/d/Work/radare/radare2/libr'
make: *** [all] Error 2

Here is the sdb binary (can't see whats wrong here) http://rghost.net/private/57615815/97336a45cf7748cbe36c1e3f0b1d0097

radare commented 9 years ago

This looks like a bug when building sdb.

SDB does that to detect if its on windows:

if WIN32 || CYGWIN || MINGW32

undef WINDOWS

define WINDOWS 1

I have added MINGW32 and MINGW64 in that shlr/sdb/src/types.h .. can you add those lines by hand and rebuild again? also, the full log should help to see the problem

you can also try to build http://github.com/radare/sdb to see if you can reproduce the problem in there. I guess that my last commit in sdb should fix that issue. you can compare against the previous commit (git reset —hard @^)

On 22 Aug 2014, at 19:30, Anton Kochkov notifications@github.com wrote:

Still has this error (can't figure whats wrong):

DIR config make[3]: Entering directory /d/Work/radare/radare2/libr/config' gcc -c -MD -g -Wall -DMINGW32=1 -I/d/Work/radare/radare2/libr/include -DGIT_TAP=\"0.9.8-rc3-402-g2dd9bd7\" -o config.o config.c gcc -c -MD -g -Wall -DMINGW32=1 -I/d/Work/radare/radare2/libr/include -DGIT_TAP=\"0.9.8-rc3-402-g2dd9bd7\" -o callback.o callback.c gcc -shared -o libr_config.dll -Wl,-soname=libr_config.dll config.o callback.o -L/d/Work/radare/radare2/libr/util -lr_util make[3]: Leaving directory/d/Work/radare/radare2/libr/config' DIR socket make[3]: Entering directory /d/Work/radare/radare2/libr/socket' make[3]: Leaving directory/d/Work/radare/radare2/libr/socket' make[2]: Leaving directory /d/Work/radare/radare2/libr' make syscall lang io crypto flags make[2]: Entering directory/d/Work/radare/radare2/libr' DIR syscall make[3]: Entering directory /d/Work/radare/radare2/libr/syscall' make -C d make[4]: Entering directory/d/Work/radare/radare2/libr/syscall/d' make[5]: Entering directory /d/Work/radare/radare2/libr/syscall/d' /bin/sh gen.sh < linux-x86-32 | ../../../libr/../shlr/sdb/sdb linux-x86-32.sdb = /bin/sh: ../../../libr/../shlr/sdb/sdb: Bad file number make[5]: *** [linux-x86-32.sdb] Error 126 make[5]: Leaving directory/d/Work/radare/radare2/libr/syscall/d' make[4]: * [all] Error 2 make[4]: Leaving directory `/d/Work/radare/radare2/libr/syscall/d' make[3]: * [do] Error 2 make[3]: Leaving directory/d/Work/radare/radare2/libr/syscall' make[2]: **\* [syscall] Error 2 make[2]: Leaving directory/d/Work/radare/radare2/libr' make[1]: [all] Error 2 make[1]: Leaving directory`/d/Work/radare/radare2/libr' make: \ [all] Error 2 Here is the sdb binary (can't see whats wrong here) http://rghost.net/private/57615815/97336a45cf7748cbe36c1e3f0b1d0097

— Reply to this email directly or view it on GitHub.

XVilka commented 9 years ago

@radare nope, adding these strings doesn't help. Looks like sdb linked as library still an executable (wtf is this!?). See PE header of the resulting SDB (PE Characteristics - DLL = 1)

radare commented 9 years ago

On Aug 25, 2014 2:03 PM, "Anton Kochkov" notifications@github.com wrote:

@radare nope, adding these strings doesn't help. Looks like sdb linked as library still an executable (wtf is this!?).

I have uodated sdb from git on latest r2. Feel free to try again. Sdb in r2 is compiled native and crosscompiled as program and as a library. Because its used to generate caches at compile time

— Reply to this email directly or view it on GitHub.

XVilka commented 9 years ago

@radare already did that. Still same error. I gues error is somewhere in the linking process:

See PE header of the resulting SDB (PE Characteristics - DLL = 1

radare commented 9 years ago

Can u paste full log?

On 25 Aug 2014, at 15:16, Anton Kochkov notifications@github.com wrote:

@radare already did that. Still same error. I gues error is somewhere in the linking process:

See PE header of the resulting SDB (PE Characteristics - DLL = 1

— Reply to this email directly or view it on GitHub.

XVilka commented 9 years ago

@radare of course, here it is http://pastie.org/pastes/9501591/text?key=31vao45agwfsboetkklw2g

radare commented 9 years ago

Thats not eeally full but enough to see that mingw32 is passed to sdb make. and the error looks related to running sdb on windows. Can you upload the sdb.exe or try to byild just sdb from git and try to see why it doesnt works on w32? I can try to do this later at night using crossbuild with ming32

On 25 Aug 2014, at 18:03, Anton Kochkov notifications@github.com wrote:

@radare of course, here it is http://pastie.org/pastes/9501591/text?key=31vao45agwfsboetkklw2g

— Reply to this email directly or view it on GitHub.

XVilka commented 9 years ago

@radare

Here is the sdb binary (can't see whats wrong here) http://rghost.net/private/57615815/97336a45cf7748cbe36c1e3f0b1d0097

XVilka commented 9 years ago

@KarjamP try now - it is fixed for both mingw32 and cygwin