Comments (2)
FWIW, as an experiment I tried compiling lcc with my own compiler (Smaller C) for Widnows. After bumping up the sizes of the internal tables/arrays in Smaller C and massaging lcc's code to exclude the features currently unsupported by Smaller C, I got it to compile and seemingly work. What I did outside of Smaller C issues is roughly:
- Compile
lburg
- Run lburg on
src\*.md
to produce architecture-specific.c
files (in reality I just did it formips.md
and removed other architectures (alpha, sparc, x86*) fromsrc\bind.c
; I also stumbled upon the missingcheck()
function, which I defined as empty, however that's most likely wrong as it should come fromdagcheck.md
) - Compile
src\*.c
That was enough to make lcc compile tiny snippets of C code like the following into MIPS assembly:
int a = 4;
int inca(void) { return ++a; }
Not terribly hard.
from lcc.
The limits tests fails because the VC headers became too complex for LCC to handle. In this case, VAARGS
for macros are present.
You cannot use any standard header anymore because of that, you should define standard functions and whatsover manually.
Plus, for VC2015 onwards, which uses the new Universal CRT, your ld
on etc/win32.c
should look something like:
char *ld[] = { "link", "-nologo",
"", "-subsystem:console", "-entry:mainCRTStartup",
"$2", "-OUT:$3", "$1", "/NODEFAULTLIB", LCCDIR "liblcc.lib", "oldnames.lib", "libcmt.lib", "legacy_stdio_definitions.lib", "libucrt.lib", "kernel32.lib", 0 };
Hope this helps anyone also trying to get this to build and work on Windows.
from lcc.
Related Issues (20)
- cpp buffer overflow on long lines HOT 1
- Please release the preprocessor under GPL as Plan9 where it originates from HOT 1
- Preprocessor hangs on an example from the C standard HOT 3
- mulops_calls option recognition
- Non-lvalue can be assigned after simplifying the shift operation
- Type rty definition should be at top HOT 2
- Add Support for macOS. HOT 1
- Are benchmarks comparing LCC with other compilers available ?
- Hello i would like to do language self programming and i would like to use this lcc compiler for you
- src/*.md files are copied incorrectly from repository HOT 2
- Question regarding origin of cpp - the C preprocessor HOT 3
- Targeting the CP1610 CPU for Intellivision possible? HOT 5
- macOS: Builtin issues HOT 1
- Assignment of struct compound-literal doesn't work. HOT 2
- how to run HOT 1
- Problem to build under linux
- AddressSanitizer: SEGV on unknown address
- Have a version of LCC retargetable to C99 HOT 2
- Add precompiled binaries to release?
- Invalid main declaration && Missing input files HOT 1
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 lcc.