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

[Build] src/corelib/global/qrandom.cpp: undefined reference to `qRandomCpu(void*, long long)'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.8, 5.13.2
    • 5.13, 5.14, 5.15
    • Core: Other
    • None
    • Gentoo Linux
    • Linux/X11
    • 4f88e0bbd1c014adc6db7a37e4754446c4c8f529 (qt/qtbase/5.13.2) 67a9c600ad14ee44501a6df3509daa8234b97606 (qt/qtbase/5.12)

    Description

      Possibly after 5839714d [1], building Qt core with an AMD Ryzen 7 1700 fails like so:

      /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: qrandom.o: in function `QRandomGenerator::SystemGenerator::generate(unsigned int*, unsigned int*)':
      /src/corelib/global/qrandom.cpp:334: undefined reference to `qRandomCpu(void*, long long)'
      collect2: error: ld returned 1 exit status
      gmake: *** [Makefile:190: ../bin/qmake] Error 1
      

      Skipping the code path by, for example, changing line 333 in 'qrandom.cpp' [2] as follows allows for the build to complete:

      --- a/src/corelib/global/qrandom.cpp
      +++ b/src/corelib/global/qrandom.cpp
      @@ -330,7 +330,7 @@
           }
      
           qsizetype filled = 0;
      -    if (qHasHwrng() && (uint(qt_randomdevice_control.loadAcquire()) & SkipHWRNG) == 0)
      +    if (qHasHwrng() && (uint(qt_randomdevice_control.loadAcquire()) & SkipHWRNG) != 0)
               filled += qRandomCpu(buffer, count);
      
           if (filled != count && (uint(qt_randomdevice_control.loadAcquire()) & SkipSystemRNG) == 0) {
      

      1. https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=5839714d
      2. https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qrandom.cpp?h=5.14#n333

      Attachments

        Issue Links

          Activity

            People

              thiago Thiago Macieira
              chiitoo chiitoo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: