Date: Sat, 25 Nov 2023 19:58:07 -0800 From: Bakul Shah <bakul@iitbombay.org> To: Warner Losh <imp@bsdimp.com> Cc: Joseph Holsten <joseph@josephholsten.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: sbrk Message-ID: <5668E8DE-B3B3-408D-978E-C2358A614803@iitbombay.org> In-Reply-To: <CANCZdfqcA-kLd3gLWkcD1%2BPGFg48TPAF=OPk9HzRFyaokZbvAQ@mail.gmail.com> References: <2F758BA2-F7F5-4A2C-85CF-6969EE50309C@iitbombay.org> <949f8f16-1219-4f4a-abf6-f9727c95681b@Spark> <CANCZdfqcA-kLd3gLWkcD1%2BPGFg48TPAF=OPk9HzRFyaokZbvAQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <imp@bsdimp.com> wrote: >=20 > On Sat, Nov 25, 2023, 8:44 PM <joseph@josephholsten.com = <mailto: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. >>=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 <bakul@iitbombay.org = <mailto:bakul@iitbombay.org>>, wrote: >>> Does sbrk not exist on FreeBSD-14 on arm64? Is this by design? >>>=20 >>> $ 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) >>>=20 --Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076 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 Nov 25, = 2023, at 7:47=E2=80=AFPM, Warner Losh <imp@bsdimp.com> = wrote:<br><div><blockquote type=3D"cite"><div><div = dir=3D"auto"><div><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Sat, Nov 25, 2023, 8:44 PM <<a = href=3D"mailto:joseph@josephholsten.com">joseph@josephholsten.com</a>> = wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 = .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div> <div name=3D"messageBodySection"> <div dir=3D"auto">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.<br> <br> Is there a particular project you=E2=80=99re trying to use it = for?</div></div></div></blockquote></div></div><div = dir=3D"auto"><br></div><div dir=3D"auto">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...</div><div dir=3D"auto"><br></div><div = dir=3D"auto">Emacs was not happy with = it...</div></div></div></blockquote><div><br></div>Thanks. Note that = linux does provide it (may be not perfect but I thought FreeBSD cared = more about compatibility....). </div><div><br></div><div>This came = up in trying to compile the v language</div><div><a = href=3D"https://github.com/vlang/v">https://github.com/vlang/v</a></div><d= iv><br></div><div>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.</div><div><br><blockquote type=3D"cite"><div><div dir=3D"auto"><div = dir=3D"auto"><br></div><div dir=3D"auto">Warner</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><div = name=3D"messageSignatureSection"> -- <div dir=3D"auto">Joseph Holsten</div> </div> <div name=3D"messageReplySection">On Nov 25, 2023 at 19:41 -0800, Bakul = Shah <<a href=3D"mailto:bakul@iitbombay.org" target=3D"_blank" = rel=3D"noreferrer">bakul@iitbombay.org</a>>, wrote:<br> <blockquote type=3D"cite" = style=3D"border-left-color:grey;border-left-width:thin;border-left-style:s= olid;margin:5px 5px;padding-left:10px">Does sbrk not exist on FreeBSD-14 = on arm64? Is this by design? <div><br></div> <div><font face=3D"Menlo">$ </font>cat sb.c</div> <div>#include <unistd.h></div> <div>#include <stdio.h></div> <div>int main(int c, char**v) {</div> <div> void *x =3D sbrk(102400);</div> <div> printf("%p\n", x);</div> <div>}</div> <div>$ cc sb.c</div> <div>ld: error: undefined symbol: sbrk</div> <div>>>> referenced by sb.c</div> <div>>>> = /tmp/sb-e97caf.o:(main)</div> <div>cc: error: linker command failed with exit code 1 (use -v to see = invocation)</div> <div><br></div> </blockquote> </div> </div> </blockquote></div></div></div> </div></blockquote></div><br></body></html>= --Apple-Mail=_C2A9D6C6-1581-46BD-BA39-083AF3921076--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5668E8DE-B3B3-408D-978E-C2358A614803>