{"id":2231494,"url":"http://patchwork.ozlabs.org/api/patches/2231494/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/4879259.VLH7GnMWUR@fomalhaut/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<4879259.VLH7GnMWUR@fomalhaut>","list_archive_url":null,"date":"2026-04-30T18:58:59","name":"[Ada] Fix build of GNAT tools with coverage enabled","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a93b68ac6106f433b011753ad4696fc9c1d47124","submitter":{"id":78832,"url":"http://patchwork.ozlabs.org/api/people/78832/?format=json","name":"Eric Botcazou","email":"botcazou@adacore.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/4879259.VLH7GnMWUR@fomalhaut/mbox/","series":[{"id":502362,"url":"http://patchwork.ozlabs.org/api/series/502362/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=502362","date":"2026-04-30T18:58:59","name":"[Ada] Fix build of GNAT tools with coverage enabled","version":1,"mbox":"http://patchwork.ozlabs.org/series/502362/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2231494/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2231494/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=aIyfOUPG;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256\n header.s=google header.b=aIyfOUPG","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=adacore.com","sourceware.org; spf=pass smtp.mailfrom=adacore.com","server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.128.44"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g63Pk3Bldz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 04:59:36 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id DEF3C4371D50\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 18:59:34 +0000 (GMT)","from mail-wm1-f44.google.com (mail-wm1-f44.google.com\n [209.85.128.44])\n by sourceware.org (Postfix) with ESMTPS id 48C6E4310D6E\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 18:59:03 +0000 (GMT)","by mail-wm1-f44.google.com with SMTP id\n 5b1f17b1804b1-4893940bb5eso7950355e9.3\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 11:59:03 -0700 (PDT)","from fomalhaut.localnet ([2a01:e0a:107c:2f10:e654:e8ff:fe8f:2ce6])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48a8eb69800sm493845e9.2.2026.04.30.11.59.00\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 30 Apr 2026 11:59:01 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org DEF3C4371D50","OpenDKIM Filter v2.11.0 sourceware.org 48C6E4310D6E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 48C6E4310D6E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 48C6E4310D6E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777575543; cv=none;\n b=EAyQHW34NZ8H4y0NMbs9+bBqOXuyr91A4vBDt+xJJblTEdclmkv6rCpwovXlANoKeYwaXqBwT4kvRR58SWV3GPboe7YlEPk+JqqwqJHCGPe+PNu+bZqmEtapFSLJGWVYRFeBaXkVGYu3UWbE2/qqJxeZmLUnhUfX7rEAwwd08tY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777575543; c=relaxed/simple;\n bh=B0vBNXDbCmBMuF+edkbNwh82XwldH35wCpBMZBNze6E=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=qhuFJSazqutmFR1FRCldII9Vb3S4LqkGHGhiV4H920Nxzl0jhiRfV7UjFLw+uFboURVcBuE3p2oNKykFy/kAqK4ngobevrm4wLBv9XaI2+yYwDzVezu9v0NtywL4izMZY+TjvfezJW8jUvNQIxRWTTF+zR5wbdr74LkfJFzXemU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=adacore.com; s=google; t=1777575542; x=1778180342; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=/H/lf5LfaThnsDQ2cFUXApKjuypJ5BvauIOTQMh2ujo=;\n b=aIyfOUPGCeRfnJwisUAmFH8twrJWTHltsRj5WCN7wSF+ijfoqeUOFsQr3v7DjeXwd4\n gm7J/krT3rL+XCLfYviVV9ngxR47jf0GLlhCIJl8IkNN3jxDdr4LSH3D4EYlec5MVsbs\n nZv1IE77fyFHxCxF84w7VGtKBlkvc+r+UJeYf4gZOQKTUcFeTVz3MR+L8m0XK6bJv8MU\n SMwGj0ffGk5H2edK5qQBfizG2/CZR70bwPDRoOC0jx1U3Mq7N6Ip3PHvxoDgRxu7DMfq\n /FnfqqOs47zK6WYyKGRUO+Cc5M+ZXXwpUQqAX4UmQ2NT/aVzMl6brRiO9z4J37gQtxm3\n coLw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777575542; x=1778180342;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=/H/lf5LfaThnsDQ2cFUXApKjuypJ5BvauIOTQMh2ujo=;\n b=PaSND2r3tGwKB9z46C2SKfa7asFZoCmULyuWUpBoTyCvis3SJwhB9bkZNoSfxIj4Hy\n uq+9XeV1Fo9AmdaYIaE44OeoF6jMdss/u/WsBH9JF3O3a8zfWw8dtl7Vg/RcOJ8E3JDf\n oT5HpcQFNurZxefwOtmhYdmfv4QZmP8PIuJe1qvU6HGzvpOWf85HGCXikHHMo9W7xHBD\n GhIqAgVZNE68l/NxhK95LAtH/vxCyS6wHHs57/Vn1gx86ADk7tOPCYhQzvgcHG48nq11\n +t0DTWlg5iT9Nbk29O0yG6cgERnzrsF1EMiRhysH6hd470J23uHnJXbF1mEsOXesB2St\n 03+w==","X-Gm-Message-State":"AOJu0YzcWMmLyQVaQmJUa06tzkq0pE1X3MlAKoSn6DXrjWTcVob1/aui\n u47XQA9+yuSGBbIgmZZOmKurqv0Q1XUJwjUsgomE7Zkk8dXpV1gspnx5+XYHnuL+qdY6gsD4dyW\n rNM4=","X-Gm-Gg":"AeBDieswcGN5JjpwvZAx/kp3xQkNJvRu8HXYxVzcoaX4BEQ4XWD73pPaysN/6joIJ1F\n RFJf7nhTae46xWGyuuCfSjHbOVMrlpw8uEdcqJndf4RKq28pYTuribZyHuntDB3MJQiIyK8mngn\n wSIvs+QHacoCeR+ITl2MhV7+zpYkHAOOiw4y09Ln1ub7qe42/+jllU3EpfrDb8Z4FEfJ/rfE5AG\n b94ctfUsC/XplMSwvRGegbVjiY6JCnhmL8eyy7FM7OpxwqlhDr4f/xqQ2PKmRUJqMfCC/diUjIL\n 9mCzXN3RrqmngsL7jlbZwHnZ5g/fwA4rY/fkJhWzQ38Urntix/fgu5BWGysU4Q9V191yd3IT6yQ\n 9w5992IMERKv6UPla+0UxLEtgyiDY7hLgePUCjDMkRt+eJZKaM+AhIa3ETwYXO9sg88bxu99kMG\n zin+n3uMQTwBzxUsv4teRYky/1qKhK3BTFj6gSApeBWnkJLJU=","X-Received":"by 2002:a05:600c:a30b:b0:48a:58ae:993b with SMTP id\n 5b1f17b1804b1-48a8451cfe2mr52475785e9.16.1777575542073;\n Thu, 30 Apr 2026 11:59:02 -0700 (PDT)","From":"Eric Botcazou <botcazou@adacore.com>","X-Google-Original-From":"Eric Botcazou <ebotcazou@adacore.com>","To":"gcc-patches@gcc.gnu.org","Subject":"[Ada] Fix build of GNAT tools with coverage enabled","Date":"Thu, 30 Apr 2026 20:58:59 +0200","Message-ID":"<4879259.VLH7GnMWUR@fomalhaut>","MIME-Version":"1.0","Content-Type":"multipart/mixed; boundary=\"nextPart11739293.NyiUUSuA9g\"","Content-Transfer-Encoding":"7Bit","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Tested on x86-64/Linux, applied on the mainline (as obvious for first part).\n\n\n2026-04-30  Eric Botcazou  <ebotcazou@adacore.com>\n\n\t* Makefile.in (COVERAGE_FLAGS): Remove obsolete comment.\n\n\n2026-04-30  Eric Botcazou  <ebotcazou@adacore.com>\n\n\tPR ada/110336\n\t* gcc-interface/Makefile.in (COVERAGE_FLAGS): New variable\n\t(GCC_LINK_FLAGS): Add $(COVERAGE_FLAGS).\n\t(ALL_CFLAGS): Likewise.\n\t(enable_host_pie): Fold into single use.","diff":"diff --git a/gcc/Makefile.in b/gcc/Makefile.in\nindex 0fd619140d2..0f0efcda395 100644\n--- a/gcc/Makefile.in\n+++ b/gcc/Makefile.in\n@@ -162,9 +162,7 @@ PICFLAG = @PICFLAG@\n # The linker flag for the above.\n LD_PICFLAG = @LD_PICFLAG@\n \n-# Flags to determine code coverage. When coverage is disabled, this will\n-# contain the optimization flags, as you normally want code coverage\n-# without optimization.\n+# Flags to determine code coverage.\n COVERAGE_FLAGS = @coverage_flags@\n coverageexts = .{gcda,gcno}\n \ndiff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in\nindex d0500c727c0..32b394f66e1 100644\n--- a/gcc/ada/gcc-interface/Makefile.in\n+++ b/gcc/ada/gcc-interface/Makefile.in\n@@ -93,10 +93,14 @@ RANLIB_FLAGS = @ranlib_flags@\n AWK = @AWK@\n \n # Should we build position-independent host code?\n-enable_host_pie = @enable_host_pie@\n PICFLAG = @PICFLAG@\n+\n+# The linker flag for the above.\n LD_PICFLAG = @LD_PICFLAG@\n \n+# Flags to determine code coverage.\n+COVERAGE_FLAGS = @coverage_flags@\n+\n SHELL = @SHELL@\n PWD_COMMAND = $${PWDCMD-pwd}\n # How to copy preserving the date\n@@ -204,12 +208,12 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))\n # Link flags used to build gnat tools.  By default we prefer to statically\n # link with libgcc to avoid a dependency on shared libgcc (which is tricky\n # to deal with as it may conflict with the libgcc provided by the system).\n-GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc\n+GCC_LINK_FLAGS = -static-libstdc++ -static-libgcc $(COVERAGE_FLAGS)\n \n # We need to link against libbacktrace because diagnostics use it\n LIBBACKTRACE = ../../../libbacktrace/.libs/libbacktrace.a\n \n-ifneq ($(enable_host_pie),)\n+ifeq (@enable_host_pie@,yes)\n LIBIBERTY = ../../../libiberty/pic/libiberty.a\n LIBGNAT   = ../$(RTSDIR)/libgnat_pic.a\n else\n@@ -245,7 +249,7 @@ all.indirect: Makefile ../gnat1$(exeext)\n INTERNAL_CFLAGS = @CROSS@ -DIN_GCC\n \n # This is the variable actually used when we compile.\n-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)\n+ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS)\n \n # Likewise.\n ALL_CPPFLAGS = $(CPPFLAGS)\n","prefixes":["Ada"]}