From patchwork Tue Nov 21 20:05:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 167920 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp884965vqb; Tue, 21 Nov 2023 12:06:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8bqgpQDA/jJgiVil5wYXyWf5lz4P1Sj/PvzCK473lLji+D2Vkb03a4nirbD3LJZ05eXus X-Received: by 2002:ad4:5f8c:0:b0:66d:44b6:8aa8 with SMTP id jp12-20020ad45f8c000000b0066d44b68aa8mr87303qvb.47.1700597164758; Tue, 21 Nov 2023 12:06:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700597164; cv=pass; d=google.com; s=arc-20160816; b=iUzo12fLFZj+4d7qSIgt9Yy06TJ38MKOGi6JC+3vcXcIwAl0vDjKl6zzkdTVRK7vno VdWFPQa48AB6YqZmnmO1jb4DcJ5OV+G3eKrRADitCeWk4PQ/42qc9mYFObUH3TS0W4gt OYdQcsm+dOFL9Ie+bP4T3DEX3JBkJJi3ibuOHRp7VTrFqvkLb4Ne5KcNMhue34iRslwx 8m1X0DMFCqoVk1hMjdw5vegOwKm7TdS9/kA0T0DHm4qE13YHqurTa7eEEByc7wHrVkCx za1qq+eAfk+g0uuyLR44GUwjW6ylYJKofJu8pEYEFyKZcUuIVo4zhbmiuq2+UGmfF7of PqyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Wje3vdwFXPm9zqJiTyN2pyZhMIJmphQwfWGBb5tvtVg=; fh=qxDtp6NquPk7LUYIoEJ6GgzNYWUTtxSuTFaafvkxt3s=; b=EhkAgfbWp5SeGeOc+kup9JrqZdqW2pRwFAkm3wBz+Ig0FeVOZP6xgWgt7vaY2jgDf1 5rDRyWBvNbHiep3sa6LeC0Z/AztSZl7kcs9+d97J5WXeXmx5R3KqOVSH7/1i15VDjWO/ SLhncCZPK1bbV3IIgYH0463ahjCo9jJM0szL4a2YiYInNhiIwapOMpcmFhRPmW1jxAhn PapdqOhc0RwgEKmJE270FGot3aSBSO98Td0Frz155Y9p+ls41juKQxI1ldQ0ilYOKhZX f+4blb516yX+/cvWsqHYRq/ozBubQ772OprIrNv+pbHgL5n8AVXq7fT4f2mm6XDEwE7q lrog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h4URLJ3Q; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l9-20020a0ce6c9000000b0066cffc19388si1400675qvn.321.2023.11.21.12.06.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 12:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h4URLJ3Q; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 860E23858C5F for ; Tue, 21 Nov 2023 20:06:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D4DB83858D35 for ; Tue, 21 Nov 2023 20:05:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4DB83858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D4DB83858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700597141; cv=none; b=o+QotYjDdqUSM9BEPIY0LvboESQ71+y6BMimJk+OcGauhQczbAioZjDf8ZTa7o/lFtdWRVUSgU+uq2KG8txbuAgs3LrOMjAl4IdTq30d9LTTFcQjYcJdTnvcRi1ygh8rXx07Kno5p2LUuVc+awmFpC0ld/JL3uujVh7B/EaLq1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700597141; c=relaxed/simple; bh=S7dc/c6VmA/snkEQxbyeHWJi1Du7/5aYWIuZzdoWErM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=tamgUPTqnu7lySWngVJUftEkmA5LUAfz8qutrfu6ZezVmRf9lb2aJvgqNWAlr2Pqm7Utb6tDVepRVTVmwthLF0QfIWsTbzOg4zSSrRU6K4946AUYCC3XHzKdfsNWzdGqGuMVGb0uJc9g9i0D5jRQooqrcKskzjVSztROTN3J7I8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700597139; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=Wje3vdwFXPm9zqJiTyN2pyZhMIJmphQwfWGBb5tvtVg=; b=h4URLJ3QUY9Ndi6N+3J+qTUncQK1Xk2sWgZQYSU2Fdwq3T31xHQ/v8B7wnmg7t8ObwUvKm pF2dK5Zf7BzAk+iPeivuyd4lsnfp2hlEOtyX3n0jj5y3jsu5DxVMIolvnAs+ARs/l/cBO1 URdKLDkozXsJLUMPX8yNtEn3uE3U4w0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-R2XC-MX4MRyi1B6-HLhSQg-1; Tue, 21 Nov 2023 15:05:37 -0500 X-MC-Unique: R2XC-MX4MRyi1B6-HLhSQg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 910DF85A58C; Tue, 21 Nov 2023 20:05:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53346C1596F; Tue, 21 Nov 2023 20:05:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3ALK5Ygg4135178 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 Nov 2023 21:05:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3ALK5Wg34135177; Tue, 21 Nov 2023 21:05:32 +0100 Date: Tue, 21 Nov 2023 21:05:32 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: Rainer Orth Subject: [committed] sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783205372899160478 X-GMAIL-MSGID: 1783205372899160478 Hi! Solaris as apparently doesn't accept %function and requires @function instead. This cherry-picks upstream commit. Bootstrapped/regtested on x86_64-linux and i686-linux and built tested on sparc-solaris2.11, committed to trunk as obvious. 2023-11-21 Jakub Jelinek PR sanitizer/112562 * sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision a855a16a02e76a0f4192c038bb64f3773947a2f7. * interception/interception.h: Likewise. Jakub --- libsanitizer/sanitizer_common/sanitizer_asm.h.jj 2023-11-15 17:19:11.507783822 +0100 +++ libsanitizer/sanitizer_common/sanitizer_asm.h 2023-11-20 18:16:48.740201609 +0100 @@ -62,7 +62,11 @@ #if !defined(__APPLE__) # define ASM_HIDDEN(symbol) .hidden symbol -# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function +# if defined(__arm__) || defined(__aarch64__) +# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function +# else +# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function +# endif # define ASM_SIZE(symbol) .size symbol, .-symbol # define ASM_SYMBOL(symbol) symbol # define ASM_SYMBOL_INTERCEPTOR(symbol) symbol --- libsanitizer/interception/interception.h.jj 2023-11-15 17:19:11.505783850 +0100 +++ libsanitizer/interception/interception.h 2023-11-20 18:16:48.736201664 +0100 @@ -185,6 +185,11 @@ const interpose_substitution substitutio # else # define __ASM_WEAK_WRAPPER(func) ".weak " #func "\n" # endif // SANITIZER_FREEBSD || SANITIZER_NETBSD +# if defined(__arm__) || defined(__aarch64__) +# define ASM_TYPE_FUNCTION_STR "%function" +# else +# define ASM_TYPE_FUNCTION_STR "@function" +# endif // Keep trampoline implementation in sync with sanitizer_common/sanitizer_asm.h # define DECLARE_WRAPPER(ret_type, func, ...) \ extern "C" ret_type func(__VA_ARGS__); \ @@ -196,7 +201,8 @@ const interpose_substitution substitutio __ASM_WEAK_WRAPPER(func) \ ".set " #func ", " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \ ".globl " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \ - ".type " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", %function\n" \ + ".type " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", " \ + ASM_TYPE_FUNCTION_STR "\n" \ SANITIZER_STRINGIFY(TRAMPOLINE(func)) ":\n" \ SANITIZER_STRINGIFY(CFI_STARTPROC) "\n" \ SANITIZER_STRINGIFY(ASM_TAIL_CALL) " __interceptor_" \