control: tag -1 + patch

Hi,

On 2025-03-01 21:03, Santiago Vila wrote:
> Package: src:rt-app
> Version: 1.0-1.1
> Severity: serious
> Tags: ftbfs trixie sid
> 
> Dear maintainer:
> 
> During a rebuild of all packages in unstable, your package failed to build:
> 

[...]

> gcc -DHAVE_CONFIG_H -I.  -I./../libdl/ -Wdate-time -D_FORTIFY_SOURCE=2  -g 
> -O2 -Werror=implicit-function-declaration 
> -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong 
> -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c 
> -o rt-app_parse_config.o rt-app_parse_config.c
> In file included from rt-app_types.h:28,
>                  from rt-app_utils.h:29,
>                  from rt-app.c:37:
> ./../libdl/dl_syscalls.h:77:8: error: redefinition of ‘struct sched_attr’
>    77 | struct sched_attr {
>       |        ^~~~~~~~~~
> In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
>                  from /usr/include/sched.h:43,
>                  from /usr/include/pthread.h:22,
>                  from rt-app.c:30:
> /usr/include/linux/sched/types.h:98:8: note: originally defined here
>    98 | struct sched_attr {
>       |        ^~~~~~~~~~
> ./../libdl/dl_syscalls.h:95:5: error: conflicting types for ‘sched_setattr’; 
> have ‘int(pid_t,  const struct sched_attr *, unsigned int)’ {aka ‘int(int,  
> const struct sched_attr *, unsigned int)’}
>    95 | int sched_setattr(pid_t pid,
>       |     ^~~~~~~~~~~~~
> /usr/include/x86_64-linux-gnu/bits/sched.h:148:5: note: previous declaration 
> of ‘sched_setattr’ with type ‘int(pid_t,  struct sched_attr *, unsigned int)’ 
> {aka ‘int(int,  struct sched_attr *, unsigned int)’}
>   148 | int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int 
> flags)
>       |     ^~~~~~~~~~~~~
> ./../libdl/dl_syscalls.h:99:5: error: conflicting types for ‘sched_getattr’; 
> have ‘int(pid_t,  struct sched_attr *, unsigned int,  unsigned int)’ {aka 
> ‘int(int,  struct sched_attr *, unsigned int,  unsigned int)’}
>    99 | int sched_getattr(pid_t pid,
>       |     ^~~~~~~~~~~~~
> /usr/include/x86_64-linux-gnu/bits/sched.h:153:5: note: previous declaration 
> of ‘sched_getattr’ with type ‘int(pid_t,  struct sched_attr *, unsigned int,  
> unsigned int)’ {aka ‘int(int,  struct sched_attr *, unsigned int,  unsigned 
> int)’}
>   153 | int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int 
> size,
>       |     ^~~~~~~~~~~~~
> rt-app.c: In function ‘run_event’:
> rt-app.c:405:25: warning: ‘pthread_yield’ is deprecated: pthread_yield is 
> deprecated, use sched_yield instead [-Wdeprecated-declarations]
>   405 |                         pthread_yield();
>       |                         ^~~~~~~~~~~~~
> In file included from /usr/include/features.h:523,
>                  from 
> /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
>                  from /usr/include/stdlib.h:26,
>                  from rt-app.c:25:
> /usr/include/pthread.h:479:12: note: declared here
>   479 | extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield)
>       |            ^~~~~~~~~~~~~~
> make[3]: *** [Makefile:495: rt-app.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> In file included from rt-app_types.h:28,
>                  from rt-app_utils.h:29,
>                  from rt-app_parse_config.c:30:
> ./../libdl/dl_syscalls.h:77:8: error: redefinition of ‘struct sched_attr’
>    77 | struct sched_attr {
>       |        ^~~~~~~~~~
> In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:63,
>                  from /usr/include/sched.h:43,
>                  from /usr/include/pthread.h:22,
>                  from rt-app_types.h:25:
> /usr/include/linux/sched/types.h:98:8: note: originally defined here
>    98 | struct sched_attr {
>       |        ^~~~~~~~~~
> ./../libdl/dl_syscalls.h:95:5: error: conflicting types for ‘sched_setattr’; 
> have ‘int(pid_t,  const struct sched_attr *, unsigned int)’ {aka ‘int(int,  
> const struct sched_attr *, unsigned int)’}
>    95 | int sched_setattr(pid_t pid,
>       |     ^~~~~~~~~~~~~
> /usr/include/x86_64-linux-gnu/bits/sched.h:148:5: note: previous declaration 
> of ‘sched_setattr’ with type ‘int(pid_t,  struct sched_attr *, unsigned int)’ 
> {aka ‘int(int,  struct sched_attr *, unsigned int)’}
>   148 | int sched_setattr (pid_t tid, struct sched_attr *attr, unsigned int 
> flags)
>       |     ^~~~~~~~~~~~~
> ./../libdl/dl_syscalls.h:99:5: error: conflicting types for ‘sched_getattr’; 
> have ‘int(pid_t,  struct sched_attr *, unsigned int,  unsigned int)’ {aka 
> ‘int(int,  struct sched_attr *, unsigned int,  unsigned int)’}
>    99 | int sched_getattr(pid_t pid,
>       |     ^~~~~~~~~~~~~
> /usr/include/x86_64-linux-gnu/bits/sched.h:153:5: note: previous declaration 
> of ‘sched_getattr’ with type ‘int(pid_t,  struct sched_attr *, unsigned int,  
> unsigned int)’ {aka ‘int(int,  struct sched_attr *, unsigned int,  unsigned 
> int)’}
>   153 | int sched_getattr (pid_t tid, struct sched_attr *attr, unsigned int 
> size,
>       |     ^~~~~~~~~~~~~
> make[3]: *** [Makefile:495: rt-app_parse_config.o] Error 1
> make[3]: Leaving directory '/<<PKGBUILDDIR>>/src'
> make[2]: *** [Makefile:341: all] Error 2
> make[2]: Leaving directory '/<<PKGBUILDDIR>>/src'
> make[1]: *** [Makefile:398: all-recursive] Error 1
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> dh_auto_build: error: make -j2 returned exit code 2
> make: *** [debian/rules:7: binary] Error 25
> dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 
> 2
> --------------------------------------------------------------------------------

This build failure is due to glibc 2.41 which started to define
sched_setattr() and struct sched_attr. I am sorry I missed this when
preparing this version.

I have sent a patch upstream to fix the issue:
https://github.com/scheduler-tools/rt-app/pull/136

As the version in debian is slightly outdated, the patch does not apply
directly, I have attached an adapted version.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                     http://aurel32.net
--- rt-app-1.0.orig/configure.ac
+++ rt-app-1.0/configure.ac
@@ -16,7 +16,7 @@ AC_CHECK_LIB([pthread], [pthread_create]
 AC_CHECK_LIB([m], [round])
 AC_CHECK_LIB([rt], [clock_gettime])
 AC_CHECK_LIB([json-c], [json_object_from_file])
-AC_CHECK_FUNCS(sched_setattr, [], [])
+AC_CHECK_FUNCS(sched_setattr, [have_sched_settattr=yes], [have_sched_settattr=no])
 
 AC_ARG_WITH([deadline],
 	[AS_HELP_STRING([--with-deadline], 
@@ -24,7 +24,7 @@ AC_ARG_WITH([deadline],
 	[AC_DEFINE([DLSCHED], [1], [Define if you have SCHED_DEADLINE support])], 
 	[with_deadline=no])
 
-AM_CONDITIONAL([SET_DLSCHED], [test x$with_deadline != xno && test !HAVE_SCHED_SETATTR])
+AM_CONDITIONAL([SET_DLSCHED], [test x$with_deadline != xno && test x$have_sched_settattr = xno])
 
 AC_ARG_VAR([LOGLVL], [verbosity level, from 0 to 100. 100 is very verbose])
 
--- rt-app-1.0.orig/src/rt-app_args.c
+++ rt-app-1.0/src/rt-app_args.c
@@ -19,6 +19,7 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
--- rt-app-1.0.orig/src/rt-app_parse_config.c
+++ rt-app-1.0/src/rt-app_parse_config.c
@@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fi
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <json-c/json.h>
 
 #include "rt-app_utils.h"
--- rt-app-1.0.orig/src/rt-app_types.h
+++ rt-app-1.0/src/rt-app_types.h
@@ -25,7 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fi
 #include <pthread.h>
 
 #include "config.h"
+
+#ifndef HAVE_SCHED_SETATTR
 #include "dl_syscalls.h"
+#endif
 
 #define RTAPP_POLICY_DESCR_LENGTH 16
 #define RTAPP_RESOURCE_DESCR_LENGTH 16
--- rt-app-1.0.orig/src/rt-app_utils.c
+++ rt-app-1.0/src/rt-app_utils.c
@@ -19,12 +19,15 @@ along with this program; if not, write t
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <math.h>
 #include <stdarg.h>
+#include <unistd.h>
+#include <sys/syscall.h>
 
 #include "rt-app_utils.h"
 

Reply via email to