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>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000c29610061b4cb9f3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 20, 2024, 12:40=E2=80=AFAM Bakul Shah <bakul@iitbombay.org> wro=
te:

> On Jun 19, 2024, at 11:10=E2=80=AFPM, 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 whateve=
r
>> 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 fa=
r
> as possible we shouldn't make it hard to user other compilers (such as lc=
c,
> 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
>
>

--000000000000c29610061b4cb9f3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Thu, Jun 20, 2024, 12:40=E2=80=AFAM Bakul Shah &lt;=
<a href=3D"mailto:bakul@iitbombay.org">bakul@iitbombay.org</a>&gt; wrote:<b=
r></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div style=3D"line-break:after-white=
-space">On Jun 19, 2024, at 11:10=E2=80=AFPM, Warner Losh &lt;<a href=3D"ma=
ilto:imp@bsdimp.com" target=3D"_blank" rel=3D"noreferrer">imp@bsdimp.com</a=
>&gt; wrote:<div><blockquote type=3D"cite"><div><div style=3D"font-family:H=
elvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-wei=
ght:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px;text-decoration:none">=C2=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"font-family:Helvetica;font-si=
ze:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-s=
pacing:normal;text-align:start;text-indent:0px;text-transform:none;white-sp=
ace:normal;word-spacing:0px;text-decoration:none;margin:0px 0px 0px 0.8ex;b=
order-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 t=
he purposes of keeping some support for tcc or whatever<br>not-quite-gcc co=
mpiler, we should just avoid doing the backward-compat dance,<br>if such co=
mpiler is detected.<br></blockquote><div style=3D"font-family:Helvetica;fon=
t-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;lett=
er-spacing:normal;text-align:start;text-indent:0px;text-transform:none;whit=
e-space:normal;word-spacing:0px;text-decoration:none"><br></div><div style=
=3D"font-family:Helvetica;font-size:18px;font-style:normal;font-variant-cap=
s:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent=
:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoratio=
n:none"><a href=3D"https://reviews.freebsd.org/D45651" target=3D"_blank" re=
l=3D"noreferrer">https://reviews.freebsd.org/D45651</a><span>=C2=A0</span>i=
s a good, minimal patch to do that. A more extensive</div><div style=3D"fon=
t-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:norma=
l;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;te=
xt-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 catc=
h right away) and</div><div style=3D"font-family:Helvetica;font-size:18px;f=
ont-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:no=
rmal;text-align:start;text-indent:0px;text-transform:none;white-space:norma=
l;word-spacing:0px;text-decoration:none">change the ifndef __TCC__ to ifdef=
 symver.</div></div></blockquote><br></div><div>How common is symbol versio=
ning? [Sorry, I&#39;ve been out of compiler business for a long time now an=
d haven&#39;t kept uptodate on such things]</div></div></blockquote></div><=
/div><div dir=3D"auto"><br></div><div dir=3D"auto">Relatively. Tcc is an ou=
tlier</div><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmai=
l_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div style=3D"line-break:after-whit=
e-space"><div> The reason I ask is, there may be other std compliant C comp=
ilers that may not do symbol versioning. While they may supply their own li=
braries, programs will still depend on system header files and libraries. I=
n 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 pro=
grams &amp; libraries is fine but ideally their use by =C2=A0programs compi=
led with 3rd party compilers is possible without jumping through hoops...</=
div></div></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"=
auto">Yea. We shouldn&#39;t. But it&#39;s kinda necessary to have the compi=
lers tested all the time to spot regressions. This stuff is fiddly enough w=
ith 2 main compiles and 2 that kinda emulate these two...=C2=A0 comes a poi=
nt 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 deve=
lopment that isn&#39;t actually useful to anybody.</div><div dir=3D"auto"><=
br></div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div style=3D"line-break:after-white-space"><div>I have been usin=
g 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></d=
iv></div><div dir=3D"auto"><br></div><div dir=3D"auto">Yea. I&#39;d like to=
 get them done and in.</div><div dir=3D"auto"><br></div><div dir=3D"auto">W=
arner=C2=A0</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div style=3D"line-break:after-white-space"><div><br></di=
v><div>Bakul</div><br></div></blockquote></div></div></div>

--000000000000c29610061b4cb9f3--



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