mesonbuild / mesonbuild/wrapdb

libuv : libuv_test_cargs

Open
#1,060 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Meson
Stars
118
Forks
298
Avg merge
2d 2h
Merged PRs (30d)
24

Description

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

```c++
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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at subprojects/packagefiles/libuv/meson.build around line 628 and inspect how libuv_cargs and libuv_test_cargs are assembled. Compare those arguments with the failing compilation of subprojects/libuv-v1.44.2/test/test-thread.c, then verify that the Linux build passes with the detected C arguments applied to the test compilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.