public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc -fsanitize => cannot find -lubsan
@ 2018-03-27 18:48 Lee
  2018-03-27 19:15 ` Brian Inglis
  0 siblings, 1 reply; 3+ messages in thread
From: Lee @ 2018-03-27 18:48 UTC (permalink / raw)
  To: cygwin

How do you figure out which package is missing from your install?

$cat sbstrict.c
int main () {
  return 0;
}

$i686-w64-mingw32-gcc -fsanitize=bounds-strict sbstrict.c
/usr/lib/gcc/i686-w64-mingw32/6.4.0/../../../../i686-w64-mingw32/bin/ld:
cannot find -lubsan
collect2: error: ld returned 1 exit status

$gcc -fsanitize=bounds-strict sbstrict.c
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lubsan
collect2: error: ld returned 1 exit status


I looked at
  https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ubsan&arch=x86_64
and both
  gcc-debuginfo-6.4.0-5
  mingw64-i686-gcc-debuginfo-6.4.0-1
have a ubsan.c, but ld wouldn't be looking for that.  Right??


Thanks
Lee

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc -fsanitize => cannot find -lubsan
  2018-03-27 18:48 gcc -fsanitize => cannot find -lubsan Lee
@ 2018-03-27 19:15 ` Brian Inglis
  2018-03-28  3:13   ` Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Inglis @ 2018-03-27 19:15 UTC (permalink / raw)
  To: cygwin

On 2018-03-27 11:39, Lee wrote:
> How do you figure out which package is missing from your install?
> $cat sbstrict.c
> int main () {
>   return 0;
> }
> $i686-w64-mingw32-gcc -fsanitize=bounds-strict sbstrict.c
> /usr/lib/gcc/i686-w64-mingw32/6.4.0/../../../../i686-w64-mingw32/bin/ld:
> cannot find -lubsan
> collect2: error: ld returned 1 exit status
> $gcc -fsanitize=bounds-strict sbstrict.c
> /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
> cannot find -lubsan
> collect2: error: ld returned 1 exit status
> I looked at
>   https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ubsan&arch=x86_64
> and both
>   gcc-debuginfo-6.4.0-5
>   mingw64-i686-gcc-debuginfo-6.4.0-1
> have a ubsan.c, but ld wouldn't be looking for that.  Right??

Implies that gcc includes support, but not supported as of 2015:

	https://sourceware.org/ml/cygwin/2015-10/msg00528.html

- don't know why - or if since added.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc -fsanitize => cannot find -lubsan
  2018-03-27 19:15 ` Brian Inglis
@ 2018-03-28  3:13   ` Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Lee @ 2018-03-28  3:13 UTC (permalink / raw)
  To: cygwin

On 3/27/18, Brian Inglis  wrote:
> On 2018-03-27 11:39, Lee wrote:

>> How do you figure out which package is missing from your install?
>> $cat sbstrict.c
>> int main () {
>>   return 0;
>> }
>> $i686-w64-mingw32-gcc -fsanitize=bounds-strict sbstrict.c
>> /usr/lib/gcc/i686-w64-mingw32/6.4.0/../../../../i686-w64-mingw32/bin/ld:
>> cannot find -lubsan
>> collect2: error: ld returned 1 exit status
>> $gcc -fsanitize=bounds-strict sbstrict.c
>> /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
>> cannot find -lubsan
>> collect2: error: ld returned 1 exit status
>> I looked at
>>   https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ubsan&arch=x86_64
>> and both
>>   gcc-debuginfo-6.4.0-5
>>   mingw64-i686-gcc-debuginfo-6.4.0-1
>> have a ubsan.c, but ld wouldn't be looking for that.  Right??
>
> Implies that gcc includes support, but not supported as of 2015:
>
> 	https://sourceware.org/ml/cygwin/2015-10/msg00528.html
>
> - don't know why - or if since added.

I dunno what version of gcc cygwin had in 2015 but it looks like it wasn't v6.
https://www.gnu.org/software/gcc/gcc-6/
  GCC 6.1   April 27, 2016  (there is no gcc 6.0 listed in the release history)

-fsanitize=bounds-strict was added in gcc v6, which is the current
cygwin & mingw gcc

https://www.gnu.org/software/gcc/gcc-6/changes.html
  UndefinedBehaviorSanitizer gained a new sanitization option,
-fsanitize=bounds-strict, which enables strict checking of array
bounds. In particular, it enables -fsanitize=bounds as well as
instrumentation of flexible array member-like arrays.

$gcc --version
gcc (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks,
Lee

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-27 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 18:48 gcc -fsanitize => cannot find -lubsan Lee
2018-03-27 19:15 ` Brian Inglis
2018-03-28  3:13   ` Lee

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