From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id CB3023896C07 for ; Tue, 28 Mar 2023 23:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB3023896C07 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x42e.google.com with SMTP id bt19so9145862pfb.3 for ; Tue, 28 Mar 2023 16:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680046553; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=2bBYUIjovCCPOQqolmFmow3m4rDrMlcn8UmCUssCjVw=; b=VebB7G6qBhx/CJZHyk/VJvvuecsaSzlBx8ArmwY8XjndrIlvafuQxcCSlkTUxIoRIx e/I+uaedmBPPbC0nHdpi0CJTqDQmmuJ7CvE6KA5yei/PTxvTGwoxG/y4JCerhThB1VfC t1KWqfGpwDxqt76yuHihZXEjYrt9Blq0GL43NVNe5HfpTlv+6uH8ff7U5gGtGo+P3DkW cqcdfyv4z3OlhIkgx6XVOttdDLymiywX3FbbjjIklum5/lp2TihmptxedXIuXF/TxwGX M0xRomh1x5Krbxjl4JjmbSaDhAeOHm0+7byxvG67g5nIWvMHNlhJ1AeLcU979p9J1e2w /yQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680046553; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2bBYUIjovCCPOQqolmFmow3m4rDrMlcn8UmCUssCjVw=; b=I6xALwKpwOx3rf2GejJwJ1q5psn6CBYTsVVwKihoFhgvjvxL9lMawFT86HOSHKD6us vBFk5GzK2L3oQ+hpqKskdpcuzMOm5zM9h9eSzneB14o3LZ42eLTyFqwlkNnUlDwQD+zP SU4N/UdYKCK+h0zgT7rJkUYyUl0phb19+eEUJEZ3whxrcAi14+EyfR6suqfHpX+zcnl/ 2KKEa13V6TCnAKspImnfAN/UjIi8fr7kU9vttHQnpVuA7b/GGVNUMtm9UYLT5sjq+YeV mtHOAbhLpfkRjJaP9tAM7Yz6v3JfrCi02Kgj/pzyaXTlIIpPHAj3ADbifKTX6V8kIPxL /2YA== X-Gm-Message-State: AAQBX9fvYkho+uJneNjvq0C97k5nnOw0+IdmMrMJ00+TTWy50dY44wsJ dzfLICeQSjcxObgwNlXyInRlwffszi0= X-Google-Smtp-Source: AKy350aJCXsSCu0zjcGxMTdwc0H500RwKBZrWaNOfTGURWHQODW8JaAVAEQkJyUWB6LVp0x/SN0ctg== X-Received: by 2002:a62:585:0:b0:592:de72:4750 with SMTP id 127-20020a620585000000b00592de724750mr14568699pff.23.1680046552652; Tue, 28 Mar 2023 16:35:52 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id f19-20020aa78b13000000b0062cb3c8896dsm7335038pfd.142.2023.03.28.16.35.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 16:35:52 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 32F8D1142C5E; Wed, 29 Mar 2023 09:50:07 +1030 (ACDT) Date: Wed, 29 Mar 2023 09:50:07 +1030 From: Alan Modra To: binutils@sourceware.org Subject: ld testsuite CFLAGS_FOR_TARGET Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.1 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 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: run_host_cmd adds $gcc_B_opt and $ld_L_opt to the command line if it detects the program being run is a compiler. Since the program being run in lto.exp linking pr28138 is "sh", we need to add these by hand. This isn't exactly as run_host_cmd does, as it lacks reordering of any user -B option in $CC_FOR_TARGET, but it's better than ignoring gcc_B_opt. This fixes a mips64 testsuite fail. ld_compile adds CFLAGS_FOR_TARGET and other flags as well, so there is no need for the ld_compile command line to include CFLAGS_FOR_TARGET. Fixing this is just a tidy. * testsuite/ld-plugin/lto.exp: Add gcc_B_opt, CFLAGS_FOR_TARGET and $ld_L_opt to pr28138 link line. * testsuite/lib/ld-lib.exp (run_ld_link_tests): Don't pass unnecessary flags to ld_compile. (run_ld_link_exec_tests, run_cc_link_tests): Likewise. diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 6c1322e43e0..98e811177ef 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -773,7 +773,8 @@ run_cc_link_tests [list \ set exec_output [run_host_cmd "sh" \ "-c \"ulimit -n 20; \ - $CC_FOR_TARGET -Btmpdir/ld -o tmpdir/pr28138 \ + $CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \ + $ld_L_opt -o tmpdir/pr28138 \ tmpdir/pr28138.o tmpdir/pr28138.a\""] set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 47e86a7b27c..918464069a9 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -467,7 +467,6 @@ proc run_ld_link_tests { ldtests args } { global subdir global env global CC_FOR_TARGET - global CFLAGS_FOR_TARGET global runtests global exec_output @@ -534,7 +533,7 @@ proc run_ld_link_tests { ldtests args } { set objfile "tmpdir/$fileroot.o" if { [file extension $src_file] == ".c" } { set as_file "tmpdir/$fileroot.s" - if ![ld_compile "$CC_FOR_TARGET -S $CFLAGS_FOR_TARGET $cflags" $srcdir/$subdir/$src_file $as_file] { + if ![ld_compile "$CC_FOR_TARGET -S $cflags" $srcdir/$subdir/$src_file $as_file] { set is_unsupported 1 break } @@ -685,8 +684,6 @@ proc run_ld_link_exec_tests { ldtests args } { global env global CC_FOR_TARGET global CXX_FOR_TARGET - global CFLAGS_FOR_TARGET - global CXXFLAGS_FOR_TARGET global errcnt global exec_output global board_cflags @@ -753,9 +750,9 @@ proc run_ld_link_exec_tests { ldtests args } { lappend objfiles $objfile if { [ string match "c++" $lang ] } { - set cmd "$CXX_FOR_TARGET -c $CXXFLAGS_FOR_TARGET $cflags" + set cmd "$CXX_FOR_TARGET -c $cflags" } else { - set cmd "$CC_FOR_TARGET -c $CFLAGS_FOR_TARGET $cflags" + set cmd "$CC_FOR_TARGET -c $cflags" } if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { set failed 1 @@ -860,8 +857,6 @@ proc run_cc_link_tests { ldtests } { global env global CC_FOR_TARGET global CXX_FOR_TARGET - global CFLAGS_FOR_TARGET - global CXXFLAGS_FOR_TARGET global ar global exec_output global board_cflags @@ -950,9 +945,9 @@ proc run_cc_link_tests { ldtests } { lappend objfiles $objfile if { [ string match "c++" $lang ] } { - set cmd "$CXX_FOR_TARGET -c $CXXFLAGS_FOR_TARGET $cflags" + set cmd "$CXX_FOR_TARGET -c $cflags" } else { - set cmd "$CC_FOR_TARGET -c $CFLAGS_FOR_TARGET $cflags" + set cmd "$CC_FOR_TARGET -c $cflags" } if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { set failed 1 -- Alan Modra Australia Development Lab, IBM