From patchwork Fri Nov 3 17:22:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 834017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-465897-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZOCTlvC0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yT80W5w4Tz9s1h for ; Sat, 4 Nov 2017 04:22:34 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=lSVQJVkboqftWdj34mz/Z+AWmh/Zf/NWhp/WXKF3PEjTgALwcR560 FBMkLZSQqxH+g9yZqnLmrzfyl1VukNJyCc0ET/W8t+/rplCw1YinNoGFQ4T95jAs Xw0N0zgpJs4vGG5qvSsTrXnszQUADeUiu6SYMiFWbJsgwy7b4Y81y4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=eZsq6wi/51R6PHB9A6yA1EQAV0Q=; b=ZOCTlvC0lJtDumw67g3J 9YUrJAsl+QuTvY3RMR+TVKcEp4y4mwqUsgfrcARqss9PmCDVf6tSI3GfLPkauJZg RpThf25s5NcfzU1ZcjEDC+atsKcbtA/8A7v67mPLs8/t36FZB0jk8ZuNQVNEc7cM 37ZAKrJBHM42SoOGGtda/MI= Received: (qmail 101987 invoked by alias); 3 Nov 2017 17:22:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 101763 invoked by uid 89); 3 Nov 2017 17:22:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Alternate, realize, our X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 17:22:20 +0000 Received: from firstfloor.org (174-25-38-10.ptld.qwest.net [174.25.38.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 2CA5A86781 for ; Fri, 3 Nov 2017 18:22:15 +0100 (CET) Received: by firstfloor.org (Postfix, from userid 1000) id 09C7CA67A0; Fri, 3 Nov 2017 10:22:12 -0700 (PDT) Date: Fri, 3 Nov 2017 10:22:12 -0700 From: Andi Kleen To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix libsanitizer bootstrap with glibc 2.26 Message-ID: <20171103172212.y24p4olbg3cg6zs2@basil.nowhere.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) It looks like some non POSIX symbols got removed from the header files, which breaks the libsanitizer build. struct sigaltstack now only exists as stack_t (which is the offical POSIX name) __res_state typedef is now only struct __res_state This fixes bootstrap of trunk on a current opensuse tumbleweed system. I realize this is a downstream version, but fixing bootstrap is rather important. Now passes bootstrap with this patch. libsanitizer/: 2017-11-03 Andi Kleen * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc (TracerThread): Use stack_t instead of struct sigaltstack * tsan/tsan_platform_linux.cc (ExtractResolvFDs): Use struct __res_state instead of __res_state. diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc index 891386dc0ba..14dedcae64f 100644 --- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -273,11 +273,11 @@ static int TracerThread(void* argument) { // Alternate stack for signal handling. InternalScopedBuffer handler_stack_memory(kHandlerStackSize); - struct sigaltstack handler_stack; + stack_t handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; - internal_sigaltstack(&handler_stack, nullptr); + internal_sigaltstack((struct sigaltstack *)&handler_stack, nullptr); // Install our handler for synchronous signals. Other signals should be // blocked by the mask we inherited from the parent thread. diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc index 2ed5718a12e..6f972ab0dd6 100644 --- a/libsanitizer/tsan/tsan_platform_linux.cc +++ b/libsanitizer/tsan/tsan_platform_linux.cc @@ -287,7 +287,7 @@ void InitializePlatform() { int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX && !SANITIZER_ANDROID int cnt = 0; - __res_state *statp = (__res_state*)state; + struct __res_state *statp = (struct __res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i];