Skip to content

[X86 COFF MC Assembler] Unsupported EmitRawText called on Windows #8977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Nov 15, 2010 · 13 comments
Closed

[X86 COFF MC Assembler] Unsupported EmitRawText called on Windows #8977

llvmbot opened this issue Nov 15, 2010 · 13 comments
Labels
bugzilla Issues migrated from bugzilla llvm:asmparser

Comments

@llvmbot
Copy link
Member

llvmbot commented Nov 15, 2010

Bugzilla Link 8605
Resolution FIXED
Resolved on Apr 30, 2013 15:33
Version trunk
OS Windows XP
Blocks llvm/llvm-bugzilla-archive#13707
Reporter LLVM Bugzilla Contributor
CC @Bigcheese,@DougGregor,@tritao,@rnk,@rubenvb

Extended Description

Hello
I try to compile the open source project zorba (http://www.zorba-xquery.com/) with clang on Windows. Unfortunately, I came across an internal clang error I am not able to fix myself:

clang version 2.9 (trunk 119081)
Target: i686-pc-win32
Thread model: posix
"C:/Users/sausalito/Desktop/zorba-devel/clang/build/bin/clang++.exe" -cc1 -triple i686-pc-win32 -em
it-obj -mrelax-all -disable-free -main-file-name errstrings.cpp -mrelocation-model static -mdisable-
fp-elim -masm-verbose -mconstructor-aliases -v -g -resource-dir C:/Users/sausalito/Desktop/zorba-dev
el/clang/build/bin/../lib/clang/2.9 -I C:\Users\sausalito\Desktop\thirdparty\libxml2-2.7.7.win32\inc
lude -I C:\Users\sausalito\Desktop\thirdparty\curl\curl-7.21.1\include -I C:\Users\sausalito\Desktop
\thirdparty\tidy-060405-dll\include -I C:\Users\sausalito\Desktop\thirdparty\iconv-1.9.2.win32\inclu
de -I C:\Users\sausalito\Desktop\thirdparty\icu4c-4_4_1-src\icu\include -I C:\Users\sausalito\Deskto
p\thirdparty\xerces-c-3.1.1\src -I C:\Users\sausalito\Desktop\zorba-devel\build_clang\include -I C:
Users\sausalito\Desktop\zorba-devel\trunk\include -I C:\Users\sausalito\Desktop\zorba-devel\trunk\ex
ternal -ferror-limit 19 -fmessage-length 100 -fexceptions -fms-extensions -fmsc-version=1300 -fgnu-r
untime -fdiagnostics-show-option -fcolor-diagnostics -o CMakeFiles\json.dir\errstrings.obj -x c++ C:
\Users\sausalito\Desktop\zorba-devel\trunk\external\json\errstrings.cpp
clang -cc1 version 2.9 based upon llvm 2.9svn-r119080 hosted on i686-pc-win32
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
C:\Users\sausalito\Desktop\thirdparty\libxml2-2.7.7.win32\include
C:\Users\sausalito\Desktop\thirdparty\curl\curl-7.21.1\include
C:\Users\sausalito\Desktop\thirdparty\tidy-060405-dll\include
C:\Users\sausalito\Desktop\thirdparty\iconv-1.9.2.win32\include
C:\Users\sausalito\Desktop\thirdparty\icu4c-4_4_1-src\icu\include
C:\Users\sausalito\Desktop\thirdparty\xerces-c-3.1.1\src
C:\Users\sausalito\Desktop\zorba-devel\build_clang\include
C:\Users\sausalito\Desktop\zorba-devel\trunk\include
C:\Users\sausalito\Desktop\zorba-devel\trunk\external
C:/Users/sausalito/Desktop/zorba-devel/clang/build/bin/../lib/clang/2.9/include
C:\Program Files\Microsoft Visual Studio 10.0\VC\include
C:\Program Files\Microsoft SDKs\Windows\v7.0A\include
End of search list.
EmitRawText called on an MCStreamer that doesn't support it, something must not be fully mc'ized
clang++: error: clang frontend command failed with exit code 3 (use -v to see invocation)

Do you know that problem? Is it fixable? Or by-passable?

Regards
David

@lattner
Copy link
Collaborator

lattner commented Nov 15, 2010

Try passing -no-integrated-as as a workaround.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 15, 2010

Chris, your solution bypasses the problem. Although I get warnings like crazy now:

C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:1:2: warning: ignoring directive for now
.section .debug_frame,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:3:2: warning: ignoring directive for now
.section .debug_info,"rn"
^
C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:5:2: warning: ignoring directive for now
.section .debug_abbrev,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:7:2: warning: ignoring directive for now
.section .debug_aranges,"rn"
^
C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:8:2: warning: ignoring directive for now
.section .debug_macinfo,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:9:2: warning: ignoring directive for now
.section .debug_line,"rn"
^
C:/Users/SAUSAL~1/AppData/Local/Temp/cc-000000.s:11:2: warning: ignoring directive for now

....

Should mark the Bug as resolved or do you wanna keep it to fix the real cause of the error?

@Bigcheese
Copy link
Contributor

Chris, your solution bypasses the problem. Although I get warnings like crazy
now:

C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:1:2: warning: ignoring
directive for now
.section .debug_frame,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:3:2: warning: ignoring
directive for now
.section .debug_info,"rn"
^
C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:5:2: warning: ignoring
directive for now
.section .debug_abbrev,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:7:2: warning: ignoring
directive for now
.section .debug_aranges,"rn"
^
C:/Users/SAUSAL1/AppData/Local/Temp/cc-000000.s:8:2: warning: ignoring
directive for now
.section .debug_macinfo,"rn"
^
C:/Users/SAUSAL
1/AppData/Local/Temp/cc-000000.s:9:2: warning: ignoring
directive for now
.section .debug_line,"rn"
^
C:/Users/SAUSAL~1/AppData/Local/Temp/cc-000000.s:11:2: warning: ignoring
directive for now

....

Should mark the Bug as resolved or do you wanna keep it to fix the real cause
of the error?

What program is emitting those errors? They look like llvm-mc, but -no-integrated-as should be using the system as tool...

I'm also confused as to which C++ headers you are using.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 15, 2010

I am using the Visual Studio headers. I set up my build directory with the following command:

set CC=C:...\clang.exe
set CXX=C:...\clang++.exe

cmake -G "NMake Makefiles" ..\trunk

If it helps, this is the clang++ command that prints prints the warnings:

C:\Users\sausalito\Desktop\zorba-devel\clang\build\bin\clang++.exe -no-integrated-as -g -IC:\Users\sausalito\Desktop\thirdparty\libxml2-2.7.7.win32\include -IC:\Users\sausalito\Desktop\thirdparty\curl\curl-7.21.1\include -IC:\Users\sausalito\Desktop\thirdparty\tidy-060405-dll\include -IC:\Users\sausalito\Desktop\thirdparty\iconv-1.9.2.win32\include -IC:\Users\sausalito\Desktop\thirdparty\icu4c-4_4_1-src\icu\include -IC:\Users\sausalito\Desktop\thirdparty\xerces-c-3.1.1\src -IC:\Users\sausalito\Desktop\zorba-devel\build_clang\include -IC:\Users\sausalito\Desktop\zorba-devel\trunk\include -IC:\Users\sausalito\Desktop\zorba-devel\trunk\external -o CMakeFiles\json.dir\errstrings.obj -c C:\Users\sausalito\Desktop\zorba-devel\trunk\external\json\errstrings.cpp

@Bigcheese
Copy link
Contributor

I am using the Visual Studio headers. I set up my build directory with the
following command:

set CC=C:...\clang.exe
set CXX=C:...\clang++.exe

cmake -G "NMake Makefiles" ..\trunk

If it helps, this is the clang++ command that prints prints the warnings:

C:\Users\sausalito\Desktop\zorba-devel\clang\build\bin\clang++.exe
-no-integrated-as -g
-IC:\Users\sausalito\Desktop\thirdparty\libxml2-2.7.7.win32\include
-IC:\Users\sausalito\Desktop\thirdparty\curl\curl-7.21.1\include
-IC:\Users\sausalito\Desktop\thirdparty\tidy-060405-dll\include
-IC:\Users\sausalito\Desktop\thirdparty\iconv-1.9.2.win32\include
-IC:\Users\sausalito\Desktop\thirdparty\icu4c-4_4_1-src\icu\include
-IC:\Users\sausalito\Desktop\thirdparty\xerces-c-3.1.1\src
-IC:\Users\sausalito\Desktop\zorba-devel\build_clang\include
-IC:\Users\sausalito\Desktop\zorba-devel\trunk\include
-IC:\Users\sausalito\Desktop\zorba-devel\trunk\external -o
CMakeFiles\json.dir\errstrings.obj -c
C:\Users\sausalito\Desktop\zorba-devel\trunk\external\json\errstrings.cpp

Oh, C++ is very broken when targeting Microsoft Windows. I'm surprised it even tried to generate code when using the MSVC headers.

-no-integrated-as is using llvm-mc because MSVC doesn't have an assembler that can assemble C++ code.

Does the compiled code actually work?

The COFF backend doesn't currently support debug info, so that's probably why it's complaining in this case. I can take a look if you can give me the preprocessed source.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 16, 2010

Actually, I am not able to compile working code on Windows. Because I compiled clang with visual studio, I assumed that it will work. Therefore, I started immediately compiling my project. But, I am not even able to compile a hello world program. It ends with the following error msg:

[100%] Building CXX object CMakeFiles/main.dir/main.cpp.obj
In file included from C:\Users\sausalito\Desktop\zorba-devel\test\code\main.cpp:1:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/iostream:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/istream:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ios:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xstring:6:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xmemory:8:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xutility:8:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/utility:9:
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:7:
C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(355) : error: rvalue references

  are only allowed in C++0x
    struct _Remove_reference<_Ty&&>
                                ^

C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(368) : error: rvalue references

  are only allowed in C++0x
    struct _Remove_rvalue_reference<_Ty&&>
                                       ^

In file included from C:\Users\sausalito\Desktop\zorba-devel\test\code\main.cpp:1:

How is it possible to compile something on Windows?

@Bigcheese
Copy link
Contributor

You have to

Actually, I am not able to compile working code on Windows. Because I compiled
clang with visual studio, I assumed that it will work. Therefore, I started
immediately compiling my project. But, I am not even able to compile a hello
world program. It ends with the following error msg:

[100%] Building CXX object CMakeFiles/main.dir/main.cpp.obj
In file included from
C:\Users\sausalito\Desktop\zorba-devel\test\code\main.cpp:1:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/iostream:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/istream:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/ostream:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/ios:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xlocnum:10:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/streambuf:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xiosbase:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xlocale:8:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/stdexcept:7:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xstring:6:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xmemory:8:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/xutility:8:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/utility:9:
In file included from C:\Program Files\Microsoft Visual Studio
10.0\VC\include/type_traits:7:
C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(355) :
error: rvalue references

  are only allowed in C++0x
    struct _Remove_reference<_Ty&&>
                                ^

C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(368) :
error: rvalue references

  are only allowed in C++0x
    struct _Remove_rvalue_reference<_Ty&&>
                                       ^

In file included from
C:\Users\sausalito\Desktop\zorba-devel\test\code\main.cpp:1:

How is it possible to compile something on Windows?

You have to either use MinGW, or use only C. We are working to get MSVC C++ headers working.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 16, 2010

Ok. Then, I need to wait till MSVC C++ headers are working because our project depends on several other MSVC projects. Can you give me a rough time estimate? When will the MSVC C++ headers work?

@DougGregor
Copy link
Contributor

Moving over to MC

@llvmbot
Copy link
Member Author

llvmbot commented May 17, 2011

repro case

@llvmbot
Copy link
Member Author

llvmbot commented May 17, 2011

(Oops, the comment was lost with the repro case I just attached. Try 2...)

I'm also seeing this error message on Windows when generating object files from bitcode emitted by my own compiler (i.e. clang isn't involved at all). It only seems to happen when debugging metadata is included in the output. (I realize that debugging info isn't supported on Windows currently, so this error isn't a huge issue for me.)

I've attached a test case. (Unfortunately bugpoint was being fiddly for me and I couldn't get it to generate a minimal reproducer.)

@asl
Copy link
Collaborator

asl commented Nov 24, 2011

*** Bug llvm/llvm-bugzilla-archive#11430 has been marked as a duplicate of this bug. ***

@rnk
Copy link
Collaborator

rnk commented Apr 30, 2013

This appears to have been fixed. 'llc -filetype=obj simple.ll' works for me on Windows.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
daniel-grumberg pushed a commit to daniel-grumberg/llvm-project that referenced this issue Jul 16, 2024
…s-function-fault-backtrace-6.0

[lldb] Allow fetching of RA register when above fault handler (llvm#98566)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm:asmparser
Projects
None yet
Development

No branches or pull requests

6 participants