From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) by sourceware.org (Postfix) with ESMTPS id AD2E83858D20 for ; Sun, 28 Apr 2024 12:21:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD2E83858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-online.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD2E83858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.25.134.18 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714306886; cv=none; b=xWCqX+I8KYHJ2Nn/rMY8ztLeAldDoSpVSfOgytgC/G65xdqFX2CP4nqfmlieuqBQEdp5vrsXCH4J5C0c0r1lpsqeDfbop4ypnK2hhWSFmSHBUcVhBPPNZNkXrqV1+JX+rHzpHWxUVknM9QPCXzhfpftin2yT1V2zgLB6sOW5S3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714306886; c=relaxed/simple; bh=qiUutSfuVtYuwUzp11CETXCd2CZ2xL2PUaIVy+5HDUU=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=niIlXMs9AdxRCx6gEt5Oa+7m6Vbr+ab3hlYatvDug5lo5fsQ4OSvX8PFGXqQwIASF8QKorrC3T/poaWs/d4iHR0sRaQmhwR6C8EvjCvLQ1mQAhqMNu+2W84KeMY/Cj/WCfIECAdWKLhWYbTyi2/jsGe3HarpJDuHCcllQHtUyRM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fwd84.aul.t-online.de (fwd84.aul.t-online.de [10.223.144.110]) by mailout04.t-online.de (Postfix) with SMTP id E465449CC for ; Sun, 28 Apr 2024 14:21:22 +0200 (CEST) Received: from [192.168.2.101] ([79.230.172.235]) by fwd84.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1s13Ww-1F2zcO0; Sun, 28 Apr 2024 14:21:18 +0200 Subject: Re: [PATCH cygport] Increase _FORTIFY_SOURCE level from 2 to 3 in CFLAGS To: cygwin-apps@cygwin.com References: <555afa57-856c-30b7-9a81-2c491ae19b2f@t-online.de> <87plu9iy8b.fsf@Gerda.invalid> Reply-To: cygwin-apps@cygwin.com From: Christian Franke Message-ID: <5804ff70-6337-23c5-b391-3481715495c0@t-online.de> Date: Sun, 28 Apr 2024 14:21:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 SeaMonkey/2.53.16 MIME-Version: 1.0 In-Reply-To: <87plu9iy8b.fsf@Gerda.invalid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TOI-EXPURGATEID: 150726::1714306878-EB7FDDF1-AABC32C1/0/0 CLEAN NORMAL X-TOI-MSGID: 07afefb1-cfbe-49fb-83fb-8de6856570e3 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: ASSI via Cygwin-apps wrote: > Christian Franke via Cygwin-apps writes: >> _FORTIFY_SOURCE=3 is supported by Cygwin 3.5.0 headers and Cygwin gcc >> 13.2.1 test release. >> >> Silently falls back to level 2 if level 3 is unsupported (older >> headers or gcc) or to level 0 if unsupported at all (C++, clang). > Well, if only that was the caseā€¦ > > --8<---------------cut here---------------start------------->8--- > from /usr/include/w32api/windows.h:9, > from /mnt/share/cygpkgs/libarchive/libarchive.x86_64/src/libarchive-3.7.4/test_utils/test_common.h:88, > from /mnt/share/cygpkgs/libarchive/libarchive.x86_64/src/libarchive-3.7.4/tar/test/test.h:38, > from /mnt/share/cygpkgs/libarchive/libarchive.x86_64/src/libarchive-3.7.4/tar/test/test_extract_tar_lrz.c:25: > /usr/include/w32api/_mingw_mac.h:319:8: warning: #warning Using _FORTIFY_SOURCE=2 (level 3 requires __builtin_dynamic_object_size support) [-Wcpp] > 319 | # warning Using _FORTIFY_SOURCE=2 (level 3 requires __builtin_dynamic_object_size support) > --8<---------------cut here---------------end--------------->8--- > > Can't we conditiohnalize this to depend on the actual compiler support? This is a bogus warning. Sorry, my bad. In my contribution of _FORTIFY_SOURCE support to MinGW-w64 from 2019, I didn't realize that these warnings also appear if only Win32 API includes (windows.h, ...) are used. The related internal macros have only an effect if MinGW-w64 runtime includes (stdio.h, string.h, ...) are used. Meantime this has been fixed upstream: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/f8e088e -- Regards, Christian