View Issue Details

IDProjectCategoryView StatusLast Update
0009950ardourbugspublic2025-06-19 21:15
Reporterccaudle Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformGNUOSLinuxOS Version(any)
Product Version8.12 
Summary0009950: waf test for ioprio_set returns false negative
Descriptionwaf configure reports that syscall ioprio_set is not available, but compiling the test program as a stand alone file without command line flags for optimization, ardour include path, etc. succeeds.

Steps To ReproduceRun waf configure on a linux machine with recent kernel and gcc 15.x
Additional InformationOutput in config.log:

Checking for 'ioprio_set' syscall support
==>
#include <unistd.h>
#include <sys/syscall.h>
int main () { syscall(SYS_ioprio_set, 1, 0, 8192); return 0; }
<==
[1/1] Compiling ^[[32mbuild/.conf_check_1acb98d0647921b914780876d44f4ca7/test.c^[[0m

['/usr/lib64/ccache/gcc', '-I/home/chris/Src/Ardour/ardour', '-DHAVE_RF64_RIFF', '-DCOMPILER_INT128_SUPPORT', '-DWAF_BUILD', '-g', '-std=c99', '-pedantic', '-Wshadow', '-Wall', '-Wcast-alig\
n', '-Wextra', '-Wwrite-strings', '-Wunsafe-loop-optimizations', '-Wlogical-op', '-fshow-column', '-DG_ENABLE_DEBUG', '-DARCH_X86', '-mmmx', '-msse', '-mfpmath=sse', '-DUSE_XMMINTRIN', '-DB\
UILD_SSE_OPTIMIZATIONS', '-DLXVST_64BIT', '-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align', '-Wno-unused-parameter', '-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE', '-D_LARGEFI\
LE64_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DPROGRAM_NAME="Ardour"', '-DPROGRAM_VERSION="9"', '-Wstrict-prototypes', '-Wmissing-prototypes', '-D_POSIX_C_SOURCE=200809L', '-I/home/chris/Src/Ar\
dour/ardour/build/.conf_check_1acb98d0647921b914780876d44f4ca7/testbuild', '-DINTERNAL_SHARED_LIBS=1', '-DHAVE_ALSA=1', '-DHAVE_GLIB=1', '-DHAVE_GTHREAD=1', '-DHAVE_GLIBMM=1', '-DHAVE_SNDFI\
LE=1', '-DHAVE_GIOMM=1', '-DHAVE_CURL=1', '-DHAVE_ARCHIVE=1', '-DHAVE_LO=1', '-DHAVE_TAGLIB=1', '-DHAVE_VAMPSDK=1', '-DHAVE_VAMPHOSTSDK=1', '-DHAVE_RUBBERBAND=1', '-DHAVE_USB=1', '-DHAVE_RU\
BBERBAND_3_0_0=1', '-DYTK=1', '-DHAVE_SUIL=1', '-DEXPORT_VISIBILITY_HIDDEN=0', '-DPHONE_HOME=1', '-DENABLE_NLS=1', '-DLXVST_SUPPORT=1', '-DVST3_SUPPORT=1', '-DUSE_FUTEX_SEMAPHORE=1', '-DFPU\
_AVX512F_SUPPORT=1', '-DFPU_AVX_FMA_SUPPORT=1', '-DCONFIG_ARCH="x86_64"', '-DHAVE_TOOLS_SANITY_CHECK=1', '-DHAVE_FFTW3F=1', '-DHAVE_UDEV=1', '-DHAVE_HIDAPI=1', '-DHAVE_AUBIO=1', '-DHAVE_AUB\
IO4=1', '-DHAVE_GOBJECT=1', '-DHAVE_GIO=1', '-DHAVE_LIBPNG=1', '-DHAVE_PANGO=1', '-DHAVE_CAIRO=1', '-DHAVE_PANGOCAIRO=1', '-DHAVE_GIO_UNIX=1', '-DHAVE_RANDR=1', '-DHAVE_RANDR15=1', '-DHAVE_\
XFREE_XINERAMA=1', '-DHAVE_XINPUT2=1', '-DHAVE_GMODULE=1', '-DHAVE_X11=1', '-DHAVE_XEXT=1', '-DHAVE_SIGCPP=1', '-DHAVE_CAIROMM=1', '-DHAVE_PANGOMM=1', '-DHAVE_LV2_1_16_0=1', '-DHAVE_XML=1',\
 '-DHAVE_EXECINFO=1', '-DHAVE_POSIX_MEMALIGN=1', '-DHAVE_GETMNTENT=1', '-DHAVE_LOCALTIME_R=1', '-DHAVE_CPPUNIT=1', '-DHAVE_CONTROL_PROTOCOL=1', '-DHAVE_MIDI_SURFACE=1', '-DHAVE_WEBSOCKETS=1\
', '-DHAVE_JACK=1', '-DHAVE_JACK_METADATA=1', '-DHAVE_LRDF=1', '-DHAVE_SAMPLERATE=1', '-DHAVE_LV2=1', '-DHAVE_LV2_1_10_0=1', '-DHAVE_LV2_1_17_2=1', '-DHAVE_LV2_1_18_6=1', '-DHAVE_SERD=1', '\
-DHAVE_SORD=1', '-DHAVE_SRATOM=1', '-DHAVE_LILV=1', '-DLV2_SUPPORT=1', '-DUSE_TLSF=1', '-DLV2_EXTENDED=1', '-DHAVE_OGG=1', '-DHAVE_FLAC=1', '-DHAVE_FFTW35F=1', '-DUSE_RUBBERBAND=1', '-DCURR\
ENT_SESSION_FILE_VERSION=7003', '-DHAVE_SYS_VFS_H=1', '-DHAVE_SYS_STATVFS_H=1', '-DHAVE_UNISTD=1', '../test.c', '-c', '-o/home/chris/Src/Ardour/ardour/build/.conf_check_1acb98d0647921b91478\
0876d44f4ca7/testbuild/test.c.1.o']
err: ../test.c:3:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
    3 | int main () { syscall(SYS_ioprio_set, 1, 0, 8192); return 0; }
      | ^~~~
../test.c: In function ‘main’:
../test.c:3:15: error: implicit declaration of function ‘syscall’ [-Wimplicit-function-declaration]
    3 | int main () { syscall(SYS_ioprio_set, 1, 0, 8192); return 0; }
      | ^~~~~~~

from /home/chris/Src/Ardour/ardour/libs/ardour: Test does not build: Traceback (most recent call last):
  File "/home/chris/Src/Ardour/ardour/.waf3-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Configure.py", line 335, in run_build
    bld.compile()
    ~~~~~~~~~~~^^
  File "/home/chris/Src/Ardour/ardour/.waf3-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Build.py", line 176, in compile
    raise Errors.BuildError(self.producer.error)
waflib.Errors.BuildError: Build failed
 -> task in 'testprog' failed with exit status 1 (run with -v to display more information)

no
from /home/chris/Src/Ardour/ardour/libs/ardour: The configuration failed

I created a file io_prio_test.c with just this contents:
#include <unistd.h>
#include <sys/syscall.h>

int main () { syscall(SYS_ioprio_set, 1, 0, 8192); return 0; }

Compiling that file with no additional options produces no errors:

[chris@chubb ~]$ gcc io_prio_test.c -o ioprio_test
[chris@chubb ~]$ ./ioprio_test
[chris@chubb ~]$ echo $?
0
TagsNo tags attached.

Activities

ccaudle

2025-06-16 21:34

reporter   ~0029336

One of the error messages indicates that syscall does not have an explicit function declaration, but I do not see that error if adding just that flag:
[chris@chubb ~]$ gcc io_prio_test.c -Wimplicit-function-declaration -o ioprio_test
[chris@chubb ~]$

Adding the c99 flag will generate the error:
$ gcc io_prio_test.c -std=c99 -Wimplicit-function-declaration -o ioprio_test
io_prio_test.c: In function ‘main’:
io_prio_test.c:4:15: error: implicit declaration of function ‘syscall’ [-Wimplicit-function-declaration]
    4 | int main () { syscall(SYS_ioprio_set, 1, 0, 8192); return 0; }
      | ^~~~~~~

Maybe someone recognizes quickly why using -std=c99 in the test doesn't find a prototype in the system headers?

ccaudle

2025-06-17 23:20

reporter   ~0029337

This appears to be a duplicate of https://tracker.ardour.org/view.php?id=9831 which was marked as fixed in Nov 2024.

ccaudle

2025-06-19 17:06

reporter   ~0029338

If -std=c99 is used the error occurs, if -std=gnu99 is used the test compiles.

The man page for syscall only indicates <sys/syscall.h> and <unistd.h> as required headers, which the test program does include. I don't see anything obvious in the gnu extensions documentation to indicate that implicit function declaration warnings are expected to be handled differently in gnu99 vs c99, but I may have missed the implications of one of the descriptions.

ccaudle

2025-06-19 21:15

reporter   ~0029339

This seems like a glibc header quirk to me, I have traced back through the chain of include files, and it ends up that the prototype for syscall() is only defined if you do not also specify an ISO language standard be used by gcc.
Anyone know what the best communication channel would be to ask the glibc developers if that is intentional or a bug, and if intentional what is the right way to use syscall() along with -std=c99?

Issue History

Date Modified Username Field Change
2025-06-16 20:59 ccaudle New Issue
2025-06-16 21:34 ccaudle Note Added: 0029336
2025-06-17 23:20 ccaudle Note Added: 0029337
2025-06-19 17:06 ccaudle Note Added: 0029338
2025-06-19 21:15 ccaudle Note Added: 0029339