From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 107FAC54EE9 for ; Thu, 8 Sep 2022 18:04:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F03384AD8; Thu, 8 Sep 2022 20:04:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="UX+bN25r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DCFDD8499C; Thu, 8 Sep 2022 20:04:23 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9808E84AF8 for ; Thu, 8 Sep 2022 20:04:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 30C6DB82190 for ; Thu, 8 Sep 2022 18:04:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB67BC433D6 for ; Thu, 8 Sep 2022 18:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662660260; bh=xUUwxljrM0z5n/qAzh+w0E1LwKZACyfsWv+e3sbFGSI=; h=Resent-From:Resent-Date:Resent-To:From:To:Cc:Subject:Date:From; b=UX+bN25rikQA6YCdOau7C88XI9quAq/rWI0Y/5RIwKst8PijHL78KUFCkyg/BWHaf L+ui2eFJUGllfDnDtN01IbANwkCi4rp0MmkYsOocHa/jiup8hI17ge7eKPgx5H2auU AHFgS9Kl6Nf/IeEMFA9n8WzYzRnGlBYi4A6QX+GcU6e4xaN7QPru5aAgVcGosbReqO G5O2Ggbszrt+wDmauX8v8qaeTafD4HWxfwZ2CgKLf/OSqOfZeoELEgSPlnDzYh/sc0 Z+Go77vE1Mw8hkwxO1Cr0+xnxOr6k3r0UQGV9UuRBTbVUrIs/k1plga5zIFRt6e86T stChrZbnzKzKw== Received: by pali.im (Postfix) id 898E87EF; Thu, 8 Sep 2022 20:04:16 +0200 (CEST) Resent-From: Pali =?utf-8?B?Um9ow6Fy?= Resent-Date: Thu, 8 Sep 2022 20:04:16 +0200 Resent-Message-ID: <20220908180416.3szdjqmr5lryhwmz@pali> Resent-To: u-boot@lists.denx.de Received: by pali.im (Postfix) id ACFD67EF; Thu, 8 Sep 2022 16:59:47 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , Michal Vasilek Subject: [PATCH] tools: termios_linux.h: Fix compilation on non-glibc systems Date: Thu, 8 Sep 2022 16:59:36 +0200 Message-Id: <20220908145936.29234-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean TCGETS2 is defined in header file asm/ioctls.h provided by linux kernel. On glib systems it is automatically included by some other glibc include header file and therefore TCGETS2 is present in termios_linux.h when linux kernel provides it. On non-glibc systems (e.g. musl) asm/ioctls.h is not automatically included which results in the strange error that BOTHER is supported, TCGETS2 not defined and struct termios does not provide c_ispeed member. tools/kwboot.c: In function 'kwboot_tty_change_baudrate': tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed' 662 | tio.c_ospeed = tio.c_ispeed = baudrate; | ^ Fix this issue by explicitly including asm/ioctls.h file which provides TCGETS2 macro (if supported on selected architecture) to not depending on glibc auto-include behavior and because termios_linux.h requires it. With this change it is possible compile kwboot with musl libc. Reported-by: Michal Vasilek Signed-off-by: Pali Rohár --- Stefan, could you include this patch into -rc queue so kwboot can be compiled also with musl libc? --- tools/termios_linux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/termios_linux.h b/tools/termios_linux.h index 45f5c1233c01..0806a91180a0 100644 --- a/tools/termios_linux.h +++ b/tools/termios_linux.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #if defined(BOTHER) && defined(TCGETS2) -- 2.20.1