Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2024 00:49:57 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Bakul Shah <bakul@iitbombay.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Minimum gcc and clang supported to generate FreeBSD binaries
Message-ID:  <CANCZdfr0CjB65oJQtJtz=BAkCWmT0YrTUyK1eMM4GVVum5GUdQ@mail.gmail.com>
In-Reply-To: <EF5DFA8F-195B-4B5C-9F4B-5A39B831E9C2@iitbombay.org>
References:  <CANCZdfqBdsoNf8tVwX6MH=Dd24e114b_Pn5hA5UjxtSBX-h%2BGA@mail.gmail.com> <197A5386-1096-4754-BA82-996140B56EAF@iitbombay.org> <ZnO0Rs1f0CQ_Y3Yh@kib.kiev.ua> <CANCZdfpgLe3e34ovoUuT3xwJJ0FG32PTJddiLaC0xgMteH-nBA@mail.gmail.com> <EF5DFA8F-195B-4B5C-9F4B-5A39B831E9C2@iitbombay.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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
>
>

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 20, 2024, 12:40 AM Bakul Shah &lt;<a href="mailto:bakul@iitbombay.org">bakul@iitbombay.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-break:after-white-space">On Jun 19, 2024, at 11:10 PM, Warner Losh &lt;<a href="mailto:imp@bsdimp.com" target="_blank" rel="noreferrer">imp@bsdimp.com</a>&gt; wrote:<div><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"> </div><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">&gt; Why are versioned symbols required for qsort.h?<br>Look at the qsort_r() stuff in stdlib.h to maintain backward compat<br>with previous definition of qsort_r() comparator.<br><br>I think that for the purposes of keeping some support for tcc or whatever<br>not-quite-gcc compiler, we should just avoid doing the backward-compat dance,<br>if such compiler is detected.<br></blockquote><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><a href="https://reviews.freebsd.org/D45651" target="_blank" rel="noreferrer">https://reviews.freebsd.org/D45651</a><span> </span>is a good, minimal patch to do that. A more extensive</div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">patch would not define the symver macro for tcc (so any uses we&#39;d catch right away) and</div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">change the ifndef __TCC__ to ifdef symver.</div></div></blockquote><br></div><div>How common is symbol versioning? [Sorry, I&#39;ve been out of compiler business for a long time now and haven&#39;t kept uptodate on such things]</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Relatively. Tcc is an outlier</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-break:after-white-space"><div> 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&#39;t make it hard to user other compilers (such as lcc, qbe, icc etc.). Stricter requirements on freebsd provided programs &amp; libraries is fine but ideally their use by  programs compiled with 3rd party compilers is possible without jumping through hoops...</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yea. We shouldn&#39;t. But it&#39;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&#39;t actually useful to anybody.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-break:after-white-space"><div>I have been using Warner&#39;s patch (thanks for that) where I use tcc but have to remember to patch cdefs.h every time I do installworld!</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yea. I&#39;d like to get them done and in.</div><div dir="auto"><br></div><div dir="auto">Warner </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-break:after-white-space"><div><br></div><div>Bakul</div><br></div></blockquote></div></div></div>
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr0CjB65oJQtJtz=BAkCWmT0YrTUyK1eMM4GVVum5GUdQ>