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

Build failures on os x for 2.9.0 #175

Closed
jrozner opened this Issue Oct 7, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@jrozner

jrozner commented Oct 7, 2018

In attempting to update the version in Homebrew I've run into some linking failures. Homebrew/homebrew-core#32335. When testing on linux everything seems to build and link fine.

I don't have the build log from their CI server but I was able to get similar failures on a local build using the same steps the formula uses and this is the full output. It looks like autotools might not be resolving some of the paths correctly.

for a in  yara/yara libr/asm/p libr/anal/p ; do \
	( cd $a ; ./configure --prefix=/Users/joe/r2 ; /Applications/Xcode.app/Contents/Developer/usr/bin/make ) ; \
	done
checking build system type... x86_64-unknown-darwin
checking host system type... x86_64-unknown-darwin
checking target system type... x86_64-unknown-darwin
checking for working directories... current
using prefix '/Users/joe/r2'
checking for c compiler... gcc
checking for libyara ... yes
Using PKGCONFIG: pkg-config
checking pkg-config flags for yara... no
This package is required
make[1]: *** No targets specified and no makefile found.  Stop.
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../arch/x86 -I../arch/x86/bea/ -I../arch/x86/bea/src -I../arch/x86/bea/include -DUint64=uint64_t -I../arch/swf -Iarch/vc4/libvc4/ -Iarch/include/ -I../arch/pyc -I../arch/x86/zyan/include -I../arch/evm   -c -o asm_x86_udis.o asm_x86_udis.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
asm_x86_udis.c:59:11: error: passing 'RStrBuf' to parameter of incompatible type
      'const void *'
        strncpy (op->buf_asm, ud_insn_asm (&d), R_ASM_BUFSIZE-1);
                 ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:124:62: note:
      expanded from macro 'strncpy'
  ...__builtin___strncpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                                                ^~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:39:54: note:
      expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIF...
                                                     ^~~~~~
asm_x86_udis.c:60:13: error: subscripted value is not an array, pointer, or
      vector
        op->buf_asm[R_ASM_BUFSIZE-1] = 0;
        ~~~~~~~~~~~^~~~~~~~~~~~~~~~
asm_x86_udis.c:61:26: error: passing 'RStrBuf' to parameter of incompatible type
      'const char *'
        if (opsize<1 || strstr (op->buf_asm, "invalid"))
                                ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/string.h:89:26: note:
      passing argument to parameter '__big' here
char    *strstr(const char *__big, const char *__little);
                            ^
