public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.10.0-0.1
Date: Thu, 25 Jan 2018 02:42:00 -0000	[thread overview]
Message-ID: <901aaf73-6eb9-207a-e6e7-6b900f844e02@cornell.edu> (raw)
In-Reply-To: <85d3c271-55c6-0002-42cd-f46ef588be4d@cygwin.com>

On 1/24/2018 7:16 PM, Yaakov Selkowitz wrote:
> On 2018-01-24 13:25, Ken Brown wrote:
>> On 1/20/2018 6:49 PM, Ken Brown wrote:
>>> On 1/20/2018 7:23 AM, Ken Brown wrote:
>>>> On 1/19/2018 10:27 PM, Ken Brown wrote:
>>>>> Here's another issue that's come up with _FORTIFY_SOURCE.  One of the
>>>>> emacs source files, fileio.c, makes use of a pointer to readlinkat.
>>>>> When _FORTIFY_SOURCE > 0, this leads to an "undefined reference to
>>>>> `__ssp_protected_readlinkat'" linking error.  Does this sound like
>>>>> something that will be fixed with the new gcc release?
>>>>
>>>> I got to this sooner than expected:
>>>>
>>>> $ cat ssp_test.c
>>>> #define  _FORTIFY_SOURCE 1
>>>> #include <unistd.h>
>>>> void foo (ssize_t (*preadlinkat) (int, char const *, char *, size_t));
>>>>
>>>> void baz ()
>>>> {
>>>>     foo (readlinkat);
>>>> }
>>
>> The following patch seems to fix the problem:
>>
>> -#define __ssp_inline extern __inline__ __attribute__((__always_inline__, __gnu_inline__))
>> +#define __ssp_inline extern __inline__ __attribute__((__always_inline__))
> 
> No, that would have other consequences:
> 
> https://gcc.gnu.org/onlinedocs/gcc/Inline.html
> 
>> I arrived at this by comparing Cygwin's ssp.h with NetBSD's, on which
>> Cygwin's was based, and I noticed that NetBSD didn't use __gnu_inline__.
> 
> The BSDs also stuck with GCC 4.2 due to licensing reasons, so you can't
> always compare.
> 
>> Yaakov, is there a reason that Cygwin needs __gnu_inline__?
> 
> Because the semantics of inline changed in GCC 4.3.
> 
>> It apparently prevents fortified functions from being used as function pointers.
> 
> I am currently testing the following, which seems to match glibc in this
> detail:
> 
> --- a/newlib/libc/include/ssp/ssp.h
> +++ b/newlib/libc/include/ssp/ssp.h
> @@ -51,7 +51,6 @@
>                  __chk_fail()
>   #define __ssp_decl(rtype, fun, args) \
>   rtype __ssp_real_(fun) args __asm__(__ASMNAME(#fun)); \
> -__ssp_inline rtype fun args __asm__(__ASMNAME("__ssp_protected_" #fun)); \
>   __ssp_inline rtype fun args
>   #define __ssp_redirect_raw(rtype, fun, args, call, cond, bos) \
>   __ssp_decl(rtype, fun, args) \

Works for me.

Ken


--
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

      reply	other threads:[~2018-01-25  2:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 16:59 Corinna Vinschen
2018-01-17 10:42 ` Houder
2018-01-17 10:50   ` Corinna Vinschen
2018-01-17 11:40     ` Houder
2018-01-17 12:07       ` Houder
2018-01-17 22:29 ` Ken Brown
2018-01-18 14:36   ` Ken Brown
2018-01-18 21:30     ` Yaakov Selkowitz
2018-01-18 23:28       ` Ken Brown
2018-01-20  3:27         ` Ken Brown
2018-01-20 12:23           ` Ken Brown
2018-01-20 23:49             ` Ken Brown
2018-01-24 19:25               ` Ken Brown
2018-01-25  0:16                 ` Yaakov Selkowitz
2018-01-25  2:42                   ` Ken Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=901aaf73-6eb9-207a-e6e7-6b900f844e02@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).