Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1581

baremetal: cpp.driverFlags is ignored in GCC if the main file is an assembler file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 1.16.0
    • General
    • None
    • * Host OS: Windows
      * GCC v4.6.0 for MSP430: https://sourceforge.net/projects/mspgcc/
      * MinGW 7.3.0
    • Other

    Description

      If we use the CppApplication, with the assembler files (e.g. with one 'main.s' file), then the specified cpp.driverFlags does not passed to the linker:

      import qbs
      
      CppApplication {
          name: "hello-gcc"
          cpp.positionIndependentCode: false 
          cpp.driverFlags: ["-mmcu=msp430f5529"] /// < Desired driver flag
          files: ["main.s"] /// < One assembler file
      }
      

      In this case the flag "-mmcu=msp430f5529" will be not passed to the linker:

      C:\GCC\mspgcc-20120406-p20120911\bin\msp430-as.exe -g -o E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/3a52ce780950d4d9/main.s.o E:/git/ng/git/123/qbs-git/tests/hello-gcc-msp430-asm/main.s
      C:\GCC\mspgcc-20120406-p20120911\bin\msp430-ld.exe -o E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/hello-gcc E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/3a52ce780950d4d9/main.s.o
      C:\GCC\mspgcc-20120406-p20120911\bin\msp430-ld.exe: cannot open linker script file memory.x: No such file or directory
      

      That leads to the linking error.

      In other case, if try to use the C-source file instead (e.g. 'main.c' file), then all passes and compiles correctly:

      C:\GCC\mspgcc-20120406-p20120911\bin\msp430-gcc.exe -g -O0 -Wall -Wextra "-mmcu=msp430f5529" -pipe "-fvisibility=default" -o E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/3a52ce780950d4d9/main.c.o -c E:/git/ng/git/123/qbs-git/tests/hello-gcc-msp430-asm/main.c
      C:\GCC\mspgcc-20120406-p20120911\bin\msp430-gcc.exe "-mmcu=msp430f5529" -o E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/hello-gcc E:/git/ng/git/123/qbs-git/tests/build-hello-gcc-msp430-asm-debug/Debug_GCC_MSP4_ef01812d3f4e98a3/hello-gcc.5eaf30bd/3a52ce780950d4d9/main.c.o
      

      Seems, this related not only to the 'bare-metal' GCC, but also and to any GCC toolchains.

      UPD: Also, it is strange, that in case of an assembler file, calls the 'msp430-as' and the 'msp430-ld' directly, instead of 'msp430-gcc'.

      Attachments

        Activity

          People

            kandeler Christian Kandeler
            kuzulis Denis Shienkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: