Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64154

Android clang build fails on missing member ::linkat()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.10.0 Beta 2, 5.10.0 Beta 3
    • Fix Version/s: 5.10.0 Beta 4, 5.10.0 RC
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      openSUSE Leap v42.3
      android ndk v15c
      android sdk v26
      clang
      armeabi-v7a
    • Platform/s:
      Android
    • Commits:
      490b24b06408e90e9684d8331fd3fe8b0c51b0b5

      Description

      commit 189e9c93d7e (QTemporaryFile: Add support for Linux's O_TMPFILE) added the following snippet to qtbase/src/corelib/io/qtemporaryfile.cpp:

      auto materializeAt = [=](const QFileSystemEntry &dst) {
          return ::linkat(AT_FDCWD, src, AT_FDCWD, dst.nativeFilePath(), AT_SYMLINK_FOLLOW) == 0;
      };

      This fails to compile for Android using clang from NDK v15c:

      <base>/android-ndk-r15c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -c -Xclang -include-pch -Xclang .pch/Qt5Core/c++.pch -D__ANDROID_API__=19 -target armv7-none-linux-androideabi -gcc-toolchain <base>/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -DANDROID_HAS_WSTRING --sysroot=<base>/android-ndk-r15c/sysroot -isystem <base>/android-ndk-r15c/sysroot/usr/include/arm-linux-androideabi -isystem <base>/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include -isystem <base>/android-ndk-r15c/sources/android/support/include -isystem <base>/android-ndk-r15c/sources/cxx-stl/llvm-libc++abi/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -O2 -Oz -mthumb -std=c++14 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wdate-time -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I<source>/qtbase/src/corelib -I. -Iglobal -I<source>/qtbase/src/3rdparty/harfbuzz/src -I<source>/qtbase/src/3rdparty/md5 -I<source>/qtbase/src/3rdparty/md4 -I<source>/qtbase/src/3rdparty/sha3 -I<source>/qtbase/src/3rdparty/double-conversion/include -I<source>/qtbase/src/3rdparty/double-conversion/include/double-conversion -I<source>/qtbase/src/3rdparty/forkfd -I<source>/qtbase/include -I<source>/qtbase/include/QtCore -I../../include -I../../include/QtCore -I<source>/qtbase/include/QtCore/5.10.0 -I<source>/qtbase/include/QtCore/5.10.0/QtCore -I../../include/QtCore/5.10.0 -I../../include/QtCore/5.10.0/QtCore -I.moc -I<source>/qtbase/src/3rdparty/pcre2/src -I<base>/sqlite-3.21.00.00-r15c-arm/install/include -I<base>/openssl-1.0.2l-r15c-arm/include -I<source>/qtbase/mkspecs/android-clang -o .obj/qstandardpaths.o <source>/qtbase/src/corelib/io/qstandardpaths.cpp
      <source>/qtbase/src/corelib/io/qtemporaryfile.cpp:461:18: error: no member named 'linkat' in the global namespace
              return ::linkat(AT_FDCWD, src, AT_FDCWD, dst.nativeFilePath(), AT_SYMLINK_FOLLOW) == 0;
                     ~~^
      1 error generated.
      Makefile:23290: recept voor doel '.obj/qtemporaryfile.o' is mislukt
      make[3]: *** [.obj/qtemporaryfile.o] Fout 1
      make[3]: *** Wachten op onvoltooide taken...
      make[3]: Map '<base>/qt-5.10.0-r15c-arm/qtbase/src/corelib' wordt verlaten 
      
      

       

      Because of the ongoing changes in NDK versions r14-r15-r16 regarding unified headers and clang versions I also tried r16-beta2, but there the result is the same.

       

        Attachments

        For Gerrit Dashboard: QTBUG-64154
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            mr.gadgets Frank van Vugt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes