I just wonder if we should be disabling linker gc across the board for all tests unless you explicitly opt in.<br><br>Seems like something we would want only rarely, if ever<br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 7, 2017 at 4:36 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I could, but I thought this would be more portable. For the Makefile<br>
solution I'd need to do something like<br>
<br>
LD_EXTRAS := -Wl,--no-as-needed,--whole-archive<br>
<br>
Which is a bit of a hack, as I'm not even using these flags to affect<br>
my own libraries, but the libraries that the compiler adds<br>
automatically to the end of the linker line. And I'm not sure whether<br>
the darwin linker (or lld when targetting windows) supports these<br>
options.<br>
<br>
On 7 November 2017 at 12:22, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> Can’t you just disable linker gc in the makefile?<br>
> On Tue, Nov 7, 2017 at 4:18 AM Pavel Labath via Phabricator via lldb-commits<br>
> <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> labath created this revision.<br>
>> Herald added a subscriber: srhines.<br>
>><br>
>> This test was failing in various configurations on linux in a fairly<br>
>> unpredictible way. The success depended on whether the c++ abi library<br>
>> was linked in statically or not and how well was the linker able to<br>
>> strip parts of it. This introduces additional code to the "dummmy" test<br>
>> executable, which ensures that all parts of the library needed to<br>
>> evaluate the expressions are always present.<br>
>><br>
>><br>
>> <a href="https://reviews.llvm.org/D39727" rel="noreferrer" target="_blank">https://reviews.llvm.org/D39727</a><br>
>><br>
>> Files:<br>
>><br>
>> packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
>>   packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
>><br>
>><br>
>> Index:<br>
>> packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
>> ===================================================================<br>
>> --- packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
>> +++ packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
>> @@ -1,7 +1,15 @@<br>
>>  #include <stdio.h><br>
>><br>
>> -int main()<br>
>> -{<br>
>> -    printf("This is a dummy\n"); // Set breakpoint here<br>
>> -    return 0;<br>
>> +// These are needed to make sure that the linker does not strip the parts<br>
>> of the<br>
>> +// C++ abi library that are necessary to execute the expressions in the<br>
>> +// debugger. It would be great if we did not need to do this, but the<br>
>> fact that<br>
>> +// LLDB cannot conjure up the abi library on demand is not relevant for<br>
>> testing<br>
>> +// top level expressions.<br>
>> +struct DummyA {};<br>
>> +struct DummyB : public virtual DummyA {};<br>
>> +<br>
>> +int main() {<br>
>> +  DummyB b;<br>
>> +  printf("This is a dummy\n"); // Set breakpoint here<br>
>> +  return 0;<br>
>>  }<br>
>> Index:<br>
>> packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
>> ===================================================================<br>
>> ---<br>
>> packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
>> +++<br>
>> packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
>> @@ -57,23 +57,6 @@<br>
>>          self.runCmd("run", RUN_SUCCEEDED)<br>
>><br>
>>      @add_test_categories(['pyapi'])<br>
>> -    @expectedFailureAndroid(api_levels=list(range(22+1)),<br>
>> bugnumber="<a href="http://llvm.org/pr27787" rel="noreferrer" target="_blank">llvm.org/pr27787</a>")<br>
>> -    @expectedFailureAll(<br>
>> -        oslist=["linux"],<br>
>> -        archs=[<br>
>> -            "arm",<br>
>> -            "aarch64"],<br>
>> -        bugnumber="<a href="http://llvm.org/pr27787" rel="noreferrer" target="_blank">llvm.org/pr27787</a>")<br>
>> -    @expectedFailureAll(<br>
>> -        bugnumber="<a href="http://llvm.org/pr28353" rel="noreferrer" target="_blank">llvm.org/pr28353</a>",<br>
>> -        oslist=["linux"],<br>
>> -        archs=[<br>
>> -            "i386",<br>
>> -            "x86_64"],<br>
>> -        compiler="gcc",<br>
>> -        compiler_version=[<br>
>> -            "<",<br>
>> -            "4.9"])<br>
>>      @skipIf(debug_info="gmodules")  # not relevant<br>
>>      @skipIf(oslist=["windows"])  # Error in record layout on Windows<br>
>>      def test_top_level_expressions(self):<br>
>><br>
>><br>
>> _______________________________________________<br>
>> lldb-commits mailing list<br>
>> <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>