From nobody Sun Nov 26 03:43:57 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 4SdF2H3p3Tz52YVs for ; Sun, 26 Nov 2023 03:44:07 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (fuz.su [IPv6:2001:41d0:8:e508::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "fuz.su", Issuer "fuz.su" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SdF2H1BYcz4cQh for ; Sun, 26 Nov 2023 03:44:07 +0000 (UTC) (envelope-from fuz@fuz.su) Authentication-Results: mx1.freebsd.org; none Received: from fuz.su (localhost [127.0.0.1]) by fuz.su (8.17.1/8.17.1) with ESMTPS id 3AQ3hwo0025006 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 26 Nov 2023 04:43:58 +0100 (CET) (envelope-from fuz@fuz.su) Received: (from fuz@localhost) by fuz.su (8.17.1/8.17.1/Submit) id 3AQ3hvqJ025005; Sun, 26 Nov 2023 04:43:57 +0100 (CET) (envelope-from fuz) Date: Sun, 26 Nov 2023 04:43:57 +0100 From: Robert Clausecker To: Bakul Shah Cc: freebsd-arm@freebsd.org Subject: Re: sbrk Message-ID: References: <2F758BA2-F7F5-4A2C-85CF-6969EE50309C@iitbombay.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2F758BA2-F7F5-4A2C-85CF-6969EE50309C@iitbombay.org> 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:16276, ipnet:2001:41d0::/32, country:FR] X-Rspamd-Queue-Id: 4SdF2H1BYcz4cQh Hi Bakul, The sbrk() call indeed does not exist on arm64. Use mmap() or malloc() instead. Yours, Robert Clausecker Am Sat, Nov 25, 2023 at 07:41:11PM -0800 schrieb Bakul Shah: > Does sbrk not exist on FreeBSD-14 on arm64? Is this by design? > > $ cat sb.c > #include > #include > int main(int c, char**v) { > void *x = 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) > -- () ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments