Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Dec 2013 13:10:34 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Markiyan Kushnir <markiyan.kushnir@gmail.com>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: clang lacks undefined behavior sanitizer (ubsan) on FreeBSD?
Message-ID:  <0B8421FE-0481-4EAA-B89B-A1843F97AC5D@FreeBSD.org>
In-Reply-To: <CACvtUJcujNRgJAdh-TPXApQbrbKW5gEfdbakOQozfKdMt7Qyhw@mail.gmail.com>
References:  <CACvtUJcujNRgJAdh-TPXApQbrbKW5gEfdbakOQozfKdMt7Qyhw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_B651A417-FD9C-4D09-857C-FA565F60BA35
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 27 Dec 2013, at 12:52, Markiyan Kushnir <markiyan.kushnir@gmail.com> =
wrote:
> Trying to make benefit out of -fsanitize=3Dundefined and failing on
> 11-CURRENT r259742. A minimal test case:
>=20
> 13:45:tmp$ cat ttt.c
> #include <stdio.h>
>=20
> int
> main(void)
> {
>    int i, j =3D 0xffffffff;
>=20
>    for (i =3D 0; i < 2; ++i) {
>        j <<=3D 1;
>        printf("j=3D%x\n", j);
>    }
>    return 0;
> }
>=20
> 13:45:tmp$ clang -Qunused-arguments -fcolor-diagnostics -g -O0
> -fsanitize=3Dundefined -Wall -Wextra -Werror -std=3Dc99  ttt.c
> /tmp/ttt-RJPqDj.o: In function `main':
> /tmp/ttt.c:9: undefined reference to =
`__ubsan_handle_shift_out_of_bounds'
> /tmp/ttt.c:8: undefined reference to `__ubsan_handle_add_overflow'
> clang: error: linker command failed with exit code 1 (use -v to see =
invocation)
>=20
> The ports version (both clang33 and clang34) neither seems to take
> care of it, as I could see in
> llvm.src/tools/clang/runtime/compiler-rt/Makefile
>=20
> Am I missing anything?

You are not missing anything, the sanitizers have simply not been ported
yet.  This is a nice project for a New Year's resolution. :-)

-Dimitry


--Apple-Mail=_B651A417-FD9C-4D09-857C-FA565F60BA35
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)

iEYEARECAAYFAlK9bkQACgkQsF6jCi4glqO+0gCgzJEntT2Mz5fLm4M6QiRhgO6q
pBAAoKmJRqS149tsye17NgzyxLE69eTd
=099m
-----END PGP SIGNATURE-----

--Apple-Mail=_B651A417-FD9C-4D09-857C-FA565F60BA35--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0B8421FE-0481-4EAA-B89B-A1843F97AC5D>