[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cygwin-apps
Subject:    Re: [PATCH cygport] Increase _FORTIFY_SOURCE level from 2 to 3 in CFLAGS
From:       Jon Turney via Cygwin-apps <cygwin-apps () cygwin ! com>
Date:       2024-04-30 22:19:47
Message-ID: a253fece-fc58-433c-a7c3-cc17b0ad6e2e () dronecode ! org ! uk
[Download RAW message or body]

On 28/04/2024 13:21, Christian Franke via Cygwin-apps wrote:
> 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

I guess that means we need an updated w32api-header package, with this 
patch added, if it's not yet in a release...


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic