[LLVMbugs] [Bug 11907] New: GCC's '-dumpbase' commandline argument not treated/ignored correctly
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Feb 2 05:55:14 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=11907
Bug #: 11907
Summary: GCC's '-dumpbase' commandline argument not
treated/ignored correctly
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: thebeing+llvm at halbordnung.de
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Hi,
I encountered a little problem recently when I tried to replace gcc with clang
in an external tool I unfortunately don't have control over (qcc from QNX, a
wrapper around the compiler you want their build system to use) which didn't
work due to clang aborting with a 'cannot specify -o when generating multiple
output files' error. I could narrow down the problem to the fact that apart
from '-o' qcc also adds a '-dumpbase' argument to the cc1 command line. So the
following works fine with gcc:
cc -S -dumpbase test.c -o test.s test.c
While the following
clang -v -cc1 -S -dumpbase test.c -o test.s test.c
aborts with 'clang: error: cannot specify -o when generating multiple output
files' (test.c is just "int main() {return 0;}")
If I remove the '-S' switch, I instead get a linker error:
/tmp/user/5001/test-dovJ2O.o: In function `main':
test.c:(.text+0x0): multiple definition of `main'
/tmp/user/5001/test-UzyGh5.o:test.c:(.text+0x0): first defined here
I thus speculate that clang (at r149605) is only ignoring '-dumpbase' and
treating the filename afterwards as a second file to compile. I'm not sure
whether the '-dumpbase'-functionality is actually worth supporting. (If I
understood it correctly it only replaces the actual source filename with the
one specified after -dumpbase in diagnostics) But it would be great if it could
at least be ignored in a way that clang can still be used as a drop-in
replacement to gcc even if '-dumpbase' is present on the commandline.
Many thanks,
Niels
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list