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

all directive in makefile collides with all.c filename in .pro SOURCES

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 5.9.4
    • Build tools: qmake
    • None
    • Tested on debian Jessie and Stretch using the provided gcc and Qt 5.9.4.

      Reproduce as follows:

      Create a .pro file with the following contents:

      TEMPLATE = lib
      CONFIG += staticlib
      SOURCES += all.c

      The contents of "all.c" are irrelevant, you may use an empty file.

      The build will always fail until you rename all.c to something else.

      An error comes from a garbage additional command, for instance:

      Using SOURCE.c the following compile output is shown:

      gcc -c -pipe -g -fPIC -Wall -W -D_REENTRANT -DQT_QML_DEBUG -I../all_c_test -I. -I../../qt594debug/mkspecs/linux-g++ -o SOURCE.o ../all_c_test/SOURCE.c
      rm -f liball_c_test.a
      ar cqs liball_c_test.a SOURCE.o

      Using all.c we get the same output plus an additional "gcc" call:

      gcc -c -pipe -g -fPIC -Wall -W -D_REENTRANT -DQT_QML_DEBUG -I../all_c_test -I. -I../../qt594debug/mkspecs/linux-g++ -o all.o ../all_c_test/all.c
      rm -f liball_c_test.a
      ar cqs liball_c_test.a all.o
      gcc all.o Makefile liball_c_test.a -o all

      it looks like the makefile has an "all" directive that collides with the name of the source OR object file all.c/all.o somehow.

      If the name "all" can't be used because when using qmake this should be made clear in the build output, now we get a "collect2: error: ld returned 1 exit status" message.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            peke Frederik De Ruyck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes