You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that gclang mishandles the -mllvm compilation flags. For example passing -mllvm -stack-alignment=16.
Environment
gllvm version 1.3.0
go version go1.16.5
llvm version 10
To reproduce:
main.c:
intmain(intargc, char**argv) {
return0;
}
$ WLLVM_OUTPUT_LEVEL="DEBUG" gclang -mllvm -stack-alignment=16 main.c
INFO:Entering CC [-mllvm -stack-alignment=16 main.c]
DEBUG:Compile using parsed arguments:
InputList: [-mllvm -stack-alignment=16 main.c]
InputFiles: [main.c]
ObjectFiles: []
OutputFilename:
CompileArgs: [-mllvm]
LinkArgs: []
ForbiddenFlags: []
IsVerbose: false
IsDependencyOnly: false
IsPreprocessOnly: false
IsAssembleOnly: false
IsAssembly: false
IsCompileOnly: false
IsEmitLLVM: false
IsLTO: false
IsPrintOnly: false
DEBUG:buildObjectFile: [-mllvm main.c -c-o .main.c.o]
DEBUG:Calling execCmd(clang, [-mllvm -stack-alignment=16 main.c])
clang: error: no input files
DEBUG:execCmd: clang [-mllvm main.c -c-o .main.c.o] had exitCode 1
DEBUG:execCmd: error was exit status 1
ERROR:Failed to build object file for main.c because: exit status 1
DEBUG:execCmd: clang [-mllvm -stack-alignment=16 main.c] had exitCode 0
clang (LLVM option parsing): Unknown command line argument '-emit-llvm'. Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean ' --mno-hvx'?
DEBUG:execCmd: clang [-mllvm -emit-llvm -c main.c -o .main.c.o.bc] had exitCode 1
DEBUG:execCmd: error was exit status 1
ERROR:Failed to build bitcode file for main.c because: exit status 1
DEBUG:attachBitcodePathToObject recognized .o as something it can inject into.
objcopy: '.main.c.o': No such file
DEBUG:execCmd: objcopy [--add-section .llvm_bc=/tmp/gllvm172431081 .main.c.o] had exitCode 1
DEBUG:execCmd: error was exit status 1
WARNING:attachBitcodePathToObject: objcopy [--add-section .llvm_bc=/tmp/gllvm172431081 .main.c.o] failed because exit status 1
clang: error: no such file or directory: '.main.c.o'
clang: error: no input files
DEBUG:execCmd: clang [.main.c.o -o a.out] had exitCode 1
DEBUG:execCmd: error was exit status 1
ERROR:clang [.main.c.o -o a.out] failed to link: exit status 1.
DEBUG:Calling [gclang -mllvm -stack-alignment=16 main.c] returned 0
It fails to forward the -mllvm argument in some of the steps, like with -mllvm -emit-llvm -c main.c -o .main.c.o.bc, where -emit-llvm gets parsed by clang as the option for -mllvm making the build fail.
The text was updated successfully, but these errors were encountered:
It seems that gclang mishandles the
-mllvm
compilation flags. For example passing-mllvm -stack-alignment=16
.Environment
To reproduce:
main.c
:It fails to forward the
-mllvm
argument in some of the steps, like with-mllvm -emit-llvm -c main.c -o .main.c.o.bc
, where-emit-llvm
gets parsed by clang as the option for-mllvm
making the build fail.The text was updated successfully, but these errors were encountered: