From nobody Thu Jun 20 06:40:11 2024 X-Original-To: freebsd-arch@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W4W8B1Lg2z5PK6b for ; Thu, 20 Jun 2024 06:40:26 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W4W8B0sJYz4mYS for ; Thu, 20 Jun 2024 06:40:26 +0000 (UTC) (envelope-from bakul@iitbombay.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7024d571d8eso468194b3a.0 for ; Wed, 19 Jun 2024 23:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20230601.gappssmtp.com; s=20230601; t=1718865625; x=1719470425; darn=freebsd.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=mKERKil0jd8I0r10tFFawT31cixsexXIVM28x9Yv6UM=; b=W+I4fN/7hpuN5w4bBlZxDQOoDJOKkU6pbIuCKZrm1EU8R3z12j9XYMPPXZEz9dSHN6 Bhg1x1hTKSEe3h7d487/s99QDMR057IXevxyZGKtnusEIXO+3HvTGQeUyUF4kF3PZoMx rZO5R4fTUqYfN3fNdlujbLNEvC1qjE5qHA+he8+ewhwWWthNTJj+v6R5T93KBS1YQcVQ u0UzRyMd3vE7uWj4W++z4iBlGRhH2EyIdR52lqIDn4giwEIvKwjAGvmhEpenG8oIqbh/ RM75/apDKhTdlm06tPxw/f5RRn1ysQBdbqIr8QrjlJ5NILrT7wpXdqKl6/ERARcUnDpZ 3ESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718865625; x=1719470425; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mKERKil0jd8I0r10tFFawT31cixsexXIVM28x9Yv6UM=; b=Xai+2zb3TXvaUq64kq2l3kY1gZNJTnEvgMKneAP9zig0Ng8HzkvnTkZhMgCXvSSscW uyosd6IygolPg5z53+Wzs2+27tQ00aXSdSasCgW0KLkTtXvIbQDTl7Secas6bEM56kvc Kq6u9/E0/A0KHhj1w2b4u3aPmHPhDjaTAeEtJ/1HQzKYUS+kATvXLklapnl5mvpj3Md+ wtkSwf4x7SJit9+M+hye+CDIPQ4w/6ZkjYnpd/1YmlhFnMvlCdg+IbM0WWdH3ou9twJ/ 62wrIQEKRat88jD33byfuZHL0UlMVOsx2vpC16/N1UjVxsQW480WStD9Usp7d+eDyH/1 AFjg== X-Forwarded-Encrypted: i=1; AJvYcCW1yAmY5uBNoqC9OlZ8qRDeAcDZWn06TrFl650BLrxt6ro/UuCQTLifHAGNt+yQcnj/l0ynJAt6IJRTQQlTQcSGVXCZsjYNfFw= X-Gm-Message-State: AOJu0Ywd4UMRGes7P5QShB6kkgoJAPrOydOg2+2IbKNog139LkMX+xYq G7j92dkGOvhTA3pRMT6UT4tUks3p5tqSfSUWC3JKvXVN9Ih9lZdFWPwQJ0xHLnoFLrdIHIIvi1Q = X-Google-Smtp-Source: AGHT+IGgX60LB3LDY8Htp0Y6ZidVOj06kxc9Y9uEiS8so+sMBVm21IwQnIIGHNUFRGvEav0oap9J6Q== X-Received: by 2002:a05:6a20:18b0:b0:1b8:9dfc:7ace with SMTP id adf61e73a8af0-1bcbb617339mr4425154637.48.1718865622996; Wed, 19 Jun 2024 23:40:22 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc929321sm11708881b3a.26.2024.06.19.23.40.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2024 23:40:22 -0700 (PDT) From: Bakul Shah Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_EA49292E-E2F6-4FA5-AF59-E811FE809DD3" List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: Minimum gcc and clang supported to generate FreeBSD binaries Date: Wed, 19 Jun 2024 23:40:11 -0700 In-Reply-To: Cc: Konstantin Belousov , "freebsd-arch@freebsd.org" To: Warner Losh References: <197A5386-1096-4754-BA82-996140B56EAF@iitbombay.org> X-Mailer: Apple Mail (2.3774.600.62) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4W4W8B0sJYz4mYS --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 = 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 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 = whatever
not-quite-gcc compiler, we should just avoid doing the = backward-compat dance,
if such compiler is = detected.

https://reviews.freebsd.org/D4= 5651 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--