Coder Social home page Coder Social logo

Building on Windows about lcc HOT 2 OPEN

drh avatar drh commented on August 24, 2024
Building on Windows

from lcc.

Comments (2)

alexfru avatar alexfru commented on August 24, 2024

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 for mips.md and removed other architectures (alpha, sparc, x86*) from src\bind.c; I also stumbled upon the missing check() function, which I defined as empty, however that's most likely wrong as it should come from dagcheck.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.

thelink2012 avatar thelink2012 commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.