Giter Site home page Giter Site logo

9cc-1's Introduction

/*---------------------------------------------------.
|           This is the develop branch               |
`----------------------------------------------------*

see also https://github.com/huangguiyang/9cc/tree/master for stable codebase.


9cc - a standard C compiler

The compiler is designed to be able to compile itself, so it is written in C. And it is intended to support all C99 language features while keeping the code as simple and small as possible.


Source Roadmap:
---------------

burg            The bottom-up tree rewriting generator.

doc             Documentation.

include		Header files provided by this compiler.

libcpp          C Preprocessor.

libutils	Common utilities.


HOWTO build:
------------

Make sure you have any Linux distribution installed.

To build the compiler, run command:

   	make

To build the bootstrap compiler, run command:

   	make bootstrap

To install the compiler, run command:

        make install

Then you can read the man page using command:

        man 9cc

To uninstall, run command:

        make uninstall


Troubleshooting:
----------------

If your Linux distribution's crt objects (crt1.o, crti.o, crtn.o) are located in '/usr/lib64/' (like Fedora), edit the Makefile and add CFLAGS -DCONFIG_LIB64. The default locatation is '/usr/lib/x86-64-linux-gnu/'. (like Ubuntu)

See 9cc.c for more details.


Caveats:
--------

1. Adding test cases.


License:
--------

9cc - a standard C compiler

Copyright (c) 2015 Guiyang Huang

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.


Reference:
----------

1. C Standard Draft:
	C99: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
	C11: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

2. "C: A Reference Manual": http://careferencemanual.com

3. X86-64 ABI:
	v0.90 (Dec 2, 2003): http://people.freebsd.org/~obrien/amd64-elf-abi.pdf
	v0.99.6 (Oct 7, 2013): http://www.x86-64.org/documentation/abi.pdf

4. DWARF Standard: http://dwarfstd.org/

5. "Compilers: Principles, Techniques, and Tools": http://dragonbook.stanford.edu/

6. "Intel 64 and IA-32 Architecture Software Developer Manuals":
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

7. Using as: https://sourceware.org/binutils/docs/as/

8. GCC: https://github.com/gcc-mirror/gcc

9. lcc: https://github.com/drh/lcc

9cc-1's People

Contributors

huangguiyang avatar

Watchers

 avatar

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.