[LLVMbugs] [Bug 15400] New: clang::driver::tools::gcc::Common::ConstructJob forwards -mllvm to gcc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 28 12:08:42 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15400

            Bug ID: 15400
           Summary: clang::driver::tools::gcc::Common::ConstructJob
                    forwards -mllvm to gcc
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm at meinersbur.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Used for instance by the Generic_GCC toolchain assembler on mingw32:

>clang hello.c -o hello.exe -mllvm -debug -target "i686-pc-mingw32" -v
[...]
 "C:/MinGW/bin/gcc.exe" -mllvm -debug -v -c -m32 -o
C:/Users/MEINER~1/AppData/Local/Temp/hello-417226.o -x assembler
C:/Users/MEINER~1/AppData/Local/Temp/hello-417225.s
gcc.exe: erreur: unrecognized command line option '-mllvm'
Utilisation des specs internes.
COLLECT_GCC=C:/MinGW/bin/gcc.exe
Target: mingw32
Configuré avec: ../gcc-4.7.2/configure
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
--enable-libstdcxx-debug --disable-build-poststage1-with-cxx
--enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Modèle de thread: win32
gcc version 4.7.2 (GCC)
 "C:/MinGW/bin/gcc.exe" -mllvm -debug -v -m32 -o hello.exe
C:/Users/MEINER~1/AppData/Local/Temp/hello-417226.o
gcc.exe: erreur: unrecognized command line option '-mllvm'
gcc.exe: erreur: C:/Users/MEINER~1/AppData/Local/Temp/hello-417226.o: No such
file or directory
Utilisation des specs internes.
COLLECT_GCC=C:/MinGW/bin/gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-wrapper.exe
Target: mingw32
Configuré avec: ../gcc-4.7.2/configure
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
--enable-libstdcxx-debug --disable-build-poststage1-with-cxx
--enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Modèle de thread: win32
gcc version 4.7.2 (GCC)
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to
see invocation)


This is triggered because of this function in Tools.cpp:
static bool forwardToGCC(const Option &O) {
  return !O.hasFlag(options::NoForward) &&
         !O.hasFlag(options::DriverOption) &&
         !O.hasFlag(options::LinkerInput);
}

and in options.td:
def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option]>,
  HelpText<"Additional arguments to forward to LLVM's option processing">;

should be:
def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option, NoForward]>,
  HelpText<"Additional arguments to forward to LLVM's option processing">;
(or possibly DriverOption)

In contrast clang::driver::tools::linuxtools::Assemble::ConstructJob creates
its own command line for gcc.

Using clang r175978
Windows 7
Mingw gcc 4.7.2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130228/95beb35e/attachment.html>


More information about the llvm-bugs mailing list