mesonbuild / wrapdb

New wrap requests
https://mesonbuild.com/Adding-new-projects-to-wrapdb.html
MIT License
71 stars 180 forks source link

libuv : libuv_test_cargs #1060

Open markmaker opened 1 year ago

markmaker commented 1 year ago

When I try to compile libuv under Linux, I get

FAILED: subprojects/libuv-v1.44.2/uv_run_tests.p/test_test-thread.c.o 
clang -Isubprojects/libuv-v1.44.2/uv_run_tests.p -Isubprojects/libuv-v1.44.2 -I../subprojects/libuv-v1.44.2 -I../subprojects/libuv-v1.44.2/include -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O0 -g -Werror=implicit-function-declaration -Wno-pointer-sign -Wno-null-pointer-subtraction -Wno-unused-command-line-argument -pthread -Wno-int-conversion -MD -MQ subprojects/libuv-v1.44.2/uv_run_tests.p/test_test-thread.c.o -MF subprojects/libuv-v1.44.2/uv_run_tests.p/test_test-thread.c.o.d -o subprojects/libuv-v1.44.2/uv_run_tests.p/test_test-thread.c.o -c ../subprojects/libuv-v1.44.2/test/test-thread.c

...

../subprojects/libuv-v1.44.2/test/test-thread.c:238:15: error: call to undeclared function 'pthread_getattr_np'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  ASSERT(0 == pthread_getattr_np(pthread_self(), &attr));

As you see, the C args it detected in the meson.build, notably _GNU_SOURCE and _POSIX_C_SOURCE=200112 are not passed to the compiler, causing the error.

Question: should this

https://github.com/mesonbuild/wrapdb/blob/071183c3fbd7cd6b8b90fc0520968e5a27a30057/subprojects/packagefiles/libuv/meson.build#L628

not be changed into

    libuv_test_cargs = [libuv_cargs, cc.get_supported_arguments('-Wno-int-conversion')]

so the detected C args are also added to the test compilation?

It does work, if I change it like that.

_Mark

neheb commented 1 year ago

Sure