Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp443207rdb; Sat, 27 Jan 2024 13:23:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTIc/0lG4enVrRYOxF3OnDvyR6cIt/dWtE3nxH6XH4cHiIay9WmbHeeCFCbR+uC9opvNp5 X-Received: by 2002:a17:906:a013:b0:a34:96e9:f46c with SMTP id p19-20020a170906a01300b00a3496e9f46cmr1503918ejy.31.1706390615053; Sat, 27 Jan 2024 13:23:35 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l8-20020a17090612c800b00a3157e0a967si1838823ejb.103.2024.01.27.13.23.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 13:23:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41402-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-41402-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C99831F22D01 for ; Sat, 27 Jan 2024 21:23:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8402C1B7EE; Sat, 27 Jan 2024 21:23:28 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB8E1B5A2 for ; Sat, 27 Jan 2024 21:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706390608; cv=none; b=CBeDnh3Ymukfnm9oVU0gFRA2Fl/A2BlfB93GntG72ikDCd8FcEf3SRLlbJzQnXt7FwHTYsXf3Ri33ydCzFO9+XeX/TVFYYctcTIafna2slPUtFxzcHx5k2h1e/2sJZypzJFWSobeHXF8lvXD9toVsvXa54WnKLoLj4IId6FHZHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706390608; c=relaxed/simple; bh=YkqaicGETk+XKynlgPWOudIML4WAqhf9XLhiYoty3Yk=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=KKUby8nsvjIKd7KknUxPnUQW45hqK9UrjEzau4y6Rq4RRx3ILCJY+pLOwOGBNsP/he62aD7sn265CGKeNuh0fV47cD7VbElGu94WWbRDDdDs49XfSU6qytFTrJ1p9yAQ1kCxUbclsNhI4rlXCjdQJSuDR5MUNs3mpavSsy6u834= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.86.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-81-GfvnfuAlPfiYfhrNVHlMsw-1; Sat, 27 Jan 2024 21:23:21 +0000 X-MC-Unique: GfvnfuAlPfiYfhrNVHlMsw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sat, 27 Jan 2024 21:23:01 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sat, 27 Jan 2024 21:23:01 +0000 From: David Laight To: 'Willy Tarreau' , =?iso-8859-1?Q?Thomas_Wei=DFschuh?= CC: Rodrigo Campos , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 0/1] tools/nolibc/string: export strlen() Thread-Topic: [PATCH 0/1] tools/nolibc/string: export strlen() Thread-Index: AQHaUT7WVqm/RgPyLEmfaSR8/02gXLDuKmvw Date: Sat, 27 Jan 2024 21:23:01 +0000 Message-ID: <512849f3c22e4f4688c20fabe017c903@AcuMS.aculab.com> References: <20240126142411.22972-1-rodrigo@sdfg.com.ar> <9abed5e3-cd61-474e-bb16-13243709f5c5@t-8ch.de> <20240127162400.GA14079@1wt.eu> In-Reply-To: <20240127162400.GA14079@1wt.eu> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable . > Yes, once we have the proof that the compiler may produce such a call, it > can also happen in whatever user code so we need to export the function, > there's no other solution. Does that mean that it you try to implement strlen() in C gcc will generate a recursive call? I guess an 'asm volatile("");' in the loop fix it. Although, IIRC, you need a comment in the asm - and there isn't a portable comment. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)