Bug 55587 - [ASAN] Testsuite test c-c++-common/asan/memcmp-1.c fails to link on targets without libasan/libsanitizer
Summary: [ASAN] Testsuite test c-c++-common/asan/memcmp-1.c fails to link on targets w...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-04 08:33 UTC by Kai Tietz
Modified: 2013-06-25 21:38 UTC (History)
4 users (show)

See Also:
Host:
Target: i686-*-mingw32 i686-*-cygwin
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-12-04 00:00:00


Attachments
gcc48-pr55587.patch (591 bytes, patch)
2012-12-04 11:55 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Tietz 2012-12-04 08:33:53 UTC
Due missing dependency library this test fails for none-linux targets.
Comment 1 Richard Biener 2012-12-04 09:33:22 UTC
Confirmed.  The testsuite misses something like dg-require asan.
Comment 2 Jakub Jelinek 2012-12-04 09:40:44 UTC
asan.exp starts with
if ![check_effective_target_faddress_sanitizer] {
  return
}
but that just checks whether -fsanitize=address works, not whether libasan has been built.  That further check is in asan_init, guess we could return 0/1 from asan_init on whether it found libasan and if it hasn't, don't call gcc-dg-runtest.
Comment 3 Jakub Jelinek 2012-12-04 11:55:42 UTC
Created attachment 28875 [details]
gcc48-pr55587.patch

Does this patch work for you?  Worked for me in a quick testing (both with libsanitizer around and without).
Comment 4 Kai Tietz 2012-12-04 12:10:12 UTC
(In reply to comment #3)
> Created attachment 28875 [details]
> gcc48-pr55587.patch
> 
> Does this patch work for you?  Worked for me in a quick testing (both with
> libsanitizer around and without).

Yes, it works for me.  Thanks
Comment 5 Jakub Jelinek 2012-12-04 13:21:31 UTC
Author: jakub
Date: Tue Dec  4 13:21:11 2012
New Revision: 194134

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194134
Log:
	PR testsuite/55587
	* lib/asan-dg.exp (asan_init): Return 1 if libasan has been found,
	0 if not.
	* g++.dg/asan/asan.exp: Don't run gcc-dg-runtest if [asan_init]
	returned 0.
	* gcc.dg/asan/asan.exp: Likewise.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/asan/asan.exp
    trunk/gcc/testsuite/gcc.dg/asan/asan.exp
    trunk/gcc/testsuite/lib/asan-dg.exp
Comment 6 Jakub Jelinek 2012-12-04 13:26:32 UTC
Fixed.
Comment 7 Andrew Pinski 2013-06-25 21:38:24 UTC
This patch is broken for testing the already installed GCC.