From nobody Sun Nov 26 03:58:07 2023 X-Original-To: freebsd-arm@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 4SdFLh5xrbz52frb for ; Sun, 26 Nov 2023 03:58:20 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SdFLh3Zt2z3CN4 for ; Sun, 26 Nov 2023 03:58:20 +0000 (UTC) (envelope-from bakul@iitbombay.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-280260db156so2730058a91.2 for ; Sat, 25 Nov 2023 19:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20230601.gappssmtp.com; s=20230601; t=1700971099; x=1701575899; 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=T8HaCWnMYoKlf3rz2XbHPPdl4NVLdZBzfiynsnEpEDc=; b=IENslCeIrj8fValZf/f8jOk9WZyXGlaaZvrqdxiXOOnOjgVgfb7UJfpCHXrLR6Pha2 AMw/KqZqDDDghFXuG5/BO12RYkQhIiVBumkW5+yMVGgkjEp75xUsZpRFhd/g84Nz0Lyq b70ETgfMOiipvevmQRqU40Yw4RyFI7HUVEgTbcB7WAlTrrsiIS1yobwK5XNGSix2kvxi 9dvVe5Q4pXKxt/Foq9mW++IoX8h0sWqQ5+E+KjzYjagUzj7YBCbR8eXxXw57s9N84csY 5bED+TjqFCxhIQaKAT/Ryw5JiwpcfA5b4b8Bfzv09xBAwx/PZW/X0LL7oNa9sFpzxOvb X75A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700971099; x=1701575899; 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=T8HaCWnMYoKlf3rz2XbHPPdl4NVLdZBzfiynsnEpEDc=; b=iOioAGq8JPMJb+Ifzj8nGtbbBSpqcronb8CJcRW3rzA7k3bJs8MmwZBB9Y5tbTVqsA x/teG8ltt2R+p9sgd1JbiGF6H0wwjquzSPpkTHD7drFdjq79nRfDk4g5zQsQC6ApJ3Es 3Xcac43ZrdX4cv6ExX0rPUugaDnCmpnifLbIVHr2+DYrsqH7Z/l+wWRrdV05O5XrH0qZ Yq6qU97JuoOuQCOKRpHT8eOhEcqYmoJba/p6VuU7L80NZbAQ0Pvhq49xZVcTncF0Pso5 WhBDp1pZdWKWPj6p5YkTEP8r/tMpG680jW5izzZkbofsEIxVzidiNAT0Axz74s1aChDD GyyA== X-Gm-Message-State: AOJu0YzzQ6eCVcemKe6BCwpdH7yfmjHxr6mS1wDmtdgSTuKBtsb3Dmvo CBGEZB94g8kFGqTXcjyXjlQd3w== X-Google-Smtp-Source: AGHT+IH2tS7JwUjSXkdqsx2wbWz7qO59isuTgfmVk3MbjZPegI2Gkro/tmEH6kW8xBBe2uXc2wE7YQ== X-Received: by 2002:a17:90b:4b0f:b0:285:3444:94d2 with SMTP id lx15-20020a17090b4b0f00b00285344494d2mr9274050pjb.9.1700971098923; Sat, 25 Nov 2023 19:58:18 -0800 (PST) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id ca8-20020a17090af30800b002858ac5e401sm3359416pjb.45.2023.11.25.19.58.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Nov 2023 19:58:18 -0800 (PST) From: Bakul Shah Message-Id: <5668E8DE-B3B3-408D-978E-C2358A614803@iitbombay.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076" List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: sbrk Date: Sat, 25 Nov 2023 19:58:07 -0800 In-Reply-To: Cc: Joseph Holsten , "freebsd-arm@freebsd.org" To: Warner Losh References: <2F758BA2-F7F5-4A2C-85CF-6969EE50309C@iitbombay.org> <949f8f16-1219-4f4a-abf6-f9727c95681b@Spark> X-Mailer: Apple Mail (2.3774.200.91.1.1) 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: 4SdFLh3Zt2z3CN4 --Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On Nov 25, 2023, at 7:47=E2=80=AFPM, Warner Losh wrote: >=20 > On Sat, Nov 25, 2023, 8:44 PM > wrote: >> Yes, it=E2=80=99s no longer included. It=E2=80=99s long been = deprecated, but that does make porting things like the original vi a bit = challenging. >>=20 >> Is there a particular project you=E2=80=99re trying to use it for? >=20 >=20 > It was never included in FreeBSD/arm64 due to the fact that the = address space is complicated now and there no longer is an area beyond = bss that you can expand into... let alone contract... >=20 > Emacs was not happy with it... Thanks. Note that linux does provide it (may be not perfect but I = thought FreeBSD cared more about compatibility....).=20 This came up in trying to compile the v language https://github.com/vlang/v It uses a libgc which seems to be derived from some ancestor of BDW GC = and there are so many defines my eyes glaze over. >=20 > Warner >=20 >> -- >> Joseph Holsten >> On Nov 25, 2023 at 19:41 -0800, Bakul Shah >, wrote: >>> Does sbrk not exist on FreeBSD-14 on arm64? Is this by design? >>>=20 >>> $ cat sb.c >>> #include >>> #include >>> int main(int c, char**v) { >>> void *x =3D sbrk(102400); >>> printf("%p\n", x); >>> } >>> $ cc sb.c >>> ld: error: undefined symbol: sbrk >>> >>> referenced by sb.c >>> >>> /tmp/sb-e97caf.o:(main) >>> cc: error: linker command failed with exit code 1 (use -v to see = invocation) >>>=20 --Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 On Nov 25, = 2023, at 7:47=E2=80=AFPM, Warner Losh <imp@bsdimp.com> = wrote:

On Sat, Nov 25, 2023, 8:44 PM <joseph@josephholsten.com> = wrote:
Yes, it=E2=80=99s no longer included. It=E2=80=99s = long been deprecated, but that does make porting things like the = original vi a bit challenging.

Is there a particular project you=E2=80=99re trying to use it = for?

It was never included in = FreeBSD/arm64 due to the fact that the address space is complicated now = and there no longer is an area beyond bss that you can expand into... = let alone contract...

Emacs was not happy with = it...

Thanks. Note that = linux does provide it (may be not perfect but I thought FreeBSD cared = more about compatibility....). 

This came = up in trying to compile the v language

It uses a libgc which seems to be derived from some = ancestor of BDW GC and there are so many defines my eyes glaze = over.


Warner

--
Joseph Holsten
On Nov 25, 2023 at 19:41 -0800, Bakul = Shah <bakul@iitbombay.org>, wrote:
Does sbrk not exist on FreeBSD-14 = on arm64? Is this by design?

cat sb.c
#include <unistd.h>
#include <stdio.h>
int main(int c, char**v) {
        void *x =3D sbrk(102400);
        printf("%p\n", x);
}
$ cc sb.c
ld: error: undefined symbol: sbrk
>>> referenced by sb.c
>>>               = /tmp/sb-e97caf.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see = invocation)


= --Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076--