From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AUY5OoRXsGly/CEAWB0awg (envelope-from ) for ; Tue, 10 Mar 2026 13:40:20 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KqpwdbLN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E3EB51E089; Tue, 10 Mar 2026 13:40:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 601321E089 for ; Tue, 10 Mar 2026 13:40:20 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id E52384BAD150 for ; Tue, 10 Mar 2026 17:40:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E52384BAD150 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KqpwdbLN Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 932CE4BAD159 for ; Tue, 10 Mar 2026 17:39:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 932CE4BAD159 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 932CE4BAD159 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773164357; cv=none; b=ZYLRNdg4pVUs2fom87yR1j1PVn85z/4kbBITY+RKuogbZWWvMBunZW2yoYp4LIDBwloWhywdnxLwofHFr9R9lcfeVDwOtV95f197Di2O48tFd/8Uq1lDCUoqQEbqsHdA1Ok1lsaHycs43zlFMmela+oXeuPGj+0gXve6bWvm8Lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773164357; c=relaxed/simple; bh=TYAZ1AgnWwZkIQmly7/fcsskQxg8qSP+O20zx2s3HC4=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=VWBDb47T5v75RuDEwsimGvm9oQezzNJQyFQcgFkpBsIK7UymObxwcabOcORSGbbqUQKhOuSQW/ILUJq/0tm1lsncekqHmg77CSdMfZNGIf+PNcaOYsT0HkLpGlrHBxlbk5ofFWxbnyNL4s6BlGGnGBInRNx+E9CtCY9PqFmcj6k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 932CE4BAD159 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773164357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LsbmyPJkDUHkQmqBobUdFIR3FeCYQzM8uhJdZTi4N3w=; b=KqpwdbLNtG6JVKVtScbLMP4OmFFR7ZJlQm/LvcZEczBOcDKGlxmpaPNxllh3TwR3IeJGS/ pRwgRbyhJSsSgq4n8DRqWdONNgts9h3pYRrlvSoZ2Q3zy3+1cbR7i1GKi4nIDiR7T9tE78 2v8SpVMFD/xpGzz19G4cMXBxxObQYZg= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-grKzeLExMA6U_VkjUznwMQ-1; Tue, 10 Mar 2026 13:39:13 -0400 X-MC-Unique: grKzeLExMA6U_VkjUznwMQ-1 X-Mimecast-MFC-AGG-ID: grKzeLExMA6U_VkjUznwMQ_1773164352 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9916A195605A; Tue, 10 Mar 2026 17:39:11 +0000 (UTC) Received: from f42-zbm-amd (unknown [10.22.88.47]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C84E180049D; Tue, 10 Mar 2026 17:39:08 +0000 (UTC) Date: Tue, 10 Mar 2026 10:39:05 -0700 From: Kevin Buettner To: Sunil Kumar Dora Cc: gdb-patches@sourceware.org, Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com, macro@orcam.me.uk, schwab@linux-m68k.org, tromey@sourceware.org, simark@simark.ca Subject: Re: [PATCH v2] PR gdb/33747: gdb/ser-unix: Avoid musl build failure when setting custom baud rates Message-ID: <20260310103905.5c9a293e@f42-zbm-amd> In-Reply-To: <5eed2d46-87fe-4a75-8246-bcda5438d826@windriver.com> References: <20260222200648.2648865-1-sunilkumar.dora@windriver.com> <20260308182509.18b4fe0d@f42-zbm-amd> <5eed2d46-87fe-4a75-8246-bcda5438d826@windriver.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LdCn7WfeGhTcitG_RzDwY0w8CMRgweLbESmCKLwizfI_1773164352 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Tue, 10 Mar 2026 19:08:15 +0530 Sunil Kumar Dora wrote: > > 3) I'd like to better understand what we might be losing by > > eliminating the fallback to TCGETS. =20 > While looking into this, I noticed that on some architectures such as=20 > PowerPC and Alpha, the normal > /struct termios/ (not /termios2/) actually has /c_ispeed/ and /c_ospeed/= =20 > fields. Because of this, > those systems *might *still support custom baud rates using the older=20 > /TCGETS/ interface. >=20 > The *build failure on musl *happens because musl follows strict POSIX,=20 > and its /struct termios/ does not > include these members (`/c_ispeed`/ and `/c_ospeed`/) on any architecture= . >=20 > To handle both cases, would it make sense to keep the /TCGETS/ fallback= =20 > but guard it with a feature check like > /AC_CHECK_MEMBERS([struct termios.c_ospeed])/? >=20 > That way we can still support the legacy behavior on glibc systems,=20 > while avoiding build issues on musl > where those fields don't exist. >=20 > This would result in something like the following compile-time paths: > ---- > /#if defined(HAVE_CFSETSPEED_ARBITRARY) > =C2=A0 /* Use cfsetispeed()/cfsetospeed() */ >=20 > #elif defined(TCGETS2) > =C2=A0 /* Use Linux termios2 interface with BOTHER */ >=20 > #elif defined(HAVE_STRUCT_TERMIOS_C_OSPEED) && defined(BOTHER) > =C2=A0 /* Legacy fallback using TCGETS/TCSETS */ >=20 > #else > =C2=A0 /* Custom baud rates not supported */ > #endif/ >=20 >=20 > I=E2=80=99m thinking this might be a reasonable approach, but please let = me know=20 > if I=E2=80=99m missing something. That approach looks reasonable to me. Kevin