Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2024 23:40:11 -0700
From:      Bakul Shah <bakul@iitbombay.org>
To:        Warner Losh <imp@bsdimp.com>
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:  <EF5DFA8F-195B-4B5C-9F4B-5A39B831E9C2@iitbombay.org>
In-Reply-To: <CANCZdfpgLe3e34ovoUuT3xwJJ0FG32PTJddiLaC0xgMteH-nBA@mail.gmail.com>
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>

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

--Apple-Mail=_EA49292E-E2F6-4FA5-AF59-E811FE809DD3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

On Jun 19, 2024, at 11:10=E2=80=AFPM, Warner Losh <imp@bsdimp.com> =
wrote:
> =20
>> > 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.
>>=20
>> 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.
>=20
> 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


--Apple-Mail=_EA49292E-E2F6-4FA5-AF59-E811FE809DD3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">On Jun 19, =
2024, at 11:10=E2=80=AFPM, Warner Losh &lt;imp@bsdimp.com&gt; =
wrote:<div><blockquote type=3D"cite"><div><meta charset=3D"UTF-8"><div =
style=3D"caret-color: rgb(0, 0, 0); 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; =
-webkit-text-stroke-width: 0px; text-decoration: =
none;">&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"caret-color:=
 rgb(0, 0, 0); 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; -webkit-text-stroke-width: 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=3D"caret-color: rgb(0, 0, 0); =
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; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><br></div><div style=3D"caret-color: rgb(0, 0, =
0); 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; -webkit-text-stroke-width: 0px; =
text-decoration: none;"><a =
href=3D"https://reviews.freebsd.org/D45651">https://reviews.freebsd.org/D4=
5651</a><span class=3D"Apple-converted-space">&nbsp;</span>is a good, =
minimal patch to do that. A more extensive</div><div style=3D"caret-color:=
 rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; =
text-decoration: none;">patch would not define the symver macro for tcc =
(so any uses we'd catch right away) and</div><div style=3D"caret-color: =
rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; =
text-decoration: none;">change the ifndef __TCC__ to ifdef =
symver.</div></div></blockquote><br></div><div>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 &amp; =
libraries is fine but ideally their use by &nbsp;programs compiled with =
3rd party compilers is possible without jumping through =
hoops...</div><div><br></div><div>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!</div><div><br></div><div>Bakul</div><br></body></html>=

--Apple-Mail=_EA49292E-E2F6-4FA5-AF59-E811FE809DD3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EF5DFA8F-195B-4B5C-9F4B-5A39B831E9C2>