Skip to content

build: fix 'implicit-function-declaration' on OpenHarmony platform #59547

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hqzing
Copy link
Contributor

@hqzing hqzing commented Aug 20, 2025

When I cross-compile Node.js for the OpenHarmony platform, I must add the parameter -Wno-error=implicit-function-declaration.

This is my compile script: https://github.com/hqzing/build-ohos-node/blob/main/build.sh

If I don't add this parameter, I will encounter this error:

../deps/uvwasi/src/uvwasi.c:1444:5: error: call to undeclared function 'seekdir'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1444 |     seekdir(dir->dir, cookie);
      |     ^
../deps/uvwasi/src/uvwasi.c:1459:14: error: call to undeclared function 'telldir'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1459 |       tell = telldir(dir->dir);
      |              ^
2 errors generated.
make[1]: *** [deps/uvwasi/uvwasi.target.mk:100: /root/build-ohos-node/node-v24.2.0/out/Release/obj.target/uvwasi/deps/uvwasi/src/uvwasi.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Now that I have identified the root cause, which is the missing macro definition _GNU_SOURCE during the build process, I am proposing this PR to fix the issue and eliminate the dependency on -Wno-error=implicit-function-declaration parameter.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/wasi

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. wasi Issues and PRs related to the WebAssembly System Interface. labels Aug 20, 2025
@hqzing hqzing force-pushed the fix_implicit_function_declaration branch from 327b892 to dbaa7de Compare August 20, 2025 09:26
@hqzing hqzing changed the title build: fix 'implicit-function-declaration' when cross-compile for the OpenHarmony platform build: fix 'implicit-function-declaration' on OpenHarmony platform Aug 20, 2025
@targos targos added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 21, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 21, 2025
@nodejs-github-bot
Copy link
Collaborator

@hqzing
Copy link
Contributor Author

hqzing commented Aug 22, 2025

Too many flaky test, should we retry the CI task? @lpinca @targos @UlisesGascon

@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. wasi Issues and PRs related to the WebAssembly System Interface.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants