* Build Failure Due to Undefined Reference to close_range with alsa-lib 1.2.15
[not found] <187f5b978b928300-webhooks-bot@alsa-project.org>
@ 2025-12-08 21:44 ` GitHub issues - opened
0 siblings, 0 replies; only message in thread
From: GitHub issues - opened @ 2025-12-08 21:44 UTC (permalink / raw)
To: alsa-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-08 21:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <187f5b978b928300-webhooks-bot@alsa-project.org>
2025-12-08 21:44 ` Build Failure Due to Undefined Reference to close_range with alsa-lib 1.2.15 GitHub issues - opened
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).