You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Meson misdetects strnlen and strndup as present when they are not.
Example:
Running compile:
Working directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp81w99i2x
Code:
#define strnlen meson_disable_define_of_strnlen
#include <limits.h>
#undef strnlen
#ifdef __cplusplus
extern "C"
#endif
char strnlen (void);
#if defined __stub_strnlen || defined __stub___strnlen
fail fail fail this function is not going to work
#endif
int main(void) {
return strnlen ();
}
-----------
Command line: `/opt/local/bin/gcc-mp-14 -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -L/opt/local/lib/db48 -I/opt/local/libexec/openssl3/include -I/opt/local/include/db48 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp81w99i2x/testfile.c -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp81w99i2x/output.exe -pipe -Os -arch ppc -O0 -std=c11 -Wl,-headerpad_max_install_names` -> 1
stderr:
Undefined symbols:
"_strnlen", referenced from:
_main in ccBiqEIa.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
-----------
Running compile:
Working directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp5uqy20q2
Code:
int main(void) {
/* With some toolchains (MSYS2/mingw for example) the compiler
* provides various builtins which are not really implemented and
* fall back to the stdlib where they aren't provided and fail at
* build/link time. In case the user provides a header, including
* the header didn't lead to the function being defined, and the
* function we are checking isn't a builtin itself we assume the
* builtin is not functional and we just error out. */
#if !1 && !defined(strnlen) && !0
#error "No definition for __builtin_strnlen found in the prefix"
#endif
#ifdef __has_builtin
#if !__has_builtin(__builtin_strnlen)
#error "__builtin_strnlen not found"
#endif
#elif ! defined(strnlen)
__builtin_strnlen;
#endif
return 0;
}
-----------
Command line: `/opt/local/bin/gcc-mp-14 -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -L/opt/local/lib/db48 -I/opt/local/libexec/openssl3/include -I/opt/local/include/db48 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp5uqy20q2/testfile.c -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmp5uqy20q2/output.exe -pipe -Os -arch ppc -O0 -std=c11 -Wl,-headerpad_max_install_names` -> 0
Checking for function "strnlen" : YES
Running compile:
Working directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpwm47abeg
Code:
#define strndup meson_disable_define_of_strndup
#include <limits.h>
#undef strndup
#ifdef __cplusplus
extern "C"
#endif
char strndup (void);
#if defined __stub_strndup || defined __stub___strndup
fail fail fail this function is not going to work
#endif
int main(void) {
return strndup ();
}
-----------
Command line: `/opt/local/bin/gcc-mp-14 -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -L/opt/local/lib/db48 -I/opt/local/libexec/openssl3/include -I/opt/local/include/db48 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpwm47abeg/testfile.c -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpwm47abeg/output.exe -pipe -Os -arch ppc -O0 -std=c11 -Wl,-headerpad_max_install_names` -> 1
stderr:
Undefined symbols:
"_strndup", referenced from:
_main in ccYNuFXj.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status
-----------
Running compile:
Working directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpuk6wfim1
Code:
int main(void) {
/* With some toolchains (MSYS2/mingw for example) the compiler
* provides various builtins which are not really implemented and
* fall back to the stdlib where they aren't provided and fail at
* build/link time. In case the user provides a header, including
* the header didn't lead to the function being defined, and the
* function we are checking isn't a builtin itself we assume the
* builtin is not functional and we just error out. */
#if !1 && !defined(strndup) && !0
#error "No definition for __builtin_strndup found in the prefix"
#endif
#ifdef __has_builtin
#if !__has_builtin(__builtin_strndup)
#error "__builtin_strndup not found"
#endif
#elif ! defined(strndup)
__builtin_strndup;
#endif
return 0;
}
-----------
Command line: `/opt/local/bin/gcc-mp-14 -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -L/opt/local/lib/db48 -I/opt/local/libexec/openssl3/include -I/opt/local/include/db48 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpuk6wfim1/testfile.c -o /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_netatalk/netatalk/work/build/meson-private/tmpuk6wfim1/output.exe -pipe -Os -arch ppc -O0 -std=c11 -Wl,-headerpad_max_install_names` -> 0
Checking for function "strndup" : YES
To Reproduce
Build something using meson which has related checks. For example, netatalk.
Expected behavior
Support for these should be accurately determined.
Describe the bug
Meson misdetects
strnlen
andstrndup
as present when they are not.Example:
To Reproduce
Build something using
meson
which has related checks. For example,netatalk
.Expected behavior
Support for these should be accurately determined.
Meson 1.5.1
P. S. Looks similar to the old bug: #3672
The text was updated successfully, but these errors were encountered: