I've just installed clang in to cygwin:
clang version 3.1 (trunk 151024)
TargetL i386-pc-cygwin
Thread model: posix
However when trying to compile a simple c file (only main), the error occured:
clang version 3.1 (trunk 151024)
Target: i386-pc-cygwin
Thread model: posix
"/usr/local/bin/clang" -cc1 -triple i386-pc-cygwin -S -disable-free -main-file-name t.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v -resource-dir /usr/local/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -fno-dwarf-directory-asm -fdebug-compilation-dir /toolchain4 -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -o /cygdrive/c/Users/Br0ther/AppData/Local/Temp/t-zyOz8h.s -x c t.c
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
clang: error: unable to execute command: Program could not be executed
clang: note: diagnostic msg: Error generating preprocessed source(s).
Any body out there knows what causes the problem? I have no idea what is the meaning of the message:
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Your help is greatly appreciated
NK
If these two lines are worrying you:
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal
(use -v to see invocation)
then might I suggest you (as suggested in the error message) change your command to see the invocation line it uses:
"/usr/local/bin/clang" -v -cc1 -triple i386-pc-cygwin ...
Then you will know the name of the program and you can investigate why it's not on your path (for example).
Thank you for all suggestions.
However, the issue is fixed by increasing the heap size of cygwin.
Thanks
Related
Envs: Ubuntu 18.04, Miniconda3, python=3.7(GCC=7.3.0), GCC -v (7.4.0)
The error occurs when I run the following command:
scons build/X86/gem5.opt -j8
The error is as follow:
[ LINK] -> X86/marshal
lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:1005
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
lto-wrapper: fatal error: g++ returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
scons: *** [build/X86/marshal] Error 1
scons: building terminated because of errors.
And I am wondering how to fix it.
I am building a C++ project with Clang 3.8 and CMake 3.7 on Windows, but Clang emits an error in configure like below.
Determining if the CXX compiler works failed with the following output:
Change Dir: C:/tools/k.build/CMakeFiles/CMakeTmp
Run Build Command:"C:/tools/ninja.exe" "cmTC_c0004"
[1/2] Building CXX object CMakeFiles/cmTC_c0004.dir/testCXXCompiler.cxx.obj
[2/2] Linking CXX executable cmTC_c0004.exe
FAILED: cmTC_c0004.exe
cmd.exe /C "cd . && C:\tools\llvm-3.8.1.build\Release\bin\clang++.exe CMakeFiles/cmTC_c0004.dir/testCXXCompiler.cxx.obj -o cmTC_c0004.exe -Wl,--out-implib,libcmTC_c0004.dll.a -Wl,--major-image-version,0,--minor-image-version,0 && cd ."
LINK : warning LNK4044: unrecognized option '/-out-implib'; ignored
LINK : warning LNK4044: unrecognized option '/-major-image-version'; ignored
LINK : warning LNK4044: unrecognized option '/-minor-image-version'; ignored
LINK : fatal error LNK1181: cannot open input file 'libcmTC_c0004.dll.a'
clang++.exe: error: linker command failed with exit code 1181 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Strange thing is that no file exists in CMakeFiles/CMakeTmp/. How can I get it to work?
Simply put, you are defining your toolchain wrong. CMake thinks you are using the MSVC compiler with a different path. See this question for a detailed answer. Note that you will still need MSVC or Cygwin as a build environment.
My app having one error "ld: file not found: /Users/Fine-Mac/Library/Developer/Xcode/DerivedData/NeonatalApp-bvbdhtlpdjrirqfkvwpjfynxzwfm/Build/Products/Debug-iphoneos/NeonatalApp.app/NeonatalApp
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
In my app having following framework:
1)libsqlite3.dylib
2)libsqlite3.0.dylib
3)QuartzCore.framework
4)CoreGraphics.framework
But i don't understand which file is not found.
clang: error: unable to execute command: Illegal instruction: 4
clang: error: linker command failed due to signal (use -v to see invocation)
xcode:5.0 os:10.8.5
Why is there this error, about OS version?
How to modify?
Thank you~~
I'm trying to build a C static library (.a) that is compatible with a MIPS processor (I'm working in an embedded system).
To do so I tried to execute the following commands (obs: I'm using the mipsel-unknown-elf tool):
mipsel-unknown-elf-gcc -o math.o -c math.c
(No erros followed this command)
mipsel-unknown-elf-gcc -archive -o libmath.a math.o -lm
With this command I got the following error message:
cannot find -lm
collect2: ld returned 1 exit status
By getting this message I tried to add a -L/path argument:
mipsel-unknown-elf-gcc -archive -o libmath.a math.o -L/usr/lib/i386-linux-gnu -lm
But then I got the following error:
skipping incompatible /usr/lib/i386-linux-gnu/libm.a when searching for -lm
cannot find -lm
collect2: ld returned 1 exit status
Does anyone knows what's going on?
Your cross compiler distribution should include a MIPS libm.a. I just checked and I found several libm.a versions in my installation of CodeSourcery mips-linux-gnu-gcc. I don't have mipsel-unknown-elf-gcc installed, so I can't check that. If the mips-linux-gnu- version of libm.a is self contained, you might try using that version.