[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] Compiling against libwget built with ubsan
From: |
Avinash Sonawane |
Subject: |
[Bug-wget] Compiling against libwget built with ubsan |
Date: |
Tue, 29 Aug 2017 20:33:17 +0530 |
Hello!
$ cat foo.c
#include <stdio.h>
#include <wget.h>
int main(int argc, char **argv)
{
char foo[] = "FOO";
printf("%s\n", wget_strtolower(foo));
return 0;
}
$ gcc -lwget foo.c -o foo
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_divrem_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_add_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_negate_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_out_of_bounds_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_mul_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_vla_bound_not_positive_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_load_invalid_value_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_float_cast_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_type_mismatch_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_sub_overflow_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_nonnull_arg_abort'
//usr/local/lib/libwget.so: undefined reference to
`__ubsan_handle_shift_out_of_bounds_abort'
collect2: error: ld returned 1 exit status
If I compile libwget without --fsanitize-ubsan then the object files
get linked as expected. But how to use libwget when it's compiled with
ubsan?
PS - I know this is not a libwget question per-se. But a library
linker issue. Nevertheless, any pointers will be highly appreciated!
Regards,
Avinash Sonawane (rootKea)
PICT, Pune
https://rootkea.wordpress.com
- [Bug-wget] Compiling against libwget built with ubsan,
Avinash Sonawane <=