asm_x86_udis.c:65:17: error: passing 'RStrBuf' to parameter of incompatible type
      'const char *'
                if (!strncmp (op->buf_asm, "je ", 3)) {
                              ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/string.h:84:26: note:
      passing argument to parameter '__s1' here
int      strncmp(const char *__s1, const char *__s2, size_t __n);
                             ^
asm_x86_udis.c:66:12: error: passing 'RStrBuf' to parameter of incompatible type
      'const void *'
                        memcpy (op->buf_asm, "jz", 2);
                                ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:62:62: note:
      expanded from macro 'memcpy'
  ...__builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                                ^~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:55: note:
      expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                      ^~~~~~
asm_x86_udis.c:67:24: error: passing 'RStrBuf' to parameter of incompatible type
      'const char *'
                } else if (!strncmp (op->buf_asm, "jne ", 4)) {
                                     ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/string.h:84:26: note:
      passing argument to parameter '__s1' here
int      strncmp(const char *__s1, const char *__s2, size_t __n);
                             ^
asm_x86_udis.c:68:12: error: passing 'RStrBuf' to parameter of incompatible type
      'const void *'
                        memcpy (op->buf_asm, "jnz", 3);
                                ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_string.h:62:62: note:
      expanded from macro 'memcpy'
  ...__builtin___memcpy_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                                                ^~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_common.h:38:55: note:
      expanded from macro '__darwin_obsz0'
#define __darwin_obsz0(object) __builtin_object_size (object, 0)
                                                      ^~~~~~
asm_x86_udis.c:82:12: warning: incompatible function pointer types initializing
      'RAsmModifyCallback' (aka 'bool (*)(struct r_asm_t *, unsigned char *,
      int, unsigned long long)') with an expression of type 'int (*)(RAsm *,
      unsigned char *, int, unsigned long long)' (aka 'int (*)(struct r_asm_t *,
      unsigned char *, int, unsigned long long)')
      [-Wincompatible-function-pointer-types]
        .modify = &modify,
                  ^~~~~~~
1 warning and 7 errors generated.
make[1]: *** [asm_x86_udis.o] Error 1
make[1]: r2: Command not found
make[1]: r2: Command not found
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o anal_x86_bea.o anal_x86_bea.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o ../../asm/arch/x86/bea/BeaEngine.o ../../asm/arch/x86/bea/BeaEngine.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
In file included from ../../asm/arch/x86/bea/BeaEngine.c:49:
../../asm/arch/x86/bea/src/Includes/instr_set/opcodes_SSE.c:19:1: warning: '/*'
      within block comment [-Wcomment]
/* ====================================================================
^
1 warning generated.
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/ -o anal_x86_bea.dylib anal_x86_bea.o ../../asm/arch/x86/bea/BeaEngine.o
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o anal_x86_simple.o anal_x86_simple.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o ../arch/x86/dislen/dislen.o ../arch/x86/dislen/dislen.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc  -L../../anal -L../../reg -L../../lib -L../../syscall -L../../diff -L/Users/joe/r2/lib -lr_core -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_io -lr_socket -lr_magic -lr_crypto -lr_hash -lr_util -ldl -L../../util -L../../lib  -lr_util \
		-I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/ -o anal_x86_simple.dylib anal_x86_simple.o ../arch/x86/dislen/dislen.o
ld: warning: directory not found for option '-L../../reg'
ld: warning: directory not found for option '-L../../lib'
ld: warning: directory not found for option '-L../../syscall'
ld: warning: directory not found for option '-L../../diff'
ld: warning: directory not found for option '-L../../util'
ld: warning: directory not found for option '-L../../lib'
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o anal_x86_udis.o anal_x86_udis.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
In file included from anal_x86_udis.c:10:
../../asm/arch/x86/udis86/esil.h:5:9: warning: 'esilprintf' macro redefined
      [-Wmacro-redefined]
#define esilprintf(op, fmt, arg...) snprintf (op->esil, sizeof (op->esil...
        ^
/Users/joe/r2/include/libr/r_anal.h:25:9: note: previous definition is here
#define esilprintf(op, fmt, ...) r_strbuf_setf (&op->esil, fmt, ##__VA_ARGS__)
        ^
1 warning generated.
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o esil_x86_udis.o esil_x86_udis.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
make[1]: r2: Command not found
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/ -L/Users/joe/r2/lib -lr_core -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_io -lr_socket -lr_magic -lr_crypto -lr_hash -lr_util -ldl -L../../util -L../../lib  -lr_util  -lr_reg -lr_anal -lr_util \
		../../asm/arch/x86/udis86/*.c -o anal_x86_udis. anal_x86_udis.o esil_x86_udis.o
ld: warning: directory not found for option '-L../../util'
ld: warning: directory not found for option '-L../../lib'
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o anal_m68k_net.o anal_m68k_net.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc  -L/Users/joe/r2/lib -lr_core -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_io -lr_socket -lr_magic -lr_crypto -lr_hash -lr_util -ldl -L../../util -L../../lib  -lr_util -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/ -o anal_m68k_net.dylib anal_m68k_net.o
ld: warning: directory not found for option '-L../../util'
ld: warning: directory not found for option '-L../../lib'
gcc -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/   -c -o anal_evm.o anal_evm.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc  -L/Users/joe/r2/lib -lr_core -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_io -lr_socket -lr_magic -lr_crypto -lr_hash -lr_util -ldl -L../../util -L../../lib  -lr_util -I/Users/joe/r2/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1 -I../../asm/arch/x86/bea/ -I../../asm/arch/x86/bea/src -I../../asm/arch/x86/bea/include -DUint64=uint64_t -I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1 -I../../asm/arch/evm/ -o anal_evm.dylib anal_evm.o -ljansson
ld: warning: directory not found for option '-L../../util'
ld: warning: directory not found for option '-L../../lib'
Undefined symbols for architecture x86_64:
  "_opcodes", referenced from:
      _evm_oplen in anal_evm.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [anal_evm.dylib] Error 1
make: *** [all] Error 2
@jrozner

This comment has been minimized.

jrozner commented Oct 16, 2018

Just verified that this is still broken in the 3.0.0 release as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment