GCC complains about undefined reference in LibcTest.cpp and indeed the wrong version of the template has been explicitly instanciated.
This is necessary to get llvm-libc compile with GCC.
Mentionning D119002 here for navigability.
Paths
| Differential D119242
[libc] undefined reference in LibcTest.cpp ClosedPublic Authored by gchatelet on Feb 8 2022, 6:55 AM.
Details
Summary GCC complains about undefined reference in LibcTest.cpp and indeed the wrong version of the template has been explicitly instanciated. Mentionning D119002 here for navigability.
Diff Detail
Event Timelinesivachandra added inline comments.
This revision is now accepted and ready to land.Feb 9 2022, 9:48 AM Closed by commit rGd2c595466207: [libc] undefined reference in LibcTest.cpp (authored by gchatelet). · Explain WhyFeb 9 2022, 12:46 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 407254 libc/utils/UnitTest/LibcTest.cpp
|
I think what is happening is this: We were instantiating the member functions which call these non-member internal functions. So, the member function instantiation triggered the instantiation of these non-member functions. My guess is that, your GCC is probably not going through the call graph and instantiating the internal functions. Hence you are running into the undefined reference problem. That said though, instantiating these internal functions is more appropriate. So, your change LGTM.