From patchwork Sun Dec 10 20:25:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36002 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B51E0C46CC5 for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mx.groups.io with SMTP id smtpd.web11.63104.1702239952590929758 for ; Sun, 10 Dec 2023 12:25:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c7Ydh5RH; spf=pass (domain: gmail.com, ip: 209.85.210.173, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6ce939ecfc2so3145050b3a.2 for ; Sun, 10 Dec 2023 12:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239951; x=1702844751; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3jO7A2PTVpybtGsQBvnypA23A2TCoIHZ9hsklKJx6+E=; b=c7Ydh5RH2GaeEa60VJt+p9MEtWRk0bUwqbzmOE1BO2ASgU2n9zICPT/nUcboZvsO6E 3yr/tlL8AtaMFasdytY3xLTZgcYuvVWAqaLjlwqpXZSlGcwoh57rRDPJtOt1h1846MWz PNRrGP52WRDWJZY/WFuIL8W5dxJUpqyhD4docoY/wP5VUEMjHSxpC4aSn+wjROWI7Hqm 3/uRiQq5Glos+8oYEd7koyoHaPc78UK9aA7vmFdgRwklnnN9xQaeLtqMqlN507gCtbfg GCRyzC3qlWL+H2Rp49Q1Hv6/xExrPhOwNevg85iWXaO/hL0gWdUNmmU3zzoWutWb8TmU +GLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239951; x=1702844751; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3jO7A2PTVpybtGsQBvnypA23A2TCoIHZ9hsklKJx6+E=; b=wvwhbxwnXMoWGc4TP8rcb4g+COkrCFcPJ39aDw6PfBJPcMfDxuAgDLQZ04OU+ogaNE 56aaN3/YMpa7KEXhV8ycPD8NpkJ3wVgfFxG27lL3GD7KF+pIuMD4Tlvl2YkKLHjfxq/N HmDc70vk9PoGyVIPuv5zuQDXDgWg+6TQZkDciWmzD5Ln1esZd0pEN9qZhuu675A6CfZ1 /Taq6PgDDqcH91RhwpTh9oxVysju9jQPZoI7buZ6rsgEwb0KLvmX8AsleGXkcTOUC6hB VPbv4aHspCglj+qxbzrVC/lYKo3jXMG3byKAnEXLzwEOeAghyXFDSHjeLeHlecLCN6x2 umbw== X-Gm-Message-State: AOJu0YyzDdF0dxqOtMYAfX1cKzUDloKL0tFyQc18xSbOt3lqX4BbcM+a okm9czxFD+Mv9DYi3kK6V7qcZjwqcao= X-Google-Smtp-Source: AGHT+IFq1XnAsdAcXgAbRcwB1+lYkO3GqvvETLgtz1/VPLyJoUlLIQUgGO3N3byiDfxP+5fRWZYF7w== X-Received: by 2002:a05:6a00:3906:b0:6ce:fb65:3ceb with SMTP id fh6-20020a056a00390600b006cefb653cebmr2208522pfb.51.1702239951533; Sun, 10 Dec 2023 12:25:51 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:51 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 1/6] opkg: Use own version of portable basename function Date: Sun, 10 Dec 2023 12:25:44 -0800 Message-ID: <20231210202549.155550-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192119 Fixes build with upcoming musl release. Signed-off-by: Khem Raj --- ...Provide-basename-function-as-utility.patch | 131 ++++++++++++++++++ meta/recipes-devtools/opkg/opkg_0.6.2.bb | 1 + 2 files changed, 132 insertions(+) create mode 100644 meta/recipes-devtools/opkg/opkg/0001-libopkg-Provide-basename-function-as-utility.patch diff --git a/meta/recipes-devtools/opkg/opkg/0001-libopkg-Provide-basename-function-as-utility.patch b/meta/recipes-devtools/opkg/opkg/0001-libopkg-Provide-basename-function-as-utility.patch new file mode 100644 index 00000000000..91b00bb4085 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0001-libopkg-Provide-basename-function-as-utility.patch @@ -0,0 +1,131 @@ +From c3770c1254a288f1312a66ebf4a5da60a1ae215b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 9 Dec 2023 17:07:22 -0800 +Subject: [PATCH] libopkg: Provide basename function as utility + +glibc provides two implementations one when string.h is used and Posix +compliant one from libgen.h when string.h is not included. Lets +implement gnu compliant version using strchr and use it Everywhere for +portability reasons. This will help compiling with next release of musl +where signature is removed from strin.h [1] + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://lists.yoctoproject.org/g/opkg/message/11] +Signed-off-by: Khem Raj +--- + libopkg/opkg_archive.c | 2 +- + libopkg/opkg_download.c | 6 ++---- + libopkg/opkg_remove.c | 2 +- + libopkg/pkg.c | 4 +--- + libopkg/xfuncs.c | 6 ++++++ + libopkg/xfuncs.h | 1 + + 6 files changed, 12 insertions(+), 9 deletions(-) + +diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c +index 03a4afb..da37d8a 100644 +--- a/libopkg/opkg_archive.c ++++ b/libopkg/opkg_archive.c +@@ -797,7 +797,7 @@ int gz_write_archive(const char *filename, const char *gz_filename) + } + + /* Remove path hierarchy, as we are only compressing a single file */ +- archive_entry_set_pathname(entry, basename(filename)); ++ archive_entry_set_pathname(entry, xbasename(filename)); + + r = archive_write_header(a, entry); + if (r != ARCHIVE_OK) { +diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c +index 4086f83..130a8c1 100644 +--- a/libopkg/opkg_download.c ++++ b/libopkg/opkg_download.c +@@ -158,7 +158,6 @@ static char *get_cache_location(const char *src) + char *md5sum_hex; + char *cache_location; + char *short_file_name; +- char *tmp = xstrdup(src); + + md5_buffer(src, strlen(src), md5sum_bin); + md5sum_hex = md5_to_string(md5sum_bin); +@@ -168,14 +167,13 @@ static char *get_cache_location(const char *src) + * MAX_SHORT_FILE_NAME_LENGTH to ensure that the total cache file name + * length is reasonable. + */ +- short_file_name = basename(tmp); ++ short_file_name = xbasename(src); + if (strlen(short_file_name) > MAX_SHORT_FILE_NAME_LENGTH) + short_file_name[MAX_SHORT_FILE_NAME_LENGTH] = '\0'; + + sprintf_alloc(&cache_location, "%s/%s_%s", opkg_config->cache_dir, + md5sum_hex, short_file_name); + free(md5sum_hex); +- free(tmp); + return cache_location; + } + +@@ -361,7 +359,7 @@ int opkg_download_pkg_to_dir(pkg_t * pkg, const char *dir) + char *url = NULL; + int err = 0; + +- sprintf_alloc(&dest_file_name, "%s/%s", dir, basename(pkg->filename)); ++ sprintf_alloc(&dest_file_name, "%s/%s", dir, xbasename(pkg->filename)); + + if (opkg_config->volatile_cache) { + url = get_pkg_url(pkg); +diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c +index 889c672..e9d5714 100644 +--- a/libopkg/opkg_remove.c ++++ b/libopkg/opkg_remove.c +@@ -215,7 +215,7 @@ void remove_maintainer_scripts(pkg_t * pkg) + return; + + for (i = 0; i < globbuf.gl_pathc; i++) { +- filename = xstrdup(basename(globbuf.gl_pathv[i])); ++ filename = xstrdup(xbasename(globbuf.gl_pathv[i])); + lastdot = strrchr(filename, '.'); + *lastdot = '\0'; + // Only delete files that match the package name (the glob may match files +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index 6b1bd8f..3d13fed 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -271,10 +271,8 @@ int pkg_init_from_file(pkg_t * pkg, const char *filename) + + pkg->local_filename = xstrdup(filename); + +- tmp = xstrdup(filename); + sprintf_alloc(&control_path, "%s/%s.control.XXXXXX", opkg_config->tmp_dir, +- basename(tmp)); +- free(tmp); ++ xbasename(filename)); + fd = mkstemp(control_path); + if (fd == -1) { + opkg_perror(ERROR, "Failed to make temp file %s", control_path); +diff --git a/libopkg/xfuncs.c b/libopkg/xfuncs.c +index 9ee1a7d..11e3d92 100644 +--- a/libopkg/xfuncs.c ++++ b/libopkg/xfuncs.c +@@ -110,3 +110,9 @@ extern char *xdirname(const char *path) + free(pathcopy); + return parent; + } ++/* implement Glibc basename behavior */ ++const char *xbasename(const char *path) ++{ ++ const char *tmp = strrchr(path, '/'); ++ return tmp ? tmp+1 : path; ++} +diff --git a/libopkg/xfuncs.h b/libopkg/xfuncs.h +index 5d278b4..0d4ef32 100644 +--- a/libopkg/xfuncs.h ++++ b/libopkg/xfuncs.h +@@ -30,5 +30,6 @@ extern void *xcalloc(size_t nmemb, size_t size); + extern char *xstrdup(const char *s); + extern char *xstrndup(const char *s, int n); + extern char *xdirname(const char *path); ++extern const char *xbasename(const char *path); + + #endif /* XFUNCS_H */ +-- +2.43.0 + diff --git a/meta/recipes-devtools/opkg/opkg_0.6.2.bb b/meta/recipes-devtools/opkg/opkg_0.6.2.bb index 46be137354c..02f4a46561e 100644 --- a/meta/recipes-devtools/opkg/opkg_0.6.2.bb +++ b/meta/recipes-devtools/opkg/opkg_0.6.2.bb @@ -15,6 +15,7 @@ PE = "1" SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ file://opkg.conf \ file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ + file://0001-libopkg-Provide-basename-function-as-utility.patch \ file://run-ptest \ " From patchwork Sun Dec 10 20:25:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36006 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2949C10F09 for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by mx.groups.io with SMTP id smtpd.web11.63106.1702239953610270668 for ; Sun, 10 Dec 2023 12:25:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=knxYG5lN; spf=pass (domain: gmail.com, ip: 209.85.167.177, mailfrom: raj.khem@gmail.com) Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3b9e2d50e61so2398227b6e.2 for ; Sun, 10 Dec 2023 12:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239952; x=1702844752; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qAdmjhhhgXLoGcCy+ctTj6LXTzx70lj9iRAExEe49/8=; b=knxYG5lNaUvjox3JKm1/H6y41Lfk/gpn5+SE0dm0gXq6Dmdg726C0mTz9b1ASCSrLg DGyP+sscZKVbp6XL6d4X/EwzwdmPaH52xmM787Okcp7JrAwJf42o8MAklWyRTz8Jr68y PHtyqlVOJwwbWDFY1tviDLHXNKl3JXWud5mCelfFA1UES+cMe44RiJitS6lYfbhz+pw3 CBnebxHA9y0iOSGeDi7gpZHgM14DSeIrN/tt4BJcCKrYQMo19hYZkPl8IQqpkH8jUXtw ySEJrEZG88YFLdcr+tpIzWCf2YUsOTEvL2VAl2BimDo975j4prBAv5+9tth23kdnlW/6 UJ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239952; x=1702844752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qAdmjhhhgXLoGcCy+ctTj6LXTzx70lj9iRAExEe49/8=; b=ItBZQdms4NQuOptAZxAUat2U42iAIfwElwZmdWMHit97kYYOurGyPAvCK8/Tz+/Gs2 T3i6fwJzGpgj6FV4kHnvg8Edur86Yk0QnWj95tXrNODHqbTj44VJpUo7bqtujMKa1mQR YEIzsmnmBQbh/VvVlw2jZw9kPniJQ+7NnVrylI9veVfXHgUpvtbuZ1uztng0Swnn0Adm 7IWLu91jTAN38heRanFXh/wyMswgix4qrrBU3T1yVOc+gtR1+3tf9rovOsUvnPSLhB/4 tG4U0zpn0xtuT+Ourz/UKHyDtLg6LTMYsz4cY4K4mgo2jygsCLKXDwKrGuZ36QJk5jcV xFvg== X-Gm-Message-State: AOJu0Yzz4lgtzEqg0HKis+59CVJdi98HCHRcQooUM7owN54HZWkC9/5M YZ3Nau7+b2rw5q/MSJQpbbA06tmsHKY= X-Google-Smtp-Source: AGHT+IGHzxawLBLmgqRxb0xNsWeAW3Txdr4HT+62MXvPa1TxL5wBv5aNLg6m7I/QzDwC0DV+WZ4LzA== X-Received: by 2002:a05:6808:198e:b0:3b9:e3a2:16e5 with SMTP id bj14-20020a056808198e00b003b9e3a216e5mr3756289oib.77.1702239952515; Sun, 10 Dec 2023 12:25:52 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:51 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 2/6] kmod: Fix build with latest musl Date: Sun, 10 Dec 2023 12:25:45 -0800 Message-ID: <20231210202549.155550-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231210202549.155550-1-raj.khem@gmail.com> References: <20231210202549.155550-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192120 implement glibc compatible basename() funciton for portability Signed-off-by: Khem Raj --- ...able-implementation-for-basename-API.patch | 136 ++++++++++++++++++ meta/recipes-kernel/kmod/kmod_31.bb | 1 + 2 files changed, 137 insertions(+) create mode 100644 meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch diff --git a/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch b/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch new file mode 100644 index 00000000000..6a7f9ded4fa --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch @@ -0,0 +1,136 @@ +From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 9 Dec 2023 17:35:59 -0800 +Subject: [PATCH] Use portable implementation for basename API + +musl has removed the non-prototype declaration of basename from +string.h [1] which now results in build errors with clang-17+ compiler + +Implement GNU basename behavior using strchr which is portable across libcs + +Fixes +../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +71 | "Commands:\n", basename(argv[0])); +| ^ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://github.com/kmod-project/kmod/pull/32] + +Suggested-by: Rich Felker + +Signed-off-by: Khem Raj +--- + libkmod/libkmod-config.c | 2 +- + shared/util.c | 4 ++-- + shared/util.h | 7 +++++++ + testsuite/testsuite.c | 2 +- + tools/depmod.c | 2 +- + tools/kmod.c | 4 ++-- + 6 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c +index e83621b..8aa555a 100644 +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx, + bool is_single = false; + + if (name == NULL) { +- name = basename(path); ++ name = gnu_basename(path); + is_single = true; + } + +diff --git a/shared/util.c b/shared/util.c +index e2bab83..0e16670 100644 +--- a/shared/util.c ++++ b/shared/util.c +@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t * + + char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len) + { +- char *modname; ++ const char *modname; + +- modname = basename(path); ++ modname = gnu_basename(path); + if (modname == NULL || modname[0] == '\0') + return NULL; + +diff --git a/shared/util.h b/shared/util.h +index c4a3916..073dc5a 100644 +--- a/shared/util.h ++++ b/shared/util.h +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -76,6 +77,12 @@ do { \ + __p->__v = (val); \ + } while(0) + ++static _always_inline_ const char *gnu_basename(const char *s) ++{ ++ const char *p = strrchr(s, '/'); ++ return p ? p+1 : s; ++} ++ + static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u) + { + return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1)); +diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c +index 318343a..aafc987 100644 +--- a/testsuite/testsuite.c ++++ b/testsuite/testsuite.c +@@ -70,7 +70,7 @@ static void help(void) + + printf("Usage:\n" + "\t%s [options] \n" +- "Options:\n", basename(progname)); ++ "Options:\n", gnu_basename(progname)); + + for (itr = options, itr_short = options_short; + itr->name != NULL; itr++, itr_short++) +diff --git a/tools/depmod.c b/tools/depmod.c +index 43fc354..cfb15b1 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files + if (name != NULL) + namelen = strlen(name); + else { +- name = basename(dir); ++ name = gnu_basename(dir); + namelen = strlen(name); + dirlen -= namelen + 1; + } +diff --git a/tools/kmod.c b/tools/kmod.c +index 55689c0..df91e5c 100644 +--- a/tools/kmod.c ++++ b/tools/kmod.c +@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[]) + "Options:\n" + "\t-V, --version show version\n" + "\t-h, --help show this help\n\n" +- "Commands:\n", basename(argv[0])); ++ "Commands:\n", gnu_basename(argv[0])); + + for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) { + if (kmod_cmds[i]->help != NULL) { +@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[]) + const char *cmd; + size_t i; + +- cmd = basename(argv[0]); ++ cmd = gnu_basename(argv[0]); + + for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) { + if (streq(kmod_compat_cmds[i]->name, cmd)) +-- +2.43.0 + diff --git a/meta/recipes-kernel/kmod/kmod_31.bb b/meta/recipes-kernel/kmod/kmod_31.bb index 934a678a062..c11ce456f21 100644 --- a/meta/recipes-kernel/kmod/kmod_31.bb +++ b/meta/recipes-kernel/kmod/kmod_31.bb @@ -20,6 +20,7 @@ SRCREV = "aff617ea871d0568cc491bd116c0be1e857463bb" SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master;protocol=https \ file://depmod-search.conf \ file://avoid_parallel_tests.patch \ + file://0001-Use-portable-implementation-for-basename-API.patch \ " S = "${WORKDIR}/git" From patchwork Sun Dec 10 20:25:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36007 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA917C46CA3 for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web10.62457.1702239954415422464 for ; Sun, 10 Dec 2023 12:25:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=igQrtBHE; spf=pass (domain: gmail.com, ip: 209.85.210.175, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6d089bc4e1aso209968b3a.0 for ; Sun, 10 Dec 2023 12:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239953; x=1702844753; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bFe1dTMOxpaX0ZfpZ9LI/wKB0cGLIr7qCKNOGhGPgcQ=; b=igQrtBHEyfkLn3lBD9qoixjYy3FrCAEPlDmvmFqPV7crv0V5wOoMPx9jeKnWy+DvkO ZV1Z//es3+7rxbFMmIMYjFs3zNduZ2sGY19aDNZ4XXKaIGmtmsX6nsY+qzXWzpGrAS8Q vaaItHaqkn+Sm9YO3O3xqtkUq5P9ZkNPt7ONXVHXr6IHrkoo08KawaOXIha3A0uAh8hj e/8C6pYgfs0A+CdIXEUnwI+RzTK1vO6Ru4O07wFNVJOyzw+25G6EYgZ0QQoyc6jQOZjO cMk/v+wJbgYAFMq3sJFtrHi32cNqYOKJc5yiCB5Tyh1RaCApIK0mn88HYB3oegREEPGQ hczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239953; x=1702844753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bFe1dTMOxpaX0ZfpZ9LI/wKB0cGLIr7qCKNOGhGPgcQ=; b=fHkQBSgYDiEmto9U9tAvJHYZPRYuHYKCP2mtm2KA09LUFFyPhgPWRlJ8aqyaSSSZhZ ydeclPpmP2UR9Lj6XllYSqOO+HJdAe+1plBRKVM0LNrDh/33t4eL5xlSNqjvL+H9NL/j zW1f5WpAYYygl4qmYYPdJaTXYwkVmu7P8M/n5p7yNlvad9dVtJAi/9Sm5LN6d9gcuUc/ AqSp0GDy5JuK9SqQf3FNKq13Vf89pfDygtvBCXLTcCoIpoo2R5jtDk2qmd+iJj/TFk0Q f91jeaHxoGqNdh43WpQgg76eirLjJuf696k9jqnJJ6vqS+KEsz77VWz16jVTSlzOj+J7 4ZZw== X-Gm-Message-State: AOJu0YzTGNchJeNULb3JRVzXAlx2mtpwkfksY6kJAxlsXr2+87ywLM2C DBwpSeOQHvPEDtUVWn2dIiY8wQINQ3g= X-Google-Smtp-Source: AGHT+IHLEuFSRJGNQ5aYehoSuHVrF36hZPF0uuaSbJAAMi+Kz50zfNtM00xDY/IPSIRbMdUJfaLF0g== X-Received: by 2002:a05:6a20:560c:b0:190:2d3d:b08a with SMTP id ir12-20020a056a20560c00b001902d3db08amr3147324pzc.18.1702239953421; Sun, 10 Dec 2023 12:25:53 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 3/6] elfutils: Use own basename API implementation Date: Sun, 10 Dec 2023 12:25:46 -0800 Message-ID: <20231210202549.155550-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231210202549.155550-1-raj.khem@gmail.com> References: <20231210202549.155550-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192121 This helps in building it for musl libc after this change [1] [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 Signed-off-by: Khem Raj --- .../elfutils/elfutils_0.189.bb | 1 + ...001-Add-helper-function-for-basename.patch | 404 ++++++++++++++++++ 2 files changed, 405 insertions(+) create mode 100644 meta/recipes-devtools/elfutils/files/0001-Add-helper-function-for-basename.patch diff --git a/meta/recipes-devtools/elfutils/elfutils_0.189.bb b/meta/recipes-devtools/elfutils/elfutils_0.189.bb index d69828131e4..220f747cb95 100644 --- a/meta/recipes-devtools/elfutils/elfutils_0.189.bb +++ b/meta/recipes-devtools/elfutils/elfutils_0.189.bb @@ -21,6 +21,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ file://0001-skip-the-test-when-gcc-not-deployed.patch \ file://ptest.patch \ file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ + file://0001-Add-helper-function-for-basename.patch \ " SRC_URI:append:libc-musl = " \ file://0003-musl-utils.patch \ diff --git a/meta/recipes-devtools/elfutils/files/0001-Add-helper-function-for-basename.patch b/meta/recipes-devtools/elfutils/files/0001-Add-helper-function-for-basename.patch new file mode 100644 index 00000000000..3e6033fd753 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0001-Add-helper-function-for-basename.patch @@ -0,0 +1,404 @@ +From 666372a5d8d5a23203c70d583904097c9e49c5a0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 9 Dec 2023 18:23:03 -0800 +Subject: [PATCH] Add helper function for basename + +musl does not provide GNU version of basename and lately have removed +the definiton from string.h [1] which exposes this problem. It can be +made to work by providing a local implementation of basename which +implements the GNU basename behavior, this makes it work across C +libraries which have POSIX implementation only. + +Upstream-Status: Submitted [https://sourceware.org/pipermail/elfutils-devel/2023q4/006727.html] +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 +Signed-off-by: Khem Raj +--- + lib/Makefile.am | 2 +- + lib/libeu.h | 1 + + lib/{libeu.h => xbasename.c} | 31 ++++++++++------------------ + libdw/dwarf_getsrc_file.c | 3 ++- + libdwfl/core-file.c | 3 ++- + libdwfl/dwfl_module_getsrc_file.c | 3 ++- + libdwfl/dwfl_segment_report_module.c | 3 ++- + libdwfl/find-debuginfo.c | 7 ++++--- + libdwfl/link_map.c | 3 ++- + libdwfl/linux-kernel-modules.c | 3 ++- + src/addr2line.c | 5 +++-- + src/ar.c | 5 +++-- + src/nm.c | 4 ++-- + src/stack.c | 3 ++- + src/strip.c | 2 +- + tests/show-die-info.c | 2 +- + tests/varlocs.c | 2 +- + 17 files changed, 42 insertions(+), 40 deletions(-) + copy lib/{libeu.h => xbasename.c} (57%) + +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -33,7 +33,7 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf + + noinst_LIBRARIES = libeu.a + +-libeu_a_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \ ++libeu_a_SOURCES = xasprintf.c xbasename.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \ + crc32.c crc32_file.c \ + color.c error.c printversion.c + +--- a/lib/libeu.h ++++ b/lib/libeu.h +@@ -42,6 +42,7 @@ extern char *xstrndup (const char *, siz + extern char *xasprintf(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))) __attribute__ ((__malloc__)); + ++extern const char *xbasename(const char *s); + extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len); + extern int crc32_file (int fd, uint32_t *resp); + +--- /dev/null ++++ b/lib/xbasename.c +@@ -0,0 +1,39 @@ ++/* Convenience function for basename extraction. ++ Copyright (C) 2023 Khem Raj. ++ This file is part of elfutils. ++ ++ This file is free software; you can redistribute it and/or modify ++ it under the terms of either ++ ++ * the GNU Lesser General Public License as published by the Free ++ Software Foundation; either version 3 of the License, or (at ++ your option) any later version ++ ++ or ++ ++ * the GNU General Public License as published by the Free ++ Software Foundation; either version 2 of the License, or (at ++ your option) any later version ++ ++ or both in parallel, as here. ++ ++ elfutils is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ General Public License for more details. ++ ++ You should have received copies of the GNU General Public License and ++ the GNU Lesser General Public License along with this program. If ++ not, see . */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++ ++const char * ++xbasename(const char *s) { ++ const char *p = strrchr(s, '/'); ++ return p ? p+1 : s; ++} +--- a/libdw/dwarf_getsrc_file.c ++++ b/libdw/dwarf_getsrc_file.c +@@ -37,6 +37,7 @@ + #include + + #include "libdwP.h" ++#include "libeu.h" + + + int +@@ -98,7 +99,7 @@ dwarf_getsrc_file (Dwarf *dbg, const cha + /* Match the name with the name the user provided. */ + const char *fname2 = line->files->info[lastfile].name; + if (is_basename) +- lastmatch = strcmp (basename (fname2), fname) == 0; ++ lastmatch = strcmp (xbasename (fname2), fname) == 0; + else + lastmatch = strcmp (fname2, fname) == 0; + } +--- a/libdwfl/core-file.c ++++ b/libdwfl/core-file.c +@@ -29,6 +29,7 @@ + + #include + #include "libelfP.h" /* For NOTE_ALIGN. */ ++#include "libeu.h" + #include "libdwflP.h" + #include + +@@ -595,7 +596,7 @@ dwfl_core_file_report (Dwfl *dwfl, Elf * + if (! __libdwfl_dynamic_vaddr_get (module->elf, &file_dynamic_vaddr)) + continue; + Dwfl_Module *mod; +- mod = __libdwfl_report_elf (dwfl, basename (module->name), module->name, ++ mod = __libdwfl_report_elf (dwfl, xbasename (module->name), module->name, + module->fd, module->elf, + module->l_ld - file_dynamic_vaddr, + true, true); +--- a/libdwfl/dwfl_module_getsrc_file.c ++++ b/libdwfl/dwfl_module_getsrc_file.c +@@ -31,6 +31,7 @@ + #endif + + #include "libdwflP.h" ++#include "libeu.h" + #include "libdwP.h" + + +@@ -103,7 +104,7 @@ dwfl_module_getsrc_file (Dwfl_Module *mo + { + /* Match the name with the name the user provided. */ + lastfile = file; +- lastmatch = !strcmp (is_basename ? basename (file) : file, ++ lastmatch = !strcmp (is_basename ? xbasename (file) : file, + fname); + } + } +--- a/libdwfl/dwfl_segment_report_module.c ++++ b/libdwfl/dwfl_segment_report_module.c +@@ -29,6 +29,7 @@ + + #include + #include "libelfP.h" /* For NOTE_ALIGN4 and NOTE_ALIGN8. */ ++#include "libeu.h" + #include "libdwflP.h" + #include "common.h" + +@@ -718,7 +719,7 @@ dwfl_segment_report_module (Dwfl *dwfl, + bias += fixup; + if (module->name[0] != '\0') + { +- name = basename (module->name); ++ name = xbasename (module->name); + name_is_final = true; + } + break; +--- a/libdwfl/find-debuginfo.c ++++ b/libdwfl/find-debuginfo.c +@@ -31,6 +31,7 @@ + #endif + + #include "libdwflP.h" ++#include "libeu.h" + #include + #include + #include +@@ -164,7 +165,7 @@ find_debuginfo_in_path (Dwfl_Module *mod + { + bool cancheck = debuglink_crc != (GElf_Word) 0; + +- const char *file_basename = file_name == NULL ? NULL : basename (file_name); ++ const char *file_basename = file_name == NULL ? NULL : xbasename (file_name); + char *localname = NULL; + + /* We invent a debuglink .debug name if NULL, but then want to try the +@@ -278,7 +279,7 @@ find_debuginfo_in_path (Dwfl_Module *mod + else + { + subdir = NULL; +- file = basename (debuglink_file); ++ file = xbasename (debuglink_file); + } + try_file_basename = debuglink_null; + break; +@@ -306,7 +307,7 @@ find_debuginfo_in_path (Dwfl_Module *mod + if (mod->dw != NULL && (p[0] == '\0' || p[0] == '/')) + { + fd = try_open (&main_stat, dir, ".dwz", +- basename (file), &fname); ++ xbasename (file), &fname); + if (fd < 0) + { + if (errno != ENOENT && errno != ENOTDIR) +--- a/libdwfl/link_map.c ++++ b/libdwfl/link_map.c +@@ -29,6 +29,7 @@ + + #include + #include "libdwflP.h" ++#include "libeu.h" + #include "memory-access.h" + #include "system.h" + +@@ -469,7 +470,7 @@ report_r_debug (uint_fast8_t elfclass, u + if (r_debug_info_module == NULL) + { + // XXX hook for sysroot +- mod = __libdwfl_report_elf (dwfl, basename (name), ++ mod = __libdwfl_report_elf (dwfl, xbasename (name), + name, fd, elf, base, + true, true); + if (mod != NULL) +--- a/libdwfl/linux-kernel-modules.c ++++ b/libdwfl/linux-kernel-modules.c +@@ -40,6 +40,7 @@ + #include + + #include "libelfP.h" ++#include "libeu.h" + #include "libdwflP.h" + #include + #include +@@ -116,7 +117,7 @@ try_kernel_name (Dwfl *dwfl, char **fnam + /* Try the file's unadorned basename as DEBUGLINK_FILE, + to look only for "vmlinux" files. */ + fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0, +- *fname, basename (*fname), ++ *fname, xbasename (*fname), + 0, &fakemod.debug.name); + + if (fakemod.debug.name != NULL) +--- a/src/addr2line.c ++++ b/src/addr2line.c +@@ -38,6 +38,7 @@ + + #include + #include ++#include "libeu.h" + + + /* Name and version of program. */ +@@ -385,7 +386,7 @@ print_dwarf_function (Dwfl_Module *mod, + if (file == NULL) + file = "???"; + else if (only_basenames) +- file = basename (file); ++ file = xbasename (file); + else if (use_comp_dir && file[0] != '/') + { + const char *const *dirs; +@@ -568,7 +569,7 @@ print_src (const char *src, int lineno, + const char *comp_dir_sep = ""; + + if (only_basenames) +- src = basename (src); ++ src = xbasename (src); + else if (use_comp_dir && src[0] != '/') + { + Dwarf_Attribute attr; +--- a/src/ar.c ++++ b/src/ar.c +@@ -42,6 +42,7 @@ + #include + + #include "arlib.h" ++#include "libeu.h" + + + /* Name and version of program. */ +@@ -1133,7 +1134,7 @@ do_oper_insert (int oper, const char *ar + for (int cnt = 0; cnt < argc; ++cnt) + { + ENTRY entry; +- entry.key = full_path ? argv[cnt] : basename (argv[cnt]); ++ entry.key = full_path ? argv[cnt] : (char*)xbasename (argv[cnt]); + entry.data = &argv[cnt]; + if (hsearch (entry, ENTER) == NULL) + error_exit (errno, _("cannot insert into hash table")); +@@ -1242,7 +1243,7 @@ do_oper_insert (int oper, const char *ar + /* Open all the new files, get their sizes and add all symbols. */ + for (int cnt = 0; cnt < argc; ++cnt) + { +- const char *bname = basename (argv[cnt]); ++ const char *bname = xbasename (argv[cnt]); + size_t bnamelen = strlen (bname); + if (found[cnt] == NULL) + { +--- a/src/nm.c ++++ b/src/nm.c +@@ -1417,7 +1417,7 @@ show_symbols (int fd, Ebl *ebl, GElf_Ehd + int lineno; + (void) dwarf_lineno (line, &lineno); + const char *file = dwarf_linesrc (line, NULL, NULL); +- file = (file != NULL) ? basename (file) : "???"; ++ file = (file != NULL) ? xbasename (file) : "???"; + int n; + n = obstack_printf (&whereob, "%s:%d%c", file, + lineno, '\0'); +@@ -1448,7 +1448,7 @@ show_symbols (int fd, Ebl *ebl, GElf_Ehd + { + /* We found the line. */ + int n = obstack_printf (&whereob, "%s:%" PRIu64 "%c", +- basename ((*found)->file), ++ xbasename ((*found)->file), + (*found)->lineno, + '\0'); + sym_mem[nentries_used].where = obstack_finish (&whereob); +--- a/src/stack.c ++++ b/src/stack.c +@@ -31,6 +31,7 @@ + #include + #include + ++#include "libeu.h" + /* Name and version of program. */ + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; + +@@ -152,7 +153,7 @@ module_callback (Dwfl_Module *mod, void + + int width = get_addr_width (mod); + printf ("0x%0*" PRIx64 "-0x%0*" PRIx64 " %s\n", +- width, start, width, end, basename (name)); ++ width, start, width, end, xbasename (name)); + + const unsigned char *id; + GElf_Addr id_vaddr; +--- a/src/strip.c ++++ b/src/strip.c +@@ -1807,7 +1807,7 @@ handle_elf (int fd, Elf *elf, const char + elf_errmsg (-1)); + } + +- char *debug_basename = basename (debug_fname_embed ?: debug_fname); ++ const char *debug_basename = xbasename (debug_fname_embed ?: debug_fname); + off_t crc_offset = strlen (debug_basename) + 1; + /* Align to 4 byte boundary */ + crc_offset = ((crc_offset - 1) & ~3) + 4; +--- a/tests/show-die-info.c ++++ b/tests/show-die-info.c +@@ -26,6 +26,7 @@ + #include + #include + ++#include "../lib/libeu.h" + #include "../libdw/known-dwarf.h" + + static const char * +@@ -318,7 +319,7 @@ main (int argc, char *argv[]) + int fd = open (argv[cnt], O_RDONLY); + Dwarf *dbg; + +- printf ("file: %s\n", basename (argv[cnt])); ++ printf ("file: %s\n", xbasename (argv[cnt])); + + dbg = dwarf_begin (fd, DWARF_C_READ); + if (dbg == NULL) +--- a/tests/varlocs.c ++++ b/tests/varlocs.c +@@ -33,6 +33,7 @@ + + #include "system.h" + #include "../libdw/known-dwarf.h" ++#include "../lib/libeu.h" + + // The Dwarf, Dwarf_CFIs and address bias of + // cfi table to adjust DWARF addresses against. +@@ -1120,7 +1121,7 @@ main (int argc, char *argv[]) + + const char *name = (modname[0] != '\0' + ? modname +- : basename (mainfile)); ++ : xbasename (mainfile)); + printf ("module '%s'\n", name); + print_die (&cudie, "CU", 0); + +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -692,7 +692,7 @@ update1_LDADD = $(libelf) + update2_LDADD = $(libelf) + update3_LDADD = $(libdw) $(libelf) + update4_LDADD = $(libdw) $(libelf) +-show_die_info_LDADD = $(libdw) $(libelf) ++show_die_info_LDADD = $(libeu) $(libdw) $(libelf) + get_pubnames_LDADD = $(libdw) $(libelf) + show_abbrev_LDADD = $(libdw) $(libelf) + get_lines_LDADD = $(libdw) $(libelf) From patchwork Sun Dec 10 20:25:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36005 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C441FC10DCE for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) by mx.groups.io with SMTP id smtpd.web10.62458.1702239955719920563 for ; Sun, 10 Dec 2023 12:25:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=joQhErtB; spf=pass (domain: gmail.com, ip: 209.85.161.41, mailfrom: raj.khem@gmail.com) Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-590a2a963baso1043010eaf.2 for ; Sun, 10 Dec 2023 12:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239954; x=1702844754; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S+Uz/3KFVeX3oRC1CajzwZ+q91STUa8qMEVE1M5Lzcw=; b=joQhErtBP5DVQ6CrgJs5uWpJltJGARqUako0IgTCV35JjA2K+7YjVqRWRQsqsKwJon htt7VQ5l6yw0BOjxlctJuc1uMChxxu4e+c65LzykfsgJcoIVrl4XxfvKI9AE+YMm5baw mrzRj7SZQOayaw/bFKa9a+Fd69n3ZUzA15NMdzzL3HIRUbHaa6TtZnwe2fio5csAUm5m We4JHo3ttxvutWVIfpfemHRa7vkWacqoAM6yLi/oV36YyDOuRYydWUO7WH44hkcmapdQ tRz2AU5EPabw0A4wphfx6JPyTYhY08B5ppTgsNCicd5HEQK8+zM0Uge6yQuN7uImfWpD T9lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239954; x=1702844754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S+Uz/3KFVeX3oRC1CajzwZ+q91STUa8qMEVE1M5Lzcw=; b=goUbku5cAuSfldH7Cpe9jsklhllAP42zkXS0s27aL/ci+EDwHZQHiUFHVyYQY9JLft 6A0dSHXV1WkUqGJAk6rXdqXxrKqKzT03ZRqeGm/qC4nqOhKBiyoFOx8zgJN/bJbgQ5y5 NNJDiZfXOj+9OBqxCgIYdLHC5lJIQTI1+0QHgNCll5ah6HA3B2iaDIxlhyMQkxrIIbTc 7r7Ii3iPXjQI85yLWsAWMZFmblAs9ybKH4s4vRY708ydiI+oXDGmdE+z5jax5digara1 N+KLwZ3eQwZUts0Wp3dnBgeTID2FkM8afKdAdwfShJn0vPWZhLRMLazodPExrsCftLHX i1Dw== X-Gm-Message-State: AOJu0YzoFtAPjHLlno6zONRGB0e6ccvc9DhY6DtXOvMjHm0yKydcsRPG RZL8fcv9SY21maNiupvVyPTXZlnwN4g= X-Google-Smtp-Source: AGHT+IE932hSHagjfVGp3WuqrIJ95pBq85zDTdsWZX6bCyjo8BNmpduIUFki8Usilh0R7007hzRMbg== X-Received: by 2002:a05:6808:3089:b0:3a9:ba39:6d6e with SMTP id bl9-20020a056808308900b003a9ba396d6emr3735317oib.0.1702239954515; Sun, 10 Dec 2023 12:25:54 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:53 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 4/6] util-linux: Fix build with latest musl Date: Sun, 10 Dec 2023 12:25:47 -0800 Message-ID: <20231210202549.155550-4-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231210202549.155550-1-raj.khem@gmail.com> References: <20231210202549.155550-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192122 Musl has removed basename declaration in string.h which exposes this error. Signed-off-by: Khem Raj --- meta/recipes-core/util-linux/util-linux.inc | 1 + ...ls-include-libgen.h-for-basename-API.patch | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 meta/recipes-core/util-linux/util-linux/0001-login-utils-include-libgen.h-for-basename-API.patch diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 952a680a849..e3bef5acfc5 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc @@ -36,6 +36,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://display_testname_for_subtest.patch \ file://avoid_parallel_tests.patch \ file://0001-lscpu-Use-4K-buffer-size-instead-of-BUFSIZ.patch \ + file://0001-login-utils-include-libgen.h-for-basename-API.patch \ " SRC_URI[sha256sum] = "87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f" diff --git a/meta/recipes-core/util-linux/util-linux/0001-login-utils-include-libgen.h-for-basename-API.patch b/meta/recipes-core/util-linux/util-linux/0001-login-utils-include-libgen.h-for-basename-API.patch new file mode 100644 index 00000000000..2b9897ade12 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/0001-login-utils-include-libgen.h-for-basename-API.patch @@ -0,0 +1,57 @@ +From 6581cf8ac95b99b5a35fea88c52646558d05b5e7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 3 Dec 2023 19:59:46 -0800 +Subject: [PATCH] login-utils: include libgen.h for basename API + +musl has removed the non-prototype declaration of basename from string.h [1] which now results in build errors with clang-17+ compiler + +include libgen.h for using the posix declaration of the funciton. + +Fixes + +../util-linux-2.39.2/login-utils/su-common.c:847:20: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + 847 | shell_basename = basename(shell); + | ^ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://github.com/util-linux/util-linux/pull/2615] +Signed-off-by: Khem Raj +--- + login-utils/su-common.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/login-utils/su-common.c ++++ b/login-utils/su-common.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #ifdef HAVE_SECURITY_PAM_MISC_H + # include +@@ -840,17 +841,20 @@ static void run_shell( + su->simulate_login ? " login" : "", + su->fast_startup ? " fast-start" : "")); + ++ char* tmp = xstrdup(shell); + if (su->simulate_login) { + char *arg0; + char *shell_basename; + +- shell_basename = basename(shell); ++ shell_basename = basename(tmp); + arg0 = xmalloc(strlen(shell_basename) + 2); + arg0[0] = '-'; + strcpy(arg0 + 1, shell_basename); + args[0] = arg0; +- } else +- args[0] = basename(shell); ++ } else { ++ args[0] = basename(tmp); ++ } ++ free(tmp); + + if (su->fast_startup) + args[argno++] = "-f"; From patchwork Sun Dec 10 20:25:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36003 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8539C10F05 for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) by mx.groups.io with SMTP id smtpd.web10.62459.1702239956444653511 for ; Sun, 10 Dec 2023 12:25:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lWAZAe3o; spf=pass (domain: gmail.com, ip: 209.85.167.180, mailfrom: raj.khem@gmail.com) Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3ba00fe4e94so764025b6e.1 for ; Sun, 10 Dec 2023 12:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239955; x=1702844755; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rRuwU74llJjKIV0kLILKg1+5kmC369o23nIKVTgdeZk=; b=lWAZAe3oa8niyCMrGgJlfK0l9/x/bpOEM9Pt4yfDAiNeB+8fyUooaU3Tu4joly03aM 12d0/GzAVe8ot6HKiK1TL1ca4+xmoOZ7SEYVyW5dK1c3EretU/T5kwQOpqdEC4/Rw85D pzeK4O8t9T00x4Vnydy06qfgP3Ns6/eQO5WaT0qiskjoNLb5t5QG4YAT7M9mOxf3o/cX 98KEtXXEdGXEthCSDlOFbNtSVcsoq2MD/zLFwLDqM5BO9IgitpAWp5AC0T4eTXaxkQKg iKm3LUWAiflj1OXE7fNjhfRjvk4Q0rgjbsuFOp/xKjJ8kWDflGhsCaa4i38iyPgg7Kzh qPCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239955; x=1702844755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rRuwU74llJjKIV0kLILKg1+5kmC369o23nIKVTgdeZk=; b=ir2uUW9cfYqWhlvgJH2G66utPzu52Us/m0XxcnBnVj0Bm3xczzrlQZRlCmSP+WtOnO v7MQ18yxsOfpOgFvITPmXQ6IK0edwcXgGO5A1dAJo9a4XCeAR4ZgMWGnjitZdwbdteyb 0TTKjYq3nxzygzpMasAKVbZ/a2wfIqXDIiTF+uREUs8QkMDzjuFJ0H8AA/n3rwxOU3ua /PteMsdMMa94TYfNrZXMHwmnWFBZZqRHkZm8kszEjujUjpjuiTeVIVolT6B3qQ1NRIXQ 2YCUG/YqbJ+tvDJKwt8Sx+ti+e3mhPwcz5IPLCK2awG8fBD7raAraRnGYvEG0VWgWKfS enzg== X-Gm-Message-State: AOJu0YyshlCUgGncUSxqq/5ztRm8Fbm7FOAvNcTIffsso8AlsPncbtFC cXpNNzG0lui5duyfoj3SJ3NWaG6xJyw= X-Google-Smtp-Source: AGHT+IEufExbUT89AjohcMqfkHxS9jSjyGern2ofNw/8/njNjZ6JGP001jP47CbQQ/n3Y7DmGQg2fw== X-Received: by 2002:a05:6808:158d:b0:3b9:bccd:1b08 with SMTP id t13-20020a056808158d00b003b9bccd1b08mr4402567oiw.32.1702239955485; Sun, 10 Dec 2023 12:25:55 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:54 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 5/6] sysvinit: Include libgen.h for basename API Date: Sun, 10 Dec 2023 12:25:48 -0800 Message-ID: <20231210202549.155550-5-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231210202549.155550-1-raj.khem@gmail.com> References: <20231210202549.155550-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192123 This fixes build with latest musl which drops basename declaration API from string.h Signed-off-by: Khem Raj --- ...wn-include-libgen.h-for-basename-API.patch | 38 +++++++++++++++++++ meta/recipes-core/sysvinit/sysvinit_3.04.bb | 1 + 2 files changed, 39 insertions(+) create mode 100644 meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch diff --git a/meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch b/meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch new file mode 100644 index 00000000000..5e4053bad1d --- /dev/null +++ b/meta/recipes-core/sysvinit/sysvinit/0001-hddown-include-libgen.h-for-basename-API.patch @@ -0,0 +1,38 @@ +From a07c1d94e79840c59563741b45e690e77d4f3dfa Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 3 Dec 2023 20:09:30 -0800 +Subject: [PATCH] hddown: include libgen.h for basename API + +musl has removed the non-prototype declaration of basename from string.h [1] which now results in build errors with clang-17+ compiler + +include libgen.h for using the posix declaration of the funciton. + +Fixes + +hddown.c:135:8: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] + 135 | ptr = basename(lnk); + | ^ ~~~~~~~~~~~~~ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://github.com/slicer69/sysvinit/pull/21] +Signed-off-by: Khem Raj +--- + src/hddown.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/hddown.c b/src/hddown.c +index 7a2cf28..3b31bc0 100644 +--- a/src/hddown.c ++++ b/src/hddown.c +@@ -24,6 +24,7 @@ char *v_hddown = "@(#)hddown.c 1.02 22-Apr-2003 miquels@cistron.nl"; + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif ++#include + #include + #include + #include +-- +2.43.0 + diff --git a/meta/recipes-core/sysvinit/sysvinit_3.04.bb b/meta/recipes-core/sysvinit/sysvinit_3.04.bb index 76b187c1961..6a612468f35 100644 --- a/meta/recipes-core/sysvinit/sysvinit_3.04.bb +++ b/meta/recipes-core/sysvinit/sysvinit_3.04.bb @@ -21,6 +21,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.xz \ file://rcS \ file://bootlogd.init \ file://01_bootlogd \ + file://0001-hddown-include-libgen.h-for-basename-API.patch \ " SRC_URI[sha256sum] = "2a621fe6e4528bc91308b74867ddaaebbdf7753f02395c0c5bae817bd2b7e3a5" From patchwork Sun Dec 10 20:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 36004 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B35E1C4167B for ; Sun, 10 Dec 2023 20:25:59 +0000 (UTC) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web10.62461.1702239957155269645 for ; Sun, 10 Dec 2023 12:25:57 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MinUUKDP; spf=pass (domain: gmail.com, ip: 209.85.210.170, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6ceb93fb381so2442481b3a.0 for ; Sun, 10 Dec 2023 12:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702239956; x=1702844756; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=biIyLaBWX2odm7iShPtv1+uqjxPEXU/Ruo6Z+iyDpJU=; b=MinUUKDPfChTDVeQaTXGPb4GgJ59gjaqgxDjhQA8ChRxqVHA56iA3qkffh57o8cmWp JhdU9Ges9S1MPsBHpMbFinK6EO3tz2nk/YrK3277+DtyhJXNWGxYv3waG0eshy2uM7FC BshjzKlsVmwoHdLrJKf5D6Kn/1qT9kW81J9z4+UXPY9l2xDIzB7vT7wyUasZcEM8GFEE AP4TfsV3r/+3QhZFSIWPwjbbqJq5EV0SAbn3DvAWF5CBr9hChtPPwx6BFZhPetYc4cfR gHJ9CwQG36Gex1rmLwCrOaLSyoxD8PEUd3sfcAYfoYsVweySkAL8bAsKJO+7xLlOExqA /SHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702239956; x=1702844756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=biIyLaBWX2odm7iShPtv1+uqjxPEXU/Ruo6Z+iyDpJU=; b=X2jI6RykUSuUEA11Xc7hYVEWbOwNMDOqQn5kWxDDQojV1gCztx3vAHmBEdgd4nzias eXWiFvrFfVSHz6+nr7Rp/atGn0CzIkJ3C11BVpmzhRCQ8680crA+T0zeJivAmTtbAqrg lQ5cTSBHiEFes8zhjYYWAz3O/X2tJT2raa9B9u5xEtCOrry4ga5S7KwriAwsMmG49Zb+ 1eyFNAR+PWhqmInwEd4I8Hh6K79gn0XyXn9DT9bQ7AZ2+REJRfrsYuBtxtK6h5cXjIiK 6f4yPdgG8qgN3AmHkztBhWJfw+HBZ+b5STHH4usxIucFPeIHYgGC2DddtcZ6xl3++6op oE1w== X-Gm-Message-State: AOJu0Yy38ykfNbdJ6NTcyE2ukyP7E3dguJGa5FN5yooHcMDoLvmyfxm1 bmGKX4HV5nii7CXOYVlmxqly3sGIth0= X-Google-Smtp-Source: AGHT+IER4yrgujxE/p4omZzXPxeHffYLdz0TJtHUS9BMmILYrdb3gb+ku7npkWSDNUZ4drCfvGxa7w== X-Received: by 2002:a05:6a00:b51:b0:6cb:cd66:2102 with SMTP id p17-20020a056a000b5100b006cbcd662102mr4174476pfo.4.1702239956258; Sun, 10 Dec 2023 12:25:56 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9100:3d00::76f0]) by smtp.gmail.com with ESMTPSA id y24-20020aa78558000000b006cee23e7677sm4246487pfn.210.2023.12.10.12.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 12:25:55 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH 6/6] attr: Fix build with latest musl Date: Sun, 10 Dec 2023 12:25:49 -0800 Message-ID: <20231210202549.155550-6-raj.khem@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231210202549.155550-1-raj.khem@gmail.com> References: <20231210202549.155550-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 10 Dec 2023 20:25:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192124 Include libgen.h to get basename() signature Signed-off-by: Khem Raj --- meta/recipes-support/attr/attr.inc | 1 + ...ibgen.h-for-posix-version-of-basenam.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch diff --git a/meta/recipes-support/attr/attr.inc b/meta/recipes-support/attr/attr.inc index e8835398afa..75d616893a5 100644 --- a/meta/recipes-support/attr/attr.inc +++ b/meta/recipes-support/attr/attr.inc @@ -16,6 +16,7 @@ LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \ SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.tar.gz \ file://run-ptest \ + file://0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch \ " inherit ptest update-alternatives autotools gettext diff --git a/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch b/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch new file mode 100644 index 00000000000..1e2bea5067e --- /dev/null +++ b/meta/recipes-support/attr/attr/0001-attr.c-Include-libgen.h-for-posix-version-of-basenam.patch @@ -0,0 +1,35 @@ +From 6d9e827bcacf387bb3cfae64bd4fe520168ccad4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 3 Dec 2023 19:29:27 -0800 +Subject: [PATCH] attr.c: Include libgen.h for posix version of basename API + +Musl has removed the definition from string.h [1] which results in +compile failures with clang + +| ../attr-2.5.1/tools/attr.c:69:13: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +| 69 | progname = basename(argv[0]); +| | ^ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://savannah.nongnu.org/bugs/index.php?64972] +Signed-off-by: Khem Raj +--- + tools/attr.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/attr.c b/tools/attr.c +index 312aef1..90dab83 100644 +--- a/tools/attr.c ++++ b/tools/attr.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + +-- +2.43.0 +