sheisc / ucc162.3 Goto Github PK
View Code? Open in Web Editor NEWA lightweight open-source C compiler for research and education.
A lightweight open-source C compiler for research and education.
make -C driver
make[1]: Entering directory /root/ucc/driver' gcc -m32 -o ucc -g ucc.c linux.c 在包含自 /usr/include/features.h:385 的文件中, 从 /usr/include/stdio.h:28, 从 ucc.c:1: /usr/include/gnu/stubs.h:7:27: 错误:gnu/stubs-32.h:没有那个文件或目录 在包含自 /usr/include/features.h:385 的文件中, 从 /usr/include/unistd.h:26, 从 linux.c:1: /usr/include/gnu/stubs.h:7:27: 错误:gnu/stubs-32.h:没有那个文件或目录 make[1]: *** [all] 错误 1 make[1]: Leaving directory
/root/ucc/driver'
make: *** [all] 错误 2
网上稍微查了一下需要安装 yum install glibc-devel
可是还是没有用,能不能告诉我啥原因啊
在Windows虚拟机下折腾了半天,都是按要求设置的,最后跑hello的时候显示memory exhausted;
在Linux下运行 make test 的时候报了一堆的错
我的gcc版本
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
在书(C 编译器剖析,邹昌伟)的第 23 页中第一次执行make -s test
时,报错内容如下:
[oxygen@****** ucc]$ make -s test
(exprchk.c,314):(output.c,70):warning:Too many arguments
(exprchk.c,314):(output.c,86):warning:Too many arguments
mv: cannot stat '/ucl': No such file or directory
make[1]: *** [Makefile:21: test] Error 1
make: *** [Makefile:25: test] Error 2
问题原因:多级 makefile 及参数传递问题,ucc/Makefile 文件中的变量 $(UCCDIR) 没有传递到 ucc/ucl/Makefile 中,导致报错。
解决办法:将 ucc/Makefile 文件的UCCDIR定义前加 export
正确的 ucc/Makefile 文件如下:
#UCCDIR = /home/iron/bin
cur_mkfile := $(abspath $(lastword $(MAKEFILE_LIST)))
export UCCDIR = $(patsubst %/, %, $(dir $(cur_mkfile)))/bin
修改后重新执行,结果如下
[oxygen@****** ucc]$ make -s test
(exprchk.c,314):(output.c,70):warning:Too many arguments
(exprchk.c,314):(output.c,86):warning:Too many arguments
(exprchk.c,314):(output.c,70):warning:Too many arguments
(exprchk.c,314):(output.c,86):warning:Too many arguments
1.打印当前Makefile的路径:
$(warning Makefile path: $(CURDIR)/$(lastword $(MAKEFILE_LIST)))
2.在控制台输出变量 $(UCCDIR)/ucl 的值
$(info $(UCCDIR)/ucl)
希望能帮助到有需要的人!
2年以前,我有一段时间研究了一下UCC这个编译器,当时是在SourceForge上面下载的源代码,发现项目没有再维护了。
这个编译器作为教学工具,可能具有一定意义。但是对于VS的依赖很重,比如汇编器用的是MASM(这个在VC++ 6.0中都不存在),链接器是用的VS的。在这个上面可能需要相应的修改,可以考虑JWASM的链接器。
hi,我把相关的代码放进了一个vs的工程里面https://github.com/k91191/uccVSTest 但是在调试过程却报了一大堆 “decl.cpp 1426):(C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdio.h,681):error:Expect (null)”之类的错误,是还需要设置什么吗?
大家好,最近我想做ucc编译器支持兆易risc-v单片机的工作,结果发现不容易,不知道大家有没有做成功的?
issue
issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.