Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to libuv 1.44.2 requires -D_GNU_SOURCE build flag on Android #46743

Closed
nappy opened this issue Feb 20, 2023 · 0 comments · Fixed by #46746
Closed

Upgrade to libuv 1.44.2 requires -D_GNU_SOURCE build flag on Android #46743

nappy opened this issue Feb 20, 2023 · 0 comments · Fixed by #46746

Comments

@nappy
Copy link
Contributor

nappy commented Feb 20, 2023

Version

18.14.1

Platform

android

Subsystem

build / deps

What steps will reproduce the bug?

Crosscompiling for Android.

How often does it reproduce? Is there a required condition?

100%

What is the expected behavior?

Build succeeding.

What do you see instead?

/home/nappy/ndks/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi23-clang -o /home/nappy/node/out/Release/obj.target/libuv/deps/uv/src/unix/getnameinfo.o ../deps/uv/src/unix/getnameinfo.c '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DICU_NO_USER_DATA_OVERRIDE' '-D__STDC_FORMAT_MACROS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GLIBCXX_USE_C99_MATH' -I../deps/uv/include -I../deps/uv/src  -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -g --std=gnu89 -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes -fno-strict-aliasing -O3 -fno-omit-frame-pointer -fPIC  -MMD -MF /home/nappy/node/out/Release/.deps//home/nappy/node/out/Release/obj.target/libuv/deps/uv/src/unix/getnameinfo.o.d.raw -I/home/nappy/openssl/include -fPIE -fPIC -c    
In file included from <built-in>:385:
../deps/uv/src/unix/core.c:1632:3: error: use of undeclared identifier 'cpu_set_t'
  cpu_set_t set;
  ^
../deps/uv/src/unix/core.c:1635:26: error: use of undeclared identifier 'set'
  memset(&set, 0, sizeof(set));
                         ^
../deps/uv/src/unix/core.c:1635:11: error: use of undeclared identifier 'set'
  memset(&set, 0, sizeof(set));
          ^
../deps/uv/src/unix/core.c:1641:12: warning: implicit declaration of function 'sched_getaffinity' [-Wimplicit-function-declaration]
  if (0 == sched_getaffinity(0, sizeof(set), &set))
           ^
../deps/uv/src/unix/core.c:1641:40: error: use of undeclared identifier 'set'
  if (0 == sched_getaffinity(0, sizeof(set), &set))
                                       ^
../deps/uv/src/unix/core.c:1641:47: error: use of undeclared identifier 'set'
  if (0 == sched_getaffinity(0, sizeof(set), &set))
                                              ^
../deps/uv/src/unix/core.c:1642:10: warning: implicit declaration of function 'CPU_COUNT' [-Wimplicit-function-declaration]
    rc = CPU_COUNT(&set);
         ^
../deps/uv/src/unix/core.c:1642:21: error: use of undeclared identifier 'set'
    rc = CPU_COUNT(&set);
                    ^
1 warning generated.
3 warnings and 6 errors generated

Additional information

Adding -D_GNU_SOURCE to the build flags, as proposed by libuv/libuv#3499 (comment) resolves the issue. @lpinca

nappy added a commit to nappy/node that referenced this issue Feb 20, 2023
Remove missing source file and add the GNU_SOURCE flag required to build libuv for android

Fixes nodejs#46743
Fixes nodejs#46743
nappy added a commit to nappy/node that referenced this issue Feb 20, 2023
Fix android build errors introduced by the upgrade to libuv 1.44.2

Fixes: nodejs#46743
Fixes: nodejs#46744
nappy added a commit to nappy/node that referenced this issue Feb 21, 2023
Fix android build errors introduced by the upgrade to libuv 1.44.2

Fixes: nodejs#46743
Fixes: nodejs#46744
nodejs-github-bot pushed a commit that referenced this issue Feb 22, 2023
Fix android build errors introduced by the upgrade to libuv 1.44.2

Fixes: #46743
Fixes: #46744
PR-URL: #46746
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
targos pushed a commit that referenced this issue Mar 13, 2023
Fix android build errors introduced by the upgrade to libuv 1.44.2

Fixes: #46743
Fixes: #46744
PR-URL: #46746
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
danielleadams pushed a commit that referenced this issue Apr 11, 2023
Fix android build errors introduced by the upgrade to libuv 1.44.2

Fixes: #46743
Fixes: #46744
PR-URL: #46746
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant