From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 312611F953 for ; Thu, 28 Oct 2021 19:39:17 +0000 (UTC) Received: from localhost ([::1]:52976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgBF5-00028X-O6 for normalperson@yhbt.net; Thu, 28 Oct 2021 15:39:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgB8d-0004sC-UG for bug-gnulib@gnu.org; Thu, 28 Oct 2021 15:32:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgB8a-0008GO-3m for bug-gnulib@gnu.org; Thu, 28 Oct 2021 15:32:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635449550; 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: in-reply-to:in-reply-to:references:references; bh=cY9ODPkWFtEZsIJy2zAmYScZZV1HSD+mRIsXAdUp0oo=; b=QWyWpx80hQi9xnzGZ5BgqylCwGFo9lyfUVlnpcTkPNCq8qvWV3s6TvkgRKY4IcHqgZl0z5 FHCgkcI3P+YWd1CNmZBSWZmr/Aa9x5UNOtEXGNLd1Q/P6L8u068BdIiDEHYFjlKougDCpG 0MXtPe81VhvoubJMHY1GhDQu2Aa5CKU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-iQzh2VBUNp2jkhboM5WDTA-1; Thu, 28 Oct 2021 15:32:26 -0400 X-MC-Unique: iQzh2VBUNp2jkhboM5WDTA-1 Received: by mail-qt1-f197.google.com with SMTP id o14-20020a05622a138e00b002a79da5b350so5152146qtk.15 for ; Thu, 28 Oct 2021 12:32:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=cY9ODPkWFtEZsIJy2zAmYScZZV1HSD+mRIsXAdUp0oo=; b=e0AJZj0VqNy/PGxPcsQMAXlQIT41z+FEkzL4ehVq5KqGTvx/9FSliLBFv2Xopf6GQR DfuT3A9xawNl3QtLw3mMUeEwYOY13XQKw61JR4JqUw6paj/htQAVBsJua1gfltfplBg3 NRew9VxV2BwNoa8sg/Q5PJgSV86QiEqhhpShIqeFe+Zg3XsBeHBdXasdMrJU8kfcg4S3 jjGxa7FdPaWyBZ6v/zj3VyZrq9wACWj78kN+7wFZnOWAekEeYS1Si6Tn18m5EuujV5V2 /wwHvVip7/0GE1tAMUSfELo+F/Hia0CGNnikh7e/b6zNpscs/FSwvuiZviQ7TXH/18OC eYhg== X-Gm-Message-State: AOAM5338teY0ZeAZh60Cn0DscdxkvyqLxo4HJc6bPNapw6gI9N5NXtNW sip/kpX7KVlOE+RmJFRqY+QwIp17VE9wPzpU3ZkFiHbiF5BiyzoyLNoIaV9khQPa+65v34uPW7M 4Kh1jejUgI9k= X-Received: by 2002:a37:4017:: with SMTP id n23mr2126976qka.44.1635449546071; Thu, 28 Oct 2021 12:32:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuOVVAvQ+IAw9QKl4uxx331zdXM9ETgKpDpKieOXZXX8IAC2ljCSGDiTzXdbXzavR5SXJ/IQ== X-Received: by 2002:a37:4017:: with SMTP id n23mr2126949qka.44.1635449545665; Thu, 28 Oct 2021 12:32:25 -0700 (PDT) Received: from localhost ([2601:184:4181:74c0:862e:5809:ed9e:e10e]) by smtp.gmail.com with ESMTPSA id n20sm2552214qkk.63.2021.10.28.12.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 12:32:24 -0700 (PDT) From: Robbie Harwood To: Simon Josefsson Subject: Re: [PATCH 01/11] Fix base64 module to work with grub codebase In-Reply-To: <87y26eafbr.fsf@latte.josefsson.org> References: <20211025215543.111906-1-rharwood@redhat.com> <20211025215543.111906-2-rharwood@redhat.com> <87y26eafbr.fsf@latte.josefsson.org> Date: Thu, 28 Oct 2021 15:32:20 -0400 Message-ID: MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=rharwood@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=170.10.129.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 28 Oct 2021 15:39:04 -0400 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Patrick Steinhardt , bug-gnulib@gnu.org, Daniel Kiper Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" --=-=-= Content-Type: text/plain Simon Josefsson writes: > Robbie Harwood writes: > >> The gnulib module makes use of booleans via the header. As >> GRUB does not provide any POSIX wrapper header for this, but instead >> implements support for bool in , we need to patch >> base64.h to not use anymore. We unfortunately cannot include >> instead, as it would then use gnulib's internal header >> while compiling the gnulib object but our own when >> including it in a GRUB module. Because of this, the patch replaces the >> include with a direct typedef. > > Thanks for trying to upstream diverged gnulib code! > > I think this patch is wrong -- gnulib includes a stdbool.h replacement > you can you use, and the base64 module depends on the stdbool module > already. Is there a problem with the stdbool module? If so, let's fix > that. This is helpful feedback, thank you. I don't know why Patrick chose to not use that instead, but a local test seems to work. >> A second fix is required to make available _GL_ATTRIBUTE_CONST, which >> is provided by the configure script. As base64.h does not include >> , it is thus not available and results in a compile error. >> This is fixed by adding an include of . > > I think I agree that this is a problem, but your solutions seems wrong. > There are plenty of header files in gnulib that relies on definitions in > config.h created by the m4 macro that came with the hader file, yet the > header file do not #include config.h as usually that is supposed to be > done by the .c file that include the (say) base64.h header file. I'm > not sure assumption is documented anywhere, and if so we should document > it. I think this is how it is supposed to work, but if it isn't, we > should try to come up with a solution for it and document that. I probably would have been better served by editing the patch description a bit more here from the original. To start over from having poked at it more: grub2 shims out config.h for some build targets (e.g., when not building utilities). So the bits that gnulib's configuration have created end up in config-util.h - which only sometimes is what config.h is. Base64 is used in the luks2 code, which is not always a utility. It would be nice to have the files gnulib gives us be "complete" and not need to know things about the compiler, but honestly this seems a bit like a problem of grub2's making. So I think our way forward is to move where we nerf _GL_ATTRIBUTE_CONST in grub2. I've tested that this works and will submit to grub2. Longer-term, this problem could be avoided by dropping the const attribute from isbase64(). Since uchar_in_range is a macro, b64 is const, and to_uchar() doesn't do anything, the compiler should be able to infer this anyway. (Adding an inline marker to to_uchar() might help with this.) What do you think? grub2 proposed change: https://lists.gnu.org/archive/html/grub-devel/2021-10/msg00208.html Assuming grub2 accepts this in some form, I think we can consider this patch dropped from the series. Be well, --Robbie --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEA5qc6hnelQjDaHWqJTL5F2qVpEIFAmF6+sQUHHJoYXJ3b29k QHJlZGhhdC5jb20ACgkQJTL5F2qVpELAlA/+Ixs1Y4dfOizyYtYs6wU/eZWXsfhQ mBIxoxaLTAQ3FAcHf1tuvbP1CsUByIQu4CJsNU9mHYuz9jWKXoHEzUHRYXhCj8Ey /rNVwN66DbL5XEuWHw7bv2qW7W3AgUMIaagaScGa7+k/xDsuq2VkV2ZGxQwR6Oe6 9YCcY2bVXkGo20AlvRL1Smg95PLshuAuSnSju379mc5GapXXrGHlQIMBH4Tf0RPU PJ9KP21DaNysxzWR+BsHOUQ5Oa8YCOCqa1cZY4uTaLKezfUSI7Fd2v5eZh/UtTB1 F/62UNX6osH8BsuwLH8fqckDRCutvFrL753UjG90qqi7/g4R3S1PKK6Ez/nGcki8 MWCyRt06kx/YWvTvyzh5HuP9qQfe7EuKrn1sjNtMm/cqJVmzZX75hAafRcTzWRuf eWBW+l5FU7af+5BUQuhhiZV8gTVbXtmCSVd0e4ZnLWEOrW4zF8tYq913haICQAfV OATPpayHb7fRQPWAbeg5zgdZSGcX+DlR8TEzYnGV2YP/MNP1VjB57fpaGk/wYkt2 vEnpt9BL9G3MJIVkt+Jxz1gm6tewcv6WVZf3QYy2a3oEKO2P3H0IbV/h4gHycBUs RXC5yJdYkw1U4MT7MX9yG95nqYN69IkL6yKv0C81GHinNcqpvp830aU9lZtykM/c Kwh1rr2KoK+6zMc= =Sr00 -----END PGP SIGNATURE----- --=-=-=--