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

iconv-gnu test fails due to wrong function signature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.0.0 RC
    • 5.15.0
    • Build System
    • None
    • Linux/Other display system
    • bcfde1607f92b0ae5081289597f19110afc80ee1 (qt/qt5compat/dev)

    Description

      When configuring/building with "–iconv=gnu", the configure script fails with:

      ERROR: Feature 'gnu-libiconv' was enabled, but the pre-condition '!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv' failed.

      Relevant debug output:

      + cd /data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0/config.tests/gnu_iconv && MAKEFLAGS= /usr/bin/make
      > make[3]: Entering directory '/data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0/config.tests/gnu_iconv'
      > arm-openwrt-linux-gnueabi-g++ -c -pipe -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0:qtbase-everywhere-src-5.15.0 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libiconv-full/include -I/data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libintl-full/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0:qtbase-everywhere-src-5.15.0 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libiconv-full/include -I/data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libintl-full/include -O2 -w -fPIC -I. -I/data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0/mkspecs/linux-openwrt-g++ -o main.o main.cpp
      > main.cpp: In function 'int main(int, char**)':
      > main.cpp:11:14: error: invalid conversion from 'const char**' to 'char**' [-fpermissive]
      > iconv(x, &inp, &inbytes, &outp, &outbytes);
      > ^~~~
      > In file included from main.cpp:2:0:
      > /data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libiconv-full/include/iconv.h:80:15: note: initializing argument 2 of 'size_t libiconv(libiconv_t, char**, size_t*, char**, size_t*)'
      > #define iconv libiconv
      > ^
      > /data/oss/openwrt-19.07-e7f1313b/staging_dir/target-arm_cortex-a9+neon_glibc_eabi/usr/lib/libiconv-full/include/iconv.h:82:15: note: in expansion of macro 'iconv'
      > extern size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
      > ^~~~~
      > make[3]: *** [Makefile:173: main.o] Error 1
      > make[3]: Leaving directory '/data/oss/openwrt-19.07-e7f1313b/build_dir/target-arm_cortex-a9+neon_glibc_eabi/qtbase-everywhere-src-5.15.0/config.tests/gnu_iconv'
       => source failed verification.
      test config.qtbase_corelib.libraries.gnu_iconv FAILED

      So it's a signature mismatch between libiconv, where for iconv() }}the 2nd argument is to be expected of type `{{char* * inbuf` where the Qt test passes a `const char *`.

      EDIT: I don't seem to get atlassian's markup right. the more i try, the more it gets. Looking fine in the editor, looking cluttered in the final view.

      Tested with GNU libiconv versions 1.11.1 and 1.16.

       

      For reference: The Qt test for gnu-iconv is:

      "gnu_iconv": {
       "label": "GNU libiconv",
       "export": "iconv",
       "test": {
       "main": [
       "iconv_t x = iconv_open(\"\", \"\");",
       "const char *inp;",
       "char *outp;",
       "size_t inbytes, outbytes;",
       "iconv(x, &inp, &inbytes, &outp, &outbytes);",
       "iconv_close(x);"
       ]
       },

      ./src/corelib/configure.json:69ff

       

      Obviously the test can be easily changed accordingly (removing the const key word here), question however of course is, though, how the rest of Qt is using iconv.

      Also the sun_iconv tests inherits from gnu_iconv so I'm unable to grasp potential consequences.

      For OpenWrt - which I'm maintaining Qt for - I patched the test to remove the const keyword for icon()'s 2nd argument for now and my Qt test apps appear to work fine so far.

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              mirko_vogt Mirko Vogt
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes