From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id ED6A33858020 for ; Fri, 2 Feb 2024 15:49:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED6A33858020 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED6A33858020 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706889002; cv=none; b=ibEiA2PjI56F5/DRaGXINnwBRxICdfqxt/+yFc54TbVIGZV22x0ONfLvBi1fhX8dJtbdmHwFrqqW5RP9ytnT4Q4nu40jAbRtqVAhhfs7k40aHHruv5qq6Pen3h34Z1BjICip4/vpAlMnOS9nsCsPksWntkxnUBiDK1oc2qXf5Bo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706889002; c=relaxed/simple; bh=WRev1LD3hkaKhmpGy4Le0bWhgj3IR796xVlgmPESZUs=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ta73oe2bezBHSoyYsRjvLjAHumqzqHzjKMY0WV0qoPksbQxZR8LE2VVDBZ56YfDqlkAAr+2LlU5Znt4dfU4Vbw4iyMTc6ej1RoeYn2j93DUHF6lMvbW/Yontj5Yvl14C7GMP1RS+IwJu+bQyGIJOchPRvy7OVfyq4YxjbLycdRk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-51134caba39so1318279e87.0 for ; Fri, 02 Feb 2024 07:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706888998; x=1707493798; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FA5mTSsfRDFdgjPMb2JHBKaAzq2B/rWGxQ3LjCGtqF8=; b=X6O23qvTi3SYiywwI4FYUkUrwxZy9VhY5PoOcuVxpTkALFfmYwLYZuQjglCHP4+ebk BVpH8TBXB3Zt5O8jGjYrqI5LQBhFCvuLu6jQ6tGnicsbLT0Z8+7aHmrZwDB39PsOpGOR 6m7j/4aWYHOD8649jn9Y1U547iIert54ki4ncDhxfOL7n5pKi+JpwLVO2TQy5IHMDYi9 fOa+aB4r0BEDU9a44Fe2KvaCCpIIC0rFHRYO2fGONC33b/wqeEknAYyq5ZfTqBRZJMLc IUA/b0BzaHe0dr7vo0nUUhWUdIv1KF+hOTWPBRwkzqT0LVDw5zIjtlt7WN4F5k+xEPoY iM8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706888998; x=1707493798; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FA5mTSsfRDFdgjPMb2JHBKaAzq2B/rWGxQ3LjCGtqF8=; b=EDQOL8o+VTqVqUyfhN9f1vru9/j6cy7QBEatFo0mbbdGKJO9klLUtmz5WCrs1V1iq+ iJXvDeporq5yjNdl/o7ixt7GeIFkrDIRNnj3Uv5cr++8T6jgszq9HW6EQYTjQsrDNmod QoyM6TMt+JwqozwOHXxj6JbjTZsNR4ju6QwO8otrS6Wuc/EqyTdYXBTiSB9t/y37R45W 4zST8bvP/i0bYzXYd8H1sxccvJxSAbpXY5w2YCnjq5b0JrYNI276iC8Ib1LiZSQw2fIG ru4rYv4RXf3xEljI+xHwSlzHKReFW60XwXoWnJiipDrokNRu32VtRy4gCdB0QWx3pUA5 GEjA== X-Gm-Message-State: AOJu0Yx/4f+yRxSs8+EoBaZjtC70Lnh47amA9cqMc0k3NM42I0eYUiIa kYkhBGChQXxhus9MpwrQ4bBxnExd/aG4FNBopDm9xGbQ3ppgnxlM6WcOLIdf X-Google-Smtp-Source: AGHT+IEV2ozc7XA/iTFfIDeaxKZPFr3JygQH0Nhtw7XXl4iLzhl/hIQca2UDznTCrK9GwD0VnM0Cwg== X-Received: by 2002:ac2:48a7:0:b0:511:3bd1:11d with SMTP id u7-20020ac248a7000000b005113bd1011dmr427920lfg.36.1706888998030; Fri, 02 Feb 2024 07:49:58 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUBLGyPh7+VJeAJBk20pV1ztl8mQbSisrQmSk87zjGb+YwMfTkhLr6+KkBUbMZT3n6/jZlBE/0OvtX4QA8tIQlIlw== Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id k2-20020a056000004200b0033b08b9cd9dsm2197676wrx.79.2024.02.02.07.49.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 02 Feb 2024 07:49:57 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] testsuite, Darwin: Allow for undefined symbols in shared test. Date: Fri, 2 Feb 2024 15:49:56 +0000 Message-Id: <20240202154956.68679-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: tested on i686, x86_64 Darwin, x86_64, aarch64 linux, pushed to trunk, thanks, Iain --- 8< --- Darwin's linker defaults to error on undefined (which makes it look as if we do not support shared, leading to tests being marked incorrectly as unsupported). This fixes the issue by allowing the symbols used in the target supports test to be undefined. gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_shared): Allow the external symbols referenced in the test to be undefined. --- gcc/testsuite/lib/target-supports.exp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8aefb320d8c..f66dcaac7b8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1385,6 +1385,13 @@ proc check_effective_target_aarch64_tlsle32 { } { # emitted, 0 otherwise. proc check_effective_target_shared { } { + # Darwin's linker defaults to error on undefined (which makes it look as + # if we do not support shared) but we can tell it to allow the symbols used + # here to be undefined. + set extra_flags "" + if { [istarget *-*-darwin\[912\]*] } { + set extra_flags "-Wl,-U,_foo,-U,_bar" + } # Note that M68K has a multilib that supports -fpic but not # -fPIC, so we need to check both. We test with a program that # requires GOT references, and with a libc symbol that would @@ -1397,7 +1404,7 @@ proc check_effective_target_shared { } { char *baz (void) { return foo () + (char*) malloc (bar); } - } "-shared -fpic"] + } "-shared -fpic $extra_flags"] } # Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise. -- 2.39.2 (Apple Git-143)