Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msys2 windows make problem #6743

Closed
Tzaoh opened this issue Feb 8, 2017 · 18 comments
Closed

msys2 windows make problem #6743

Tzaoh opened this issue Feb 8, 2017 · 18 comments
Labels
buildsystem Windows Microsoft Windows platform support issues
Milestone

Comments

@Tzaoh
Copy link
Contributor

Tzaoh commented Feb 8, 2017

Following
https://radare.gitbooks.io/radare2book/content/introduction/windows_compilation.html

to compile for w64 ended with this error.
I commented it on telegram channel but prefer this to know its status.

$ make
Generating r_version.h file
/bin/sh: cmp: no se encontró la orden
Update libr/include/r_version.h
make -C shlr/zip
make[1]: se entra en el directorio '/home/tzaoh/r2/shlr/zip'
make -C zip
make[2]: se entra en el directorio '/home/tzaoh/r2/shlr/zip/zip'
gcc -c   -MD   -fPIC -g -Wall -D__WINDOWS__=1 -fPIC -D_WIN32=1 -I../../../libr/include -I../include/ -o zip_add.o zip     _add.c
In file included from /usr/include/w32api/winsock.h:36:0,
                 from ../../../libr/include/r_types.h:92,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_add.c:37:
/usr/include/w32api/psdk_inc/_fd_types.h:100:2: aviso: #warning "fd_set and associated macros have been defined in sy     s/types.      This can cause runtime problems with W32 sockets" [-Wcpp]
 #warning "fd_set and associated macros have been defined in sys/types.  \
  ^~~~~~~
In file included from ../../../libr/include/r_types.h:92:0,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_add.c:37:
/usr/include/w32api/winsock.h:299:34: error: tipos en conflicto para ‘select’
   WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL t     imeout);
                                  ^~~~~~
In file included from /usr/include/sys/types.h:68:0,
                 from ../include/zconf.h:421,
                 from ../include/zlib.h:34,
                 from zipint.h:40,
                 from zip_add.c:37:
/usr/include/sys/select.h:73:5: nota: la declaración previa de ‘select’ estaba aquí
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^~~~~~
make[2]: *** [/home/tzaoh/r2/libr/../global.mk:43: zip_add.o] Error 1
make[2]: se sale del directorio '/home/tzaoh/r2/shlr/zip/zip'
make[1]: *** [Makefile:25: zip/libr_zip.a] Error 2
make[1]: se sale del directorio '/home/tzaoh/r2/shlr/zip'
make: *** [Makefile:49: all] Error 2
@radare
Copy link
Collaborator

radare commented Feb 8, 2017

this is a problem in your SDK. see that both definitions are in include files outside r2land:

  • /usr/include/w32api/winsock.h
  • /usr/include/sys/select.h

i have removed the include of sys/types.h in zconf.h because it was not necessary at all. git pull and let me know if it builds now

@radare radare added this to the 1.3.0 milestone Feb 8, 2017
@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 9, 2017

Getting same errors, any idea how could I fix the SDK?
I just followed the linked guide step by step.
I can try other way of compiling if necesary.

$ make
Generating r_version.h file
/bin/sh: cmp: no se encontró la orden
Update libr/include/r_version.h
make -C shlr/zip
make[1]: se entra en el directorio '/home/tzaoh/r2/shlr/zip'
make -C zip
make[2]: se entra en el directorio '/home/tzaoh/r2/shlr/zip/zip'
gcc -c   -MD   -fPIC -g -Wall -D__WINDOWS__=1 -fPIC -D_WIN32=1 -I../../../libr/include -I../include/ -o zip_dirent.o zip_dirent.c
In file included from /usr/include/w32api/winsock.h:36:0,
                 from ../../../libr/include/r_types.h:92,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_dirent.c:44:
/usr/include/w32api/psdk_inc/_fd_types.h:100:2: aviso: #warning "fd_set and associated macros have been defined in sys/types.      This can cause runtime problems with W32 sockets" [-Wcpp]
 #warning "fd_set and associated macros have been defined in sys/types.  \
  ^~~~~~~
In file included from ../../../libr/include/r_types.h:92:0,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_dirent.c:44:
/usr/include/w32api/winsock.h:299:34: error: tipos en conflicto para ‘select’
   WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
                                  ^~~~~~
In file included from /usr/include/sys/types.h:68:0,
                 from /usr/include/stdio.h:61,
                 from zip_dirent.c:36:
/usr/include/sys/select.h:73:5: nota: la declaración previa de ‘select’ estaba aquí
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^~~~~~
make[2]: *** [/home/tzaoh/r2/libr/../global.mk:43: zip_dirent.o] Error 1
make[2]: se sale del directorio '/home/tzaoh/r2/shlr/zip/zip'
make[1]: *** [Makefile:25: zip/libr_zip.a] Error 2
make[1]: se sale del directorio '/home/tzaoh/r2/shlr/zip'
make: *** [Makefile:49: all] Error 2

@XVilka
Copy link
Contributor

XVilka commented Feb 9, 2017

Try now

@Maijin Maijin added buildsystem Windows Microsoft Windows platform support issues labels Feb 9, 2017
@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 9, 2017

Sorry for the delay:
git pulled but still same errors.

$ make
Generating r_version.h file
/bin/sh: cmp: no se encontró la orden
Update libr/include/r_version.h
make -C shlr/zip
make[1]: se entra en el directorio '/home/tzaoh/r2/shlr/zip'
make -C zip
make[2]: se entra en el directorio '/home/tzaoh/r2/shlr/zip/zip'
gcc -c   -MD   -fPIC -g -Wall -D__WINDOWS__=1 -fPIC -D_WIN32=1 -I../../../libr/i                   nclude -I../include/ -o zip_dirent.o zip_dirent.c
In file included from /usr/include/w32api/winsock.h:36:0,
                 from ../../../libr/include/r_types.h:92,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_dirent.c:44:
/usr/include/w32api/psdk_inc/_fd_types.h:100:2: aviso: #warning "fd_set and associated macros have been defined in sys/types.      This can cause runtime problems with W32 sockets" [-Wcpp]
 #warning "fd_set and associated macros have been defined in sys/types.  \
  ^~~~~~~
In file included from ../../../libr/include/r_types.h:92:0,
                 from ../include/zipconf.h:16,
                 from zip.h:56,
                 from zipint.h:53,
                 from zip_dirent.c:44:
/usr/include/w32api/winsock.h:299:34: error: tipos en conflicto para ‘select’
   WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
                                  ^~~~~~
In file included from /usr/include/sys/types.h:68:0,
                 from /usr/include/stdio.h:61,
                 from zip_dirent.c:36:
/usr/include/sys/select.h:73:5: nota: la declaración previa de ‘select’ estaba aquí
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^~~~~~
make[2]: *** [/home/tzaoh/r2/libr/../global.mk:43: zip_dirent.o] Error 1
make[2]: se sale del directorio '/home/tzaoh/r2/shlr/zip/zip'
make[1]: *** [Makefile:25: zip/libr_zip.a] Error 2
make[1]: se sale del directorio '/home/tzaoh/r2/shlr/zip'
make: *** [Makefile:49: all] Error 2

@radare
Copy link
Collaborator

radare commented Feb 9, 2017 via email

@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 9, 2017

I commented the line 299 of /usr/lib/winsock.h
"WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);"

and keeps compiling (YaY) but I guess thats not a plausible solution to commit.

oops another one:

gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/home/tzaoh/r2/libr/../shlr/zip/include -I/home/tzaoh/r2/libr/include -I../../shlr/sdb/src//src -o punycode.o punycode.c
gcc     -shared -o libr_util.dll -Wl,-soname=libr_util.dll mem.o pool.o unum.o str.o hex.o file.o range.o tinyrange.o prof.o cache.o sys.o buf.o w32-sys.o ubase64.o base85.o base91.o list.o flist.o uht.o uht64.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 thread_lock.o thread_msg.o strpool.o bitmap.o strht.o p_date.o p_format.o print.o p_seven.o slist.o randomart.o log.o zip.o debruijn.o utf8.o strbuf.o lib.o name.o spaces.o signal.o syscmd.o diff.o bdiff.o stack.o queue.o tree.o des.o id_storage.o punycode.o ../../shlr/sdb/src/buffer.o ../../shlr/sdb/src/cdb.o ../../shlr/sdb/src/cdb_make.o ../../shlr/sdb/src/ht.o ../../shlr/sdb/src/sdbht.o ../../shlr/sdb/src/json.o ../../shlr/sdb/src/lock.o ../../shlr/sdb/src/ls.o ../../shlr/sdb/src/ns.o ../../shlr/sdb/src/query.o ../../shlr/sdb/src/sdb.o ../../shlr/sdb/src/base64.o ../../shlr/sdb/src/disk.o ../../shlr/sdb/src/array.o ../../shlr/sdb/src/fmt.o ../../shlr/sdb/src/match.o ../../shlr/sdb/src/num.o ../../shlr/sdb/src/util.o ../../shlr/sdb/src/journal.o ../../shlr/spp/spp.o       -fPIC /home/tzaoh/r2/libr/../shlr/zip/librz.a
../../shlr/spp/spp.o: En la función `cmd_to_str':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:17: referencia a `_popen' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:17:(.text+0x1b0): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_popen' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:22: referencia a `_pclose' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:22:(.text+0x1fa): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_pclose' sin definir
../../shlr/spp/spp.o: En la función `spp_add':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:101: referencia a `_snprintf' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:101:(.text+0x4c1): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_snprintf' sin definir
../../shlr/spp/spp.o: En la función `spp_trace':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:134: referencia a `_snprintf' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:134:(.text+0x5e6): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_snprintf' sin definir
../../shlr/spp/spp.o: En la función `spp_pipe':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:320: referencia a `_popen' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:320:(.text+0xe17): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_popen' sin definir
../../shlr/spp/spp.o: En la función `spp_endpipe':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:365: referencia a `_pclose' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:365:(.text+0xfe2): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_pclose' sin definir
collect2: error: ld devolvió el estado de salida 1
make[2]: *** [../rules.mk:73: libr_util.dll] Error 1
make[2]: se sale del directorio '/home/tzaoh/r2/libr/util'
make[1]: *** [../rules.mk:59: all] Error 2
make[1]: se sale del directorio '/home/tzaoh/r2/libr/util'
make: *** [Makefile:50: all] Error 2

@radare
Copy link
Collaborator

radare commented Feb 9, 2017 via email

@radare
Copy link
Collaborator

radare commented Feb 10, 2017 via email

@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 11, 2017

Hi, that last one resolved the "select" duplicity problem (removing the comment I previously commented still passes that part). The cmp stuff worked too as you said. Last part still remains though, but is its closer at least.

gcc -c  -MD   -fPIC -g -Wall -D__WINDOWS__=1 -I/home/tzaoh/r2/libr/../shlr/zip/include -I/home/tzaoh/r2/libr/include -I../../shlr/sdb/src/                                                                                                                                     /src -o punycode.o punycode.c
gcc     -shared -o libr_util.dll -Wl,-soname=libr_util.dll mem.o pool.o unum.o str.o hex.o file.o range.o tinyrange.o prof.o cache.o sys.o                                                                                                                                      buf.o w32-sys.o ubase64.o base85.o base91.o list.o flist.o uht.o uht64.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 thread_lock.o thread_msg.o strpool.o bitmap.o strht.o p_date.o p_format.o print.o p_s                                                                                                                                     even.o slist.o randomart.o log.o zip.o debruijn.o utf8.o strbuf.o lib.o name.o spaces.o signal.o syscmd.o diff.o bdiff.o stack.o queue.o t                                                                                                                                     ree.o des.o idpool.o punycode.o ../../shlr/sdb/src/buffer.o ../../shlr/sdb/src/cdb.o ../../shlr/sdb/src/cdb_make.o ../../shlr/sdb/src/ht.o                                                                                                                                      ../../shlr/sdb/src/sdbht.o ../../shlr/sdb/src/json.o ../../shlr/sdb/src/lock.o ../../shlr/sdb/src/ls.o ../../shlr/sdb/src/ns.o ../../shlr                                                                                                                                     /sdb/src/query.o ../../shlr/sdb/src/sdb.o ../../shlr/sdb/src/base64.o ../../shlr/sdb/src/disk.o ../../shlr/sdb/src/array.o ../../shlr/sdb/                                                                                                                                     src/fmt.o ../../shlr/sdb/src/match.o ../../shlr/sdb/src/num.o ../../shlr/sdb/src/util.o ../../shlr/sdb/src/journal.o ../../shlr/spp/spp.o                                                                                                                                            -fPIC /home/tzaoh/r2/libr/../shlr/zip/librz.a
../../shlr/spp/spp.o: En la función `cmd_to_str':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:17: referencia a `_popen' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:17:(.text+0x1b0): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_pop                                                                                                                                     en' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:22: referencia a `_pclose' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:22:(.text+0x1fa): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_pcl                                                                                                                                     ose' sin definir
../../shlr/spp/spp.o: En la función `spp_add':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:101: referencia a `_snprintf' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:101:(.text+0x4c1): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_sn                                                                                                                                     printf' sin definir
../../shlr/spp/spp.o: En la función `spp_trace':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:134: referencia a `_snprintf' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:134:(.text+0x5e6): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_sn                                                                                                                                     printf' sin definir
../../shlr/spp/spp.o: En la función `spp_pipe':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:320: referencia a `_popen' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:320:(.text+0xe17): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_po                                                                                                                                     pen' sin definir
../../shlr/spp/spp.o: En la función `spp_endpipe':
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:365: referencia a `_pclose' sin definir
/home/tzaoh/r2/libr/util/../../shlr/spp/p/spp.h:365:(.text+0xfe2): reubicación truncada para ajustar: R_X86_64_PC32 contra el símbolo `_pc                                                                                                                                     lose' sin definir
collect2: error: ld devolvió el estado de salida 1
make[2]: *** [../rules.mk:73: libr_util.dll] Error 1
make[2]: se sale del directorio '/home/tzaoh/r2/libr/util'
make[1]: *** [../rules.mk:59: all] Error 2
make[1]: se sale del directorio '/home/tzaoh/r2/libr/util'
make: *** [Makefile:50: all] Error 2

@radare
Copy link
Collaborator

radare commented Feb 11, 2017 via email

@Maijin
Copy link
Contributor

Maijin commented Feb 11, 2017

@Svenito

@Svenito
Copy link
Contributor

Svenito commented Feb 11, 2017

I'll see what I can do on my end, but I don't have a Windows box available atm

@radare
Copy link
Collaborator

radare commented Feb 11, 2017 via email

@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 11, 2017

Hi @Svenito, firstly if nec, I can test it. But if you want there are official free lite windows images on https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

@XVilka
Copy link
Contributor

XVilka commented Feb 13, 2017

For me it stops here. #6751
Please 1) tell which msys2 terminal you're running - msys2 or msys2 mingw-w64 2) provide the full log somewhere.

@Tzaoh
Copy link
Contributor Author

Tzaoh commented Feb 13, 2017

Hi @XVilka , my version is msys2 mingw-w64.
Full log:
http://pastebin.com/qAJegbXz

@radare
Copy link
Collaborator

radare commented Mar 10, 2017

wondering why people uses msys2

@radare radare modified the milestones: 1.4.0, 1.3.0 Mar 12, 2017
@radare radare modified the milestones: 1.5.0, 1.4.0, 9999 Apr 7, 2017
@XVilka
Copy link
Contributor

XVilka commented Mar 7, 2019

Closing becase of #9973

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildsystem Windows Microsoft Windows platform support issues
Projects
None yet
Development

No branches or pull requests

6 participants