From patchwork Thu Sep 2 15:50:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1523832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Ed2KJJuO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H0lmY2MpTz9sVw for ; Fri, 3 Sep 2021 01:52:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23A153851C3B for ; Thu, 2 Sep 2021 15:52:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23A153851C3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1630597931; bh=NoY/F3BDMQsoIGf0hVHLvkT9afUPl4Rj7xW19tSPRpc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Ed2KJJuO+Kx2HtVvNeSckFWnRi84aknBYrufLSF3iUWYVEFSFzVTVNUc7YGOWBrTC rwrm0IIcu5Uq5JrsJyUTE1+WVYF3K20NFpqV/z/7pB1PZ3xRWpStmFsVqlnMEnsKsM VkSJ2Q3rQHZD/DItp03pRJXPQ/8LaY0wM88W9MhY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 1A52438515D5 for ; Thu, 2 Sep 2021 15:50:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A52438515D5 Received: by mail-pl1-x630.google.com with SMTP id v1so1460522plo.10 for ; Thu, 02 Sep 2021 08:50:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NoY/F3BDMQsoIGf0hVHLvkT9afUPl4Rj7xW19tSPRpc=; b=PKfeZ5eTsTFt+aCHpmXfamwOV3WRn4m9fqdYEsxwcYqI6JPyjGsNzgnRMKMgZh2opo gDXbpprTS2HVVPat+bnRt/6fiYe6CZtdUKyktKKAyb1E3eu8hwbXNmy2EiJ2psJhi5I2 fVAgHKELrRJG6OyZhedYbNkfGaX5KFTdLFPNQ2xxBL5BzIyspyijnqDF6cEwyLOjL7W0 XWI9KULXuVAOx0c51RI/x5sCvKcKF7vszHXEH4djG+nsGZZuPkdk7yuGsAhVx2SivlUO DRMeZdMk4EW1Fh4MjLnqrouOuRwQSD2QcA10TSy5OOfinv6NFku6WZ1oX9b7sYN3pPNE 4NVg== X-Gm-Message-State: AOAM530WyTyd11XIsx6bEIHx9LBaKyPkSOZWQkJM+Q+Od3kbAfUyQfKD QsHrEEqycAEty5UuuoPbQlYmiD0UyoI= X-Google-Smtp-Source: ABdhPJwpIeKjAURqJKxJV/NDb+EPusD0r/x74AhEBshow2j5y3I4XASs0yjdSfiz+BaW1gUd2NOkqQ== X-Received: by 2002:a17:902:7401:b0:131:2333:1a34 with SMTP id g1-20020a170902740100b0013123331a34mr3575560pll.58.1630597846919; Thu, 02 Sep 2021 08:50:46 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id x19sm2860357pfa.104.2021.09.02.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 08:50:46 -0700 (PDT) Received: from gnu-cfl-2.. (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 8CC28C063C; Thu, 2 Sep 2021 08:50:45 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 4/4] libffi: Integrate testsuite with GCC testsuite Date: Thu, 2 Sep 2021 08:50:45 -0700 Message-Id: <20210902155045.2620513-5-hjl.tools@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902155045.2620513-1-hjl.tools@gmail.com> References: <20210902155045.2620513-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3031.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" * testsuite/lib/libffi.exp (load_gcc_lib): Load library from GCC testsuite. Load target-supports.exp and target-supports-dg.exp. (libffi-init): Use libraries in GCC build tree. (libffi_target_compile): Link with -lstdc++ for C++ sources. --- libffi/testsuite/lib/libffi.exp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp index 4f4dd48d2c6..d8bf6269a36 100644 --- a/libffi/testsuite/lib/libffi.exp +++ b/libffi/testsuite/lib/libffi.exp @@ -15,12 +15,15 @@ # . proc load_gcc_lib { filename } { - global srcdir - load_file $srcdir/lib/$filename + global srcdir loaded_libs + load_file $srcdir/../../gcc/testsuite/lib/$filename + set loaded_libs($filename) "" } load_lib dg.exp load_lib libgloss.exp +load_gcc_lib target-supports.exp +load_gcc_lib target-supports-dg.exp load_gcc_lib target-libpath.exp load_gcc_lib wrapper.exp @@ -277,6 +280,7 @@ proc libffi-init { args } { global srcdir global blddirffi global objdir + global blddircxx global TOOL_OPTIONS global tool global libffi_include @@ -285,13 +289,13 @@ proc libffi-init { args } { global ld_library_path global compiler_vendor - if ![info exists blddirffi] { - set blddirffi [pwd]/.. - } - + set blddirffi [lookfor_file [get_multilibs] libffi] verbose "libffi $blddirffi" + set blddircxx [lookfor_file [get_multilibs] libstdc++-v3] + verbose "libstdc++ $blddircxx" + + set compiler_vendor "gnu" - # Which compiler are we building with? if { [string match $compiler_vendor "gnu"] } { set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { @@ -320,6 +324,8 @@ proc libffi-init { args } { # add the library path for libffi. append ld_library_path ":${blddirffi}/.libs" + # add the library path for libstdc++ as well. + append ld_library_path ":${blddircxx}/src/.libs" verbose "ld_library_path: $ld_library_path" @@ -332,6 +338,7 @@ proc libffi-init { args } { if { $libffi_dir != "" } { set libffi_dir [file dirname ${libffi_dir}] set libffi_link_flags "-L${libffi_dir}/.libs" + lappend libffi_link_flags "-L${blddircxx}/src/.libs" } set_ld_library_path_env_vars @@ -398,9 +405,8 @@ proc libffi_target_compile { source dest type options } { lappend options "libs= -lpthread" } - # this may be required for g++, but just confused clang. if { [string match "*.cc" $source] } { - lappend options "c++" + lappend options "ldflags=-lstdc++" } if { [string match "arc*-*-linux*" $target_triplet] } {