Re: Minimum gcc and clang supported to generate FreeBSD binaries

From: Warner Losh <imp_at_bsdimp.com>
Date: Thu, 20 Jun 2024 06:49:57 UTC
On Thu, Jun 20, 2024, 12:40 AM Bakul Shah <bakul@iitbombay.org> wrote:

> 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]
>

Relatively. Tcc is an outlier

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...
>

Yea. We shouldn't. But it's kinda necessary to have the compilers tested
all the time to spot regressions. This stuff is fiddly enough with 2 main
compiles and 2 that kinda emulate these two...  comes a point that you need
to say enough unless somebody is really, actively using it, our kinda
support becomes the worst of both worlds: a random drag on development that
isn't actually useful to anybody.

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!
>

Yea. I'd like to get them done and in.

Warner

>
> Bakul
>
>