[libcxx-commits] [libcxx] 1580c76 - [libc++] Enable the new libc++ testing format by default

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 7 06:01:18 PDT 2020


Can you try again after this commit?

    commit 9949cfbd05a076ee4b70e393c5da49dce640a3c7
    Author: Louis Dionne <ldionne at apple.com>
    Date:   Tue Apr 7 08:56:30 2020 -0400

        [libc++] Make sure the source file appears before link libraries when compiling tests

        Otherwise, files don't link when using a GNU linker, which is more
        sensitive on the order of the source file relative to the various
        linked libraries. See http://c-faq.com/lib/libsearch.html for an
        explanation of the problem.


I'm pretty sure that's the problem. The old format didn't honor LLVM_USE_LINKER anymore than the new one does AFAICT, and if substitutions.sh.cpp was your only failing test, that's highly suspicious of the problem I fixed in 9949cfbd05a076ee. Please let me know if that helped!

Thanks,
Louis

> On Apr 7, 2020, at 06:35, David Zarzycki <dave at znu.io> wrote:
> 
> Hi Louis,
> 
> I must apologize. So the problem persists and my testing was *slightly* inconsistent when I ran this on your behalf. I forgot to force the build to use the system provided clang (version 9 which uses GNU ld by default) and instead the default compiler (clang top-of-tree which uses  LLVM lld by default).
> 
> I've done some debugging and the problem seems to twofold:
> 
> 1) the bug is linker specific. It works with LLVM's but not GNU's ld or ld.gold.
> 2) The LLVM_USE_LINKER build option is not being honored by the libc++ "new format" change.
> 
> Personally, I'm trying to figure out right now if there are other CMake options that can force the libcxx test suite to use LLD when using the system compiler. That being said, I'd imagine that others will eventually run into this bug. Here is a diff of GNU ld and lld invocations by clang:
> 
> -"/usr/bin/ld"
> +"/p/llvm/bin/ld.lld"
> --hash-style=gnu
> ---build-id
> --eh-frame-hdr
> -m
> elf_x86_64
> @@ -8,17 +7,16 @@
> /lib64/ld-linux-x86-64.so.2
> -o
> /tmp/xyz/r/projects/libcxx/test/libcxx/selftest/newformat/sh.cpp/Output/substitutions.sh.cpp.tmp.exe <http://sh.cpp/Output/substitutions.sh.cpp.tmp.exe>
> -/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o
> -/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o
> -/usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtbegin.o
> +/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o
> +/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o
> +/usr/lib/gcc/x86_64-redhat-linux/9/crtbegin.o
> -L/tmp/xyz/r/./lib64
> --L/usr/bin/../lib/gcc/x86_64-redhat-linux/9
> --L/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64
> --L/usr/bin/../lib64
> +-L/usr/lib/gcc/x86_64-redhat-linux/9
> +-L/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64
> +-L/p/llvm/bin/../lib64
> -L/lib/../lib64
> -L/usr/lib/../lib64
> --L/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../..
> --L/usr/bin/../lib
> +-L/usr/lib/gcc/x86_64-redhat-linux/9/../../..
> -L/lib
> -L/usr/lib
> -rpath
> @@ -34,6 +32,6 @@
> -lc
> -lgcc_s
> -lgcc
> -/tmp/substitutions-bd3c1b.o
> -/usr/bin/../lib/gcc/x86_64-redhat-linux/9/crtend.o
> -/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o
> +/tmp/substitutions-1e1623.o
> +/usr/lib/gcc/x86_64-redhat-linux/9/crtend.o
> +/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o
> 
> 
> On Mon, Apr 6, 2020, at 6:08 PM, David Zarzycki via libcxx-commits wrote:
>> This passes. Thanks!
>> 
>> On Mon, Apr 6, 2020, at 11:28 AM, Louis Dionne wrote:
>>> 
>>> 
>>>> On Apr 5, 2020, at 06:58, David Zarzycki <dave at znu.io <mailto:dave at znu.io>> wrote:
>>>> 
>>>> Hi Louis,
>>>> 
>>>> This is breaking one test on release (no assert) testing on Fedora 31 (x86-64). Since this change was intentionally done on the weekend to shake out problems, I'm going to revert this. Thanks for understanding. For context , what follows is the failure.
>>> 
>>> Thanks! This was indeed the purpose of the commit. I can't find the exact root cause of the issue you are seeing, however I just pushed fixes for a similar issue that I think is likely the same as yours. Could you try running this command with the latest master?
>>> 
>>>     $ <build-dir>/bin/llvm-lit -sv libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp --param=use_new_format=True
>>> 
>>> This should confirm that the problem has been fixed. In any case, I'll try enabling the new format by default again tonight, so we'll see if it didn't fix it.
>>> 
>>> Thanks,
>>> Louis
>>> 
>>>> 
>>>> Dave
>>>> 
>>>> 
>>>> 
>>>> FAIL: libc++ :: libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp (54225 of 62636)
>>>> ******************** TEST 'libc++ :: libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp' FAILED ********************
>>>> Script:
>>>> --
>>>> : 'RUN: at line 16';    /usr/bin/clang++ -Werror=thread-safety -std=c++2a -include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/dave/s/lp/libcxx/include -I/tmp/_update_lc/r/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/dave/s/lp/libcxx/test/support -ftemplate-depth=270  -L/tmp/_update_lc/r/./lib64 -Wl,-rpath,/tmp/_update_lc/r/./lib64 -nodefaultlibs -lc++experimental /tmp/_update_lc/r/./lib64/libc++.a -lc++abi -lm -lgcc_s -lgcc -lpthread -lrt -lc -lgcc_s -lgcc -o /tmp/_update_lc/r/projects/libcxx/test/libcxx/selftest/newformat/sh.cpp/Output/substitutions.sh.cpp.tmp.exe /home/dave/s/lp/libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp
>>>> : 'RUN: at line 17';   /usr/bin/python /home/dave/s/lp/libcxx/utils/run.py --codesign_identity "" --dependencies /tmp/_update_lc/r/projects/libcxx/test/libcxx/selftest/newformat/sh.cpp/Output/substitutions.sh.cpp.tmp.exe --env  --  /tmp/_update_lc/r/projects/libcxx/test/libcxx/selftest/newformat/sh.cpp/Output/substitutions.sh.cpp.tmp.exe "HELLO"
>>>> --
>>>> Exit Code: 1
>>>> 
>>>> Command Output (stderr):
>>>> --
>>>> /usr/bin/ld: /tmp/substitutions-945c39.o: in function `main':
>>>> substitutions.sh.cpp:(.text+0xb7): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
>>>> /usr/bin/ld: /tmp/substitutions-945c39.o: in function `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<decltype(nullptr)>(char const*)':
>>>> substitutions.sh.cpp:(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2IDnEEPKc[_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2IDnEEPKc]+0x45): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)'
>>>> /usr/bin/ld: /tmp/substitutions-945c39.o: in function `bool std::__1::operator==<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*)':
>>>> substitutions.sh.cpp:(.text._ZNSt3__1eqIcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_[_ZNSt3__1eqIcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_]+0x5c): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const'
>>>> /usr/bin/ld: /tmp/substitutions-945c39.o: in function `__clang_call_terminate':
>>>> substitutions.sh.cpp:(.text.__clang_call_terminate[__clang_call_terminate]+0x2): undefined reference to `__cxa_begin_catch'
>>>> /usr/bin/ld: substitutions.sh.cpp:(.text.__clang_call_terminate[__clang_call_terminate]+0xb): undefined reference to `std::terminate()'
>>>> /usr/bin/ld: /tmp/substitutions-945c39.o:(.eh_frame+0x1eb): undefined reference to `__gxx_personality_v0'
>>>> clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
>>>> 
>>>> --
>>>> 
>>>> ********************
>>>> 
>>>> Testing Time: 157.81s
>>>> ********************
>>>> Failing Tests (1):
>>>>    libc++ :: libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp
>>>> 
>>>>  Expected Passes    : 45136
>>>>  Expected Failures  : 133
>>>>  Unsupported Tests  : 17366
>>>>  Unexpected Failures: 1
>>>> 
>>>> 
>>>> 
>>>> On Sat, Apr 4, 2020, at 4:58 PM, Louis Dionne via libcxx-commits wrote:
>>>>> 
>>>>> Author: Louis Dionne
>>>>> Date: 2020-04-04T16:57:16-04:00
>>>>> New Revision: 1580c76c4a08e24adc34ae0a4ff4f97969188268
>>>>> 
>>>>> URL: 
>>>>> https://github.com/llvm/llvm-project/commit/1580c76c4a08e24adc34ae0a4ff4f97969188268 <https://github.com/llvm/llvm-project/commit/1580c76c4a08e24adc34ae0a4ff4f97969188268>
>>>>> DIFF: 
>>>>> https://github.com/llvm/llvm-project/commit/1580c76c4a08e24adc34ae0a4ff4f97969188268.diff
>>>>> 
>>>>> LOG: [libc++] Enable the new libc++ testing format by default
>>>>> 
>>>>> Both test formats are equivalent, so this *should* not be a problem.
>>>>> However, I'm taking advantage of the week-end to test this and see if
>>>>> there are any failures. If so, it should be fine to revert this until
>>>>> the failures have been addressed.
>>>>> 
>>>>> For the time being, it is still possible to use the old format by passing
>>>>> `--param=use_old_format=True` when running Lit.
>>>>> 
>>>>> Added: 
>>>>> 
>>>>> 
>>>>> Modified: 
>>>>>    libcxx/test/lit.cfg
>>>>> 
>>>>> Removed: 
>>>>> 
>>>>> 
>>>>> 
>>>>> ################################################################################
>>>>> diff  --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg
>>>>> index 8f42dd7c468b..86e806067a5b 100644
>>>>> --- a/libcxx/test/lit.cfg
>>>>> +++ b/libcxx/test/lit.cfg
>>>>> @@ -52,9 +52,9 @@ config_module = __import__(config_module_name, 
>>>>> fromlist=['Configuration'])
>>>>> configuration = config_module.Configuration(lit_config, config)
>>>>> configuration.configure()
>>>>> configuration.print_config_info()
>>>>> -if lit_config.params.get('use_new_format', False):
>>>>> -    lit_config.note("Using the experimental libc++ testing format")
>>>>> +if lit_config.params.get('use_old_format', False):
>>>>> +    lit_config.note("Using the old libc++ testing format")
>>>>> +    config.test_format = configuration.get_test_format()
>>>>> +else:
>>>>>     import libcxx.test.newformat
>>>>>     config.test_format = libcxx.test.newformat.CxxStandardLibraryTest()
>>>>> -else:
>>>>> -    config.test_format = configuration.get_test_format()
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> libcxx-commits mailing list
>>>>> libcxx-commits at lists.llvm.org
>>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
>> 
>> _______________________________________________
>> libcxx-commits mailing list
>> libcxx-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200407/05322297/attachment-0001.html>


More information about the libcxx-commits mailing list