Re: Minimum gcc and clang supported to generate FreeBSD binaries
- In reply to: Minsoo Choo : "Re: Minimum gcc and clang supported to generate FreeBSD binaries"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 20 Jun 2024 06:18:53 UTC
On Wed, Jun 19, 2024 at 8:26 PM Minsoo Choo <minsoochoo0122@proton.me> wrote: > I'm fine with these changes. GCC 5 was released 9 years ago and I think > most people have migrated to newer versions. > > As long as <sys/cdefs.h> is compatible with POSIX standard, code written > on FreeBSD will be portable on Linux and mac, and vice versa. There might > be problems with tcc and pcc, but it is compiler dev's responsibility to > follow posix, not our's to modify the base system for each compiler > Except we don't follow POSIX and so each compiler needs special support for these things (they are outside of POSIX). Fortunately, it looks like both tcc and pcc will work after my changes. > I think "__CC_SUPPORTS___INLINE" can be replaced with "__STDC_VERSION__ > >= 199901L" and thnigs under "NO_ANSI_KEYWORDS" can be removed. > I'm not so sure, but that will be for a second round of cleanup. I'm not looking to touch that stuff just yet. > I would like to review the changes once they are posted on phabricator. To > me, it has been a huge difficulty to read the cdefs.h header because it has > to many compatibility macros for old versions of GCC. Thank you for your > work. > I'll add you to the work. I also need to re-review and/or land your POSIX.1-2024 changes to a few headers now that I have a copy of the standard and we know the values that will be mandated. https://reviews.freebsd.org/D45653 https://reviews.freebsd.org/D45654 https://reviews.freebsd.org/D45655 https://reviews.freebsd.org/D45656 https://reviews.freebsd.org/D45657 Are what I've come up with now that I've had a chance to study tcc and pcc a bit. These all should be safe to remove since the ones that are > the 4.3 that pcc supports aren't used in headers. Warner > On Wednesday, June 19th, 2024 at 9:01 PM, Warner Losh <imp@bsdimp.com> > wrote: > > Greetings, > > I've been having a go at cleaning up sys/cdefs.h for going on 5 years now. > One big problem is that it's chock-o-block of special cases and hacks going > back to the early 1990s (before some people on this list were even born). > > I'd like to remove a lot of that, while still retaining useful versions of > gcc and clang to work (plus preserving what support that we have for pcc > and tcc (including fixing the latter). Note: this is "building binaries > on FreeBSD" not "building FreeBSD" which has much much tighter requirements > for compilers. This won't affect that at all. > > To that end, I'd like to draw a line in the sand. If you are building > FreeBSD binaries for FreeBSD 15 and newer, you need to use gcc9 (or newer) > or llvm/clang 11 (or newer). Stable/12 has clang 13 at its tip. These > compilers are 5 years old or so. And are the oldest compilers in the ports > tree that we use to generate FreeBSD binaries (there's three older ones: > gcc 6 for ada, gcc 4.2 for TI calculators (but it doesn't use system > headers) and gcc 2.7.2 for hp48 calculators (same). So from a ports > perspective, > > From a looking at changes perspective, there's about 30 instances of > GNU_PREREQU in the tree. The newest one is for gcc 5.1. So nominally > supporting just gcc9 and newer means assuming that these are all true > (which is true for gcc and clang) and removing specific support for them. > clang and gcc easily clears these bars. > > Ah, but what do you say about tcc and pcc which are't gcc? Well, tcc lies, > and says it supports gcc (version 9 I think, but it's been a while since I > checked). tcc can't work today because we have qsort.h using versioned > symbols unconditionally, and it doesn't support versioned symbols.... And > patches to do that have been stalled for reasons unrelated to this desire. > pcc doesn't support gnuc symbols at all last I checked. But it has real > issues building some things in the tree, so I'll not gate things by it > unless somebody steps up to actually do the work to make it work. The pcc > upstream has been weird lately too. > > ICC used to be supported, but unless someone turns up with patches for the > latest icc, it will remain supported only to the extent it pretends to be > gcc. I've had reports that it works, to this extent and nothing special is > needed to build FreeBSD binaries. There are a couple of touch ups required > to build FreeBSD itself with icc I'm told, but I've not seen patches and > have little desire to chase this windmill. > > In practical sense, this will just be writing down what's the reality on > the ground today: old compiler versions haven't been tested and there's a > lot of known issues we've introduced since moving to clang that will > preclude even our old gcc 4.2 from working with system headers. > > Of course, I'll do an exp run with all these changes. But I wanted to give > people a heads up that I'll be doing this before 15.0 is branched. > > For the vast majority (all?) users, I expect you'll not notice. > > Warner > > >