Skip to content
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

The flag SymbolRef::SF_Export is never set in COFFObjectFile #25867

Open
llvmbot opened this issue Nov 11, 2015 · 5 comments
Open

The flag SymbolRef::SF_Export is never set in COFFObjectFile #25867

llvmbot opened this issue Nov 11, 2015 · 5 comments
Labels
bugzilla Issues migrated from bugzilla orcjit

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 11, 2015

Bugzilla Link 25493
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor

Extended Description

The flag SymbolRef::SF_Export flag is never set in the COFFObjectFile::getSymbolFlags method. Because Kaleidoscope-Orc expects that its compiled expressions will be exported, in Windows environment it gets null pointer instead of valid symbol reference and crush.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 19, 2016

This patch fixes the problem for me
Because I am not yet familiar enough with LLVM and not at all familiar with PE/COFF, I am not sure if there are any potential downsides to setting this flag or if there are cases where setting it based on "isExternal()" is not actually valid, so this would have to be checked.

The JIT tutorial seems to work well, however.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 19, 2016

It doesn't work in MSVC++. What compiler do you use?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 25, 2016

It doesn't work in MSVC++. What compiler do you use?
I use Visual Studio 2013 Community.
I compiled the Debug version of SVN revision 274558.
According to my notes I did not set any cmake options
except for the python executable, since it would not find the right one by itself.

What error do you receive? Does it compile?

I just tried the BuildingAJIT Chapter 1 Tutorial and the Kaleidoscope-Ch4.exe.

Previously these would crash as you described whenever a top-level expression was entered, as the newly created function computing it would not be found. I now get the correct answer.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 25, 2016

Looking at the history of the file, Lang Hames already tried a similar patch in January, but then reverted it the next day.

He also started a discussion on the Mailing list with regards to setting this flag, and it seems the proposed solution was not to rely on it in the JIT, rather than changing the flag, which would not have matched what the COFF linker does.

Sorry for not consulting the "history" before.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 25, 2016

AFAIR llvm extensively uses C++14 features and therefore it compiles with VC++ 2015 only. I am using VC++ 2015 community + git version of the llvm + Lang's patch.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla orcjit
Projects
None yet
Development

No branches or pull requests

1 participant