Open jinmel opened 10 years ago
Hi jinmel,
Thanks for your patch! Could you please add your name and email into the README file? I'll take a look at you changes tomorrow.
Thanks & Best regards Jeremy
I added my contact :)
Cheers
Hi @jinmel I am trying to follow along and use your update, but I cannot seem to get the project to compile. I may be missing something obvious, here is what I did:
When I do so, I receive the following error message:
i386-elf-gcc -Wall -W -c -o squish-pty.o squish-pty.c
squish-pty.c:2:19: fatal error: errno.h: No such file or directory
#include <errno.h>
^
compilation terminated.
make: *** [squish-pty.o] Error 1
Any idea of how to fix the issue?
@wcdolphin
Sorry for late response. Those i386-elf-gcc from the homebrew tap does not include the library shared object files so squish-pty.c may fail. I successfully did this project without using squish-pty.
Hi @jinmel,
I was trying to build in the userprog directory for project2. But I am getting errors:
tests/lib.o: In function vmsg': /Users/guodongxu/Projects/pintos-mac/userprog/build/../../tests/lib.c:21: undefined reference to
snprintf'
/Users/guodongxu/Projects/pintos-mac/userprog/build/../../tests/lib.c:22: undefined reference to vsnprintf' /Users/guodongxu/Projects/pintos-mac/userprog/build/../../tests/lib.c:23: undefined reference to
strlcpy'
...
Have you run into this issue when you are building userprog?
Thanks Leon
Yes this happens because homebrew doesn't build the libc library for i386 architecture. The hotfix for this issue is to install a complete .dmg and make changes to makefile according to the gcc binary name. I am still working on this issue. If you are successful building all the libraries for i386 please contribute to https://github.com/sevki/homebrew-gcc_cross_compilers
Hi, on Yosemite , brew fails to install i386-elf-gcc.
checking for gcc... /usr/local/bin/gcc-4.2
checking for C compiler default output file name...
configure: error: in /private/tmp/i386-elf-binutils-RMvF46/binutils-2.23/build': configure: error: C compiler cannot create executables See
config.log' for more details.
couldn't understand kern.osversion `14.0.0'
I had the same issue as @ouceduxzk on Yosemite and managed to work around it by using a different fork of homebrew-gcc_cross_compilers
. This fork also requires gcc49
from homebrew/versions
.
brew untap jinmel/homebrew-gcc_cross_compilers
brew tap altkatz/homebrew-gcc_cross_compilers
brew install homebrew/versions/gcc49
brew unlink gcc
brew link gcc49
brew install i386-elf-gcc i386-elf-binutils
brew unlink binutils
brew link i386-elf-binutils
The linking and unlinking may be optional, it depends on what you had installed before. The whole process took ages for me, but that may just be my machine being slow.
The first project (threads
) compiled fine, but the other ones failed with a bunch of undefined references as mentioned above.
I've fixed the "undefined reference" errors (@guodongx, @jinmel) in https://github.com/jinmel/pintos_mac/pull/1, meaning that all the projects now build successfully on OS X Yosemite.
@DanielGibbsNZ thanks a lot, I am trying to do the OS 140 assignments in Mac. Thanks a lot for your work
when I run brew install i386-elf-gcc, I found this error. Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgold.a(workqueue-threads.o) has no symbols ranlib libgold.a Any idea of how to fix the issue? Thanks
Homebrew often conflicts with MacPorts, and it is a pain for homebrew users to install MacPorts just for this project. Homebrew is better maintained by active open source community
Instead of installing i386-elf-gcc using macports, I wrote formulas for gcc cross compiler to work with homebrew
Simulator was changed to QEMU since bochs is outdated and QEMU has faster performance(except for alarm clock tests)
I deleted other README contents of your original README because it's all on Pintos Documentation homepage