From: GitHub issues - opened <github@alsa-project.org>
To: alsa-devel@alsa-project.org
Subject: Build Failure Due to Undefined Reference to close_range with alsa-lib 1.2.15
Date: Mon, 8 Dec 2025 22:44:48 +0100 (CET) [thread overview]
Message-ID: <187f5b978c917500-webhooks-bot@alsa-project.org> (raw)
In-Reply-To: <187f5b978b928300-webhooks-bot@alsa-project.org>
alsa-project/alsa-lib issue #485 was opened from darkshram:
### Description
I encountered a build failure while compiling **alsa-lib 1.2.15** due to an undefined reference to `close_range`. My environment uses **glibc 2.30**, which should support this function.
### Error Message
```
ucm/.libs/libucm.a(ucm_exec.o): In function `uc_mgr_exec':
/builddir/build/BUILD/alsa-lib-1.2.15/src/ucm/ucm_exec.c:263: undefined reference to `close_range'
collect2: error: ld returned 1 exit status
```
### Solution
To resolve the issue, I applied the following patch, which effectively reverses [the change that introduced](https://github.com/alsa-project/alsa-lib/pull/459) `close_range`:
```
diff -Naur alsa-lib-1.2.15.orig/src/ucm/ucm_exec.c alsa-lib-1.2.15/src/ucm/ucm_exec.c
--- alsa-lib-1.2.15.orig/src/ucm/ucm_exec.c 2025-12-07 13:41:56.000000000 -0600
+++ alsa-lib-1.2.15/src/ucm/ucm_exec.c 2025-12-08 15:03:30.632324127 -0600
@@ -259,12 +259,8 @@
close(f);
-#if defined(_GNU_SOURCE)
- close_range(3, maxfd, 0);
-#else
for (f = 3; f < maxfd; f++)
close(f);
-#endif
/* install default handlers for the forked process */
signal(SIGINT, SIG_DFL);
```
This workaround restored compatibility and allowed the build to complete successfully.
### Additional Information
Please consider this issue for further review. If close_range is required, clearer compatibility notes might be beneficial. Thank you!
Issue URL : https://github.com/alsa-project/alsa-lib/issues/485
Repository URL: https://github.com/alsa-project/alsa-lib
parent reply other threads:[~2025-12-08 21:45 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <187f5b978b928300-webhooks-bot@alsa-project.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=187f5b978c917500-webhooks-bot@alsa-project.org \
--to=github@alsa-project.org \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.