delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/05/13/13:06:23

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=rLjVnbCLrbNeMM9/
zo+pgiX2/f196gb2Xu22L7ZdFTlp2p9bIVbjnzTGyNCyRPRT+6BSVlylmn2pJDan
cJ0BMMMQ6AzjMPTdjuY5gyoiR8Jx4OpAdVLw2PSjKiT92jtouOuOQfYcVlm8HraJ
68+MoAim7e0KrHMjDgs6nw1WtXY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=mgASpW8QujQPjjpz+MIUeE
7STTg=; b=AE/1ePyIbETxN04tITlU+YvahWjdVpfJBuENBKgdiTHxFFLWxnDJ6q
F5wSmxplZ6YYuwYe/aqSfAT5IBELFGueLSKNO6yjX2B1SnKoB5OL89urMV9Ph4lx
1H1BbBNN5ApnJ1kjYPSS9Hq+Hf8HPgAK1EHt7Jx1ZZNvTf6HdboU8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=H*Ad:D*t-online.de, judge
X-HELO: mailout11.t-online.de
Subject: =?UTF-8?Q?Re:_/usr/include/ssp/wchar.h:78:1:_error:_unknown_type_na?= =?UTF-8?Q?me_=e2=80=98FILE=e2=80=99_=28during_cygport_package_build=29?=
To: cygwin AT cygwin DOT com
References: <95ce9d0aaca770f8e88d661cac91ce5d AT xs4all DOT nl>
From: =?UTF-8?Q?Hans-Bernhard_Br=c3=b6ker?= <HBBroeker AT t-online DOT de>
Message-ID: <8aee8ac8-ec33-295a-bf5f-e7e001be0fc4@t-online.de>
Date: Sun, 13 May 2018 19:05:52 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <95ce9d0aaca770f8e88d661cac91ce5d@xs4all.nl>
X-IsSubscribed: yes

Am 13.05.2018 um 18:01 schrieb waterlan:

> The C flag that triggers this option is -Wp,-D_FORTIFY_SOURCE=2.

That does look rather weird.  Why would one write that instead of just 
-D_FORTIFY_SOURCE=2 ?

Anyway, the test can be simplified quite a lot to:

hbbro AT NB4 ~/tmp
$ cat twchar.c
#include <wchar.h>



$ gcc -D_FORTIFY_SOURCE=1 -fstack-protector-strong -c twchar.c -O2 
-D_XOPEN_SOURCE
In file included from /usr/include/ssp/wchar.h:5:0,
                  from /usr/include/wchar.h:336,
                  from twchar.c:1:
/usr/include/ssp/wchar.h:78:1: error: unknown type name 'FILE'
  __ssp_decl(wchar_t *, fgetws, (wchar_t *__restrict __buf, int __wlen, 
FILE *__restrict __fp))
  ^
/usr/include/ssp/wchar.h:78:1: error: unknown type name 'FILE'
  __ssp_decl(wchar_t *, fgetws, (wchar_t *__restrict __buf, int __wlen, 
FILE *__restrict __fp))


All four of the GCC options have to be there to trigger this 
(_FORTIFY_SOURCE can be set to 2, for the same result).  Basically the 
SSP additions to <wchar.h> fail to compile, but only if the feature set 
has been restricted from the default by -D_XOPEN_SOURCE.  Ultimately 
this happens because the latter disables the typedef of FILE in 
/usr/include/wchar.h line 72 ff:

#if __POSIX_VISIBLE >= 200809 || _XSI_VISIBLE
/* As in stdio.h, <sys/reent.h> defines __FILE. */
#if !defined(__FILE_defined)
typedef __FILE FILE;
# define __FILE_defined
#endif
#endif

I don't know remotely enough about this SSP stuff to judge if that's 
even supposed to work in -D_XOPEN_SOURCE mode.  But as it is, it can't.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019