Comments (9)
Just curious is it a clang problem or a crossbridge problem? Because as far as I know clang compiles FreeBSD 9 which sources are used in avm2_env
from crossbridge.
Really? Most of files under avm2_evn look unchanged comparing to master. Have you compared them to the freebsd version 9?
As an frontend, clang is different. It means you can not just switch to clang to make crossbridge work exactly as before unless you implement must-have parts. va_args is one of parts waiting to be added in.
I am going to add it after I get a clear picture of it. Also welcome anyone to make it come true. :)
from crossbridge.
I've found interesting statement in emscripten FAQ. They say that problem is caused by LE32 clang frontend and everything is OK with X86 frontend. Is crossbridge forced to use LE32 frontend?
from crossbridge.
I had investigated a bit further. And here are my thoughts what is the source of problem.
Error statement is: "cannot compile this aggregate va_arg expression yet"
After searching a bit I found that this error is raised in method AggExprEmitter::VisitVAArgExpr() (llvm-3.2/tools/clang/lib/GodeGen/CGExprAgg.cpp) As we see error occurs when method CGM.getTypes().getABIInfo().EmitVAArg() in method CodeGenFunction::EmitVAArg() (llvm-3.2/tools/clang/lib/CodeGen/CGCall.cpp) returns 0. ABI is initialized in method CodeGenModule::getTargetCodeGenInfo() (llvm-3.2/tools/clang/lib/GodeGen/TargetInfo.cpp)
For unknown for clang custom "avm2" architecture clang intializes DefaultTargetCodeGenInfo that stores DefaultABIInfo inside. DefaultABIInfo::EmitVAArg() is not implemented and just returns 0. So it seems to be not a clang problem. At least not a problem that should be fixed by clang team. We need to implement AVM2ABIInfo that implements EmitVAArg() method
from crossbridge.
Sorry for the misleading title. :'(
What I was trying to say was this part had not been added to clang yet. I never indicated it's a clang issue.
from crossbridge.
Oh, now I get it. But how it worked for gcc? Can we just use X86ABI? Initiallly I thought that flascc just takes LLVM created for generic X86 target and than converts it to AVM2 assembler, but now I'm not so sure. Also as far as I understand EmitVAArg just fetches value from valist according to abi convention. But where values are stored to valist according to that convention?
from crossbridge.
OK, I see you just copied a few lines as what I did. Though they are different under hood, but I guess X86ABI may work for this case, would you like to commit a more complete version by borrowing some code of X86_32?
from crossbridge.
Yep, I just looked through different implementations of EmitVAArgs for different platforms and extracted lines that seem to be common for all implementations. Yes, suggested implementation lacks alignment support. But I simply don't know how it should be done for avm2 or will X86_32 code work for avm2. So this implementation is just a first iteration that will allow code to compile, and probably to work.
from crossbridge.
Ok, just let it fly over the compilation and be fixed in future.
from crossbridge.
Related Issues (20)
- Merge codebase to the official SWIG project HOT 3
- Cannot build master branch on Windows platform using Cygwin HOT 6
- Cannot build master branch on Mac platform using Travis-CI HOT 2
- getting started HOT 7
- Building the SDK HOT 1
- pthreads and workers support HOT 10
- getting started HOT 17
- performance aspects of crossbridge code HOT 2
- GDB. HOT 1
- fopen with directories makes fseek throw HOT 2
- PlayerKernel.open() throws exception when opening ISpecialFile file with O_TRUNC
- Cygwin dll files is missing HOT 1
- simple app used flashcc socket throws 'terminate called after throwing an instance of 'AS3::ui::var'' HOT 1
- Can't get it to work with SFML
- how do i link a static lib which build by cygwin HOT 1
- Use crossbridge to compile client.c to swc but failed because of a link error HOT 1
- gcc in cygwin is not support windows 10
- archive project? HOT 4
- crossbridge and C++11 HOT 10
- Disable output in adl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crossbridge.