Re: Minimum gcc and clang supported to generate FreeBSD binaries
Date: Thu, 20 Jun 2024 06:40:11 UTC
On Jun 19, 2024, at 11:10 PM, Warner Losh <imp@bsdimp.com> wrote: > >> > Why are versioned symbols required for qsort.h? >> Look at the qsort_r() stuff in stdlib.h to maintain backward compat >> with previous definition of qsort_r() comparator. >> >> I think that for the purposes of keeping some support for tcc or whatever >> not-quite-gcc compiler, we should just avoid doing the backward-compat dance, >> if such compiler is detected. > > https://reviews.freebsd.org/D45651 is a good, minimal patch to do that. A more extensive > patch would not define the symver macro for tcc (so any uses we'd catch right away) and > change the ifndef __TCC__ to ifdef symver. How common is symbol versioning? [Sorry, I've been out of compiler business for a long time now and haven't kept uptodate on such things] The reason I ask is, there may be other std compliant C compilers that may not do symbol versioning. While they may supply their own libraries, programs will still depend on system header files and libraries. In so far as possible we shouldn't make it hard to user other compilers (such as lcc, qbe, icc etc.). Stricter requirements on freebsd provided programs & libraries is fine but ideally their use by programs compiled with 3rd party compilers is possible without jumping through hoops... I have been using Warner's patch (thanks for that) where I use tcc but have to remember to patch cdefs.h every time I do installworld! Bakul