leovancekang wrote:

> > Clang's clang/test/Driver/compiler-rt-unwind.c explicitly tests 
> > -rtlib=compiler-rt --unwindlib=libgcc and expects both 
> > libclang_rt.builtins.a and -lgcc_s. #144582 also adjusted Clang Driver 
> > tests to allow -lgcc_s when the configured defaults combined compiler-rt 
> > with the libgcc unwinder.
> 
> My understanding of this test is that it is explicitly checking that GCC's 
> unwinder is not added when --rtlib is given. With this PR, you are explicitly 
> changing what the test is checking for in order to workaround a configuration 
> issue.
> 
> A proper fix for this would be to change the expectation of the test if a 
> default unwind library is specified at configuration time.

@tarunprabhu Thanks. I updated the patch so that the expectation now depends on 
the configured default unwind library.

The patch exports `CLANG_DEFAULT_UNWINDLIB` through `ClangConfig.cmake`, 
propagates it to Flang's lit configuration, and requires `-lgcc_s` only when 
`libgcc` is the configured default. Other configurations continue to reject 
`-lgcc_s`, and the exact `-lgcc` linker argument remains rejected in all 
configurations.

I tested both `CLANG_DEFAULT_UNWINDLIB=libgcc` and an empty 
`CLANG_DEFAULT_UNWINDLIB` with the targeted test and the full `check-flang` 
suite.

https://github.com/llvm/llvm-project/pull/212419
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to