qasan icon indicating copy to clipboard operation
qasan copied to clipboard

Build error on Ubuntu 16.04

Open stevenagy opened this issue 4 years ago • 2 comments

Andrea,

I'm trying to get QASAN installed on an Ubuntu 16.04 VM with clang, but while running ./build.py --cc clang --cxx clang++, I'm encountering the following error:

clang-8  -fPIC -shared -I ../include libqasan.c hooks.c malloc.c string.c uninstrument.c patch.c -o libqasan.so -ldl -pthread
patch.c:210:12: error: use of undeclared identifier 'explicit_bzero'; did you mean 'p_explicit_bzero'?
  HOTPATCH(explicit_bzero)
           ^~~~~~~~~~~~~~
           p_explicit_bzero
patch.c:194:59: note: expanded from macro 'HOTPATCH'
  if (p_## fn) __libqasan_patch_jump(p_## fn, (uint8_t*)&(fn)); \
                                                          ^
patch.c:210:3: note: 'p_explicit_bzero' declared here
  HOTPATCH(explicit_bzero)
  ^
patch.c:193:12: note: expanded from macro 'HOTPATCH'
  uint8_t* p_## fn = (uint8_t*)dlsym(libc, # fn); \
           ^
<scratch space>:62:1: note: expanded from here
p_explicit_bzero
^
1 error generated.
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 1
Traceback (most recent call last):
  File "./build.py", line 226, in <module>
    % (os.path.join(dir_path, "libqasan"), cross_cc, libqasan_cflags)) == 0 )
AssertionError

Any ideas?

stevenagy avatar May 21 '20 06:05 stevenagy

Seems that your libc is too old. Try to simply remove HOTPATCH(explicit_bzero) from libqasan/patch.c. This is weird btw, I have to insert an preprocessor check on the libc version.

andreafioraldi avatar May 21 '20 07:05 andreafioraldi

That worked, thanks!

stevenagy avatar May 21 '20 07:05 stevenagy