This is an archive of the discontinued LLVM Phabricator instance.

Fix test/msan/textdomain.cc on NetBSD
ClosedPublic

Authored by krytarowski on Dec 8 2017, 8:48 AM.

Details

Summary

This tests must be linked with -lintl for the gettext(3) features.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Dec 8 2017, 8:48 AM
vitalybuka accepted this revision.Dec 8 2017, 3:53 PM
This revision is now accepted and ready to land.Dec 8 2017, 3:53 PM
This revision was automatically updated to reflect the committed changes.
krytarowski reopened this revision.Dec 8 2017, 6:40 PM

Reverted, it breaks Linux.

http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/12383/steps/ninja%20check%201/logs/stdio

******************** TEST 'MemorySanitizer-powerpc64le :: textdomain.cc' FAILED ********************
Script:
--
/home/buildbots/ppc64le-clang-test/clang-ppc64le/stage1/./bin/clang  --driver-mode=g++ -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls  -m64 -fno-function-sections  -gline-tables-only -lintl -O0 -g /home/buildbots/ppc64le-clang-test/clang-ppc64le/llvm/projects/compiler-rt/test/msan/textdomain.cc -o /home/buildbots/ppc64le-clang-test/clang-ppc64le/stage1/projects/compiler-rt/test/msan/POWERPC64LEConfig/Output/textdomain.cc.tmp &&  /home/buildbots/ppc64le-clang-test/clang-ppc64le/stage1/projects/compiler-rt/test/msan/POWERPC64LEConfig/Output/textdomain.cc.tmp
--
Exit Code: 1

Command Output (stderr):
--
/usr/bin/ld: cannot find -lintl
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

--
This revision is now accepted and ready to land.Dec 8 2017, 6:40 PM
krytarowski planned changes to this revision.Dec 9 2017, 10:33 AM

I can confirm for FreeBSD, this linker flag is needed as well.

Perhaps the proper solution is mark this test as UNSUPPORTED for BSDs and assume that -ltint library has been prebuilt with sanitizers.

What do you think?

Perhaps the proper solution is mark this test as UNSUPPORTED for BSDs and assume that -ltint library has been prebuilt with sanitizers.

What do you think?

This is the wisest I can think of indeed not sure it would work under Linux with this flag.

Author: kamil
Date: Sat Feb 10 06:36:55 2018
New Revision: 324810

URL: http://llvm.org/viewvc/llvm-project?rev=324810&view=rev
Log:
Mark the textdomain.cc test as unsupported on BSDs

textdomain is a part of -lintl on BSDs. In GLIBC it's in libc.

We assume that -lintl will need to be rebuilt with sanitizers
in order to sanitize programs using its features.

This is a proper continuation of D41013.

The original patch has been reverted (adding -lintl).

Modified:
    compiler-rt/trunk/test/msan/textdomain.cc
krytarowski requested review of this revision.Feb 10 2018, 6:42 AM
This revision is now accepted and ready to land.Feb 10 2018, 6:42 AM
krytarowski closed this revision.Feb 10 2018, 6:42 AM