Coder Social home page Coder Social logo

minidecaf's Introduction

minidecaf's People

Contributors

hoblovski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

minidecaf's Issues

咨询框架源代码(c++)

你好,我是哈尔滨工业大学的一名本科生,最近在网站 https://decaf-lang.github.io/minidecaf-tutorial/ 上看到贵系的编译课程指导,想自我尝试一下这门课程的实验部分,希望从中学到知识。
但是我无法获得框架源代码,似乎需要从清华的代码托管平台上获取,所以我在github上搜索框架源代码,最终找到的只有各位助教写好的已经能通过测试用例的代码。
我想问一下您能提供一下 https://decaf-lang.github.io/minidecaf-tutorial/ 该网站上所用到的框架的源代码吗?我想按照这个指导自己去实现一个能通过测试用例的编译器 minidecaf。 谢谢!!!

Fail to compile on macOS

Hi,
I tried to compile the C program in the doc on macOS, but failed:

❯ cat test.c
#include <stdio.h>
int main() { printf("Hello world!\n"); }
❯ riscv64-unknown-elf-gcc -O3 test.c -march=rv32im -mabi=ilp32
riscv64-unknown-elf-gcc: fatal error: Can't found suitable multilib set for '-march=rv32im'/'-mabi=ilp32'
compilation terminated.

However, I can generate the assembly code:

❯ riscv64-unknown-elf-gcc -O3 -S test.c -march=rv32im -mabi=ilp32
❯ cat test.s
	.file	"test.c"
	.option nopic
	.attribute arch, "rv32i2p0_m2p0"
	.attribute unaligned_access, 0
	.attribute stack_align, 16
	.text
	.section	.rodata.str1.4,"aMS",@progbits,1
	.align	2
.LC0:
	.string	"Hello world!"
	.section	.text.startup,"ax",@progbits
	.align	2
	.globl	main
	.type	main, @function
main:
	lui	a0,%hi(.LC0)
	addi	sp,sp,-16
	addi	a0,a0,%lo(.LC0)
	sw	ra,12(sp)
	call	puts
	lw	ra,12(sp)
	li	a0,0
	addi	sp,sp,16
	jr	ra
	.size	main, .-main
	.ident	"GCC: (SiFive GCC-Metal 10.2.0-2020.12.8) 10.2.0"

Additionally, when I removed the options for 32-bit, It worked well. But it didn't meet the requirement of this course.

❯ riscv64-unknown-elf-gcc -O3 test.c
❯ ls | grep a.out
a.out

BTW, the last snippet on this page which uses qemu-riscv32 is not compatible for macOS. It can be removed to avoid confusion.

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.