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

lts build failing on fontconfig for android #85

Closed
contendar opened this issue Jun 29, 2021 · 6 comments
Closed

lts build failing on fontconfig for android #85

contendar opened this issue Jun 29, 2021 · 6 comments
Assignees
Labels
android Affect Android platform fixed-in-v4.5 Fixed in release v4.5 incompatibility question Further information is requested scripts Affect build scripts v4.4 Affects v4.4 release

Comments

@contendar
Copy link

contendar commented Jun 29, 2021

Description
While building lts build for android it fails

Expected behavior
It should compile successfully and create aar files in respective folder.

Current behavior
Build failed with fontconfig: failed message

To Reproduce
Execute following command
./android.sh --lts --enable-gpl --enable-android-media-codec --enable-android-zlib --enable-fontconfig --enable-freetype --enable-fribidi --enable-lame --enable-libvorbis --enable-libvpx --enable-libwebp --enable-x264

Expected behavior
It should compile successfully and create aar files in respective folder.

Screenshots
Console Screenshot

Logs
build.log

Environment

  • Platform: Android
  • Architecture: arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86_64
  • Version (if applicable) Latest
  • Source branch master
  • Android NDK version:22.0.7026061
@tanersener
Copy link
Collaborator

build.log shows that an unsupported NDK version is used during the build. Please use one of the versions listed in NDK Compatibility wiki page.

INFO: Using Android NDK v21.1.6352462 provided at /Users/zainali/Library/Android/sdk/ndk/21.1.6352462

@tanersener tanersener added android Affect Android platform question Further information is requested scripts Affect build scripts v4.4 Affects v4.4 release labels Jun 29, 2021
@tanersener tanersener self-assigned this Jun 29, 2021
@contendar
Copy link
Author

I am sorry I attached the wrong build.log(I was testing if using the NDK v21 fixed the issue), I am attaching the
correct build.log file.

After analysing the error in build.log file(undefined symbol: posix_fadvise referenced by fccache.c), I think may be ffmpeg-kit/src/fontconfig/src/fccache.c needs to be patched
Like replace following line

if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
	posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
#endif

With

#if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
        // 'posix_fadvise' introduced in API 21:
#elif defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
	posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
#endif

Do you think this will be ok(I verified that this patch let this library compile) or this may cause some performance issues?

@tanersener
Copy link
Collaborator

As far as I see, posix_fadvise is an optional component for fontconfig. configure script of fontconfig checks it and enables it only if it is available.

This is what I have about it in the config.log file of fontconfig. As you can understand, I don't have it too, so my builds don't try to link it and I don't get any linking errors.

configure:17022: checking for posix_fadvise in fcntl.h
configure:17052: result: no

I suggest analysing why it is enabled in your system. You can also patch it if it is easier for you. But I don't know whether it will affect the performance or not.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@tanersener
Copy link
Collaborator

My tests show that some macOS hosts are affected from this. It seems like although HAVE_POSIX_FADVISE define is detected as 0, clang still sets it to 1.

tanersener added a commit that referenced this issue Sep 18, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@tanersener
Copy link
Collaborator

Patched in the development branch.

@tanersener tanersener added fixed-on-development Fixed on the development branch. Not released yet. fixed-in-v4.5 Fixed in release v4.5 and removed no-issue-activity fixed-on-development Fixed on the development branch. Not released yet. labels Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform fixed-in-v4.5 Fixed in release v4.5 incompatibility question Further information is requested scripts Affect build scripts v4.4 Affects v4.4 release
Projects
None yet
Development

No branches or pull requests

2 participants