From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 27 11:52:31 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D93C10F for ; Fri, 27 Dec 2013 11:52:31 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39D4E1988 for ; Fri, 27 Dec 2013 11:52:31 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id y10so8229115wgg.24 for ; Fri, 27 Dec 2013 03:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=fItzPWmo8fOk7OX4zZ9P8inITTFvelkPmHmpifuyFiY=; b=HveVZ2JMkGWUc6p3sdDc9xvYF6BdHfJSYKpUM1wqBsaHohcNbeHAktpWaOMYkh4Y70 KzheeIbNPKNDZR+2aK3znRHEruUKXpRH9+NEAlVUpapmorJdat48B5hn/h6W6Gj5g1ME NNuFXSa8HGFJTe8yGnH6ba2PodobYZTXqV2MYk9P+QzyAXQCsMjhL6bZiDYY+AqfZazW aRuBh2JkeDWRJpDmVB7xSiPnkdbss8lCtwWDIHb0xKGPns7M5k8j2EUk4uEAV7MZYZEI lf+rtxB4Iz5FTd0lONcByHJ9oQOnotLlAqWEmA6IPQSQr2ku/S2eXx//6Dbi8isqESpK A0/w== MIME-Version: 1.0 X-Received: by 10.180.20.100 with SMTP id m4mr31838047wie.32.1388145149672; Fri, 27 Dec 2013 03:52:29 -0800 (PST) Received: by 10.227.226.12 with HTTP; Fri, 27 Dec 2013 03:52:29 -0800 (PST) Date: Fri, 27 Dec 2013 13:52:29 +0200 Message-ID: Subject: clang lacks undefined behavior sanitizer (ubsan) on FreeBSD? From: Markiyan Kushnir To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Dec 2013 11:52:31 -0000 Trying to make benefit out of -fsanitize=undefined and failing on 11-CURRENT r259742. A minimal test case: 13:45:tmp$ cat ttt.c #include int main(void) { int i, j = 0xffffffff; for (i = 0; i < 2; ++i) { j <<= 1; printf("j=%x\n", j); } return 0; } 13:45:tmp$ clang -Qunused-arguments -fcolor-diagnostics -g -O0 -fsanitize=undefined -Wall -Wextra -Werror -std=c99 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) 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 Am I missing anything? -- Markiyan.