Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Please bear with me. I am really thrilled in seeing my Os self hosted. So after having newlib ported and gcc recompiled and porting nasm to my Os. I am now trying to port binutils. As always it simply wont finish compiling .
This time I tried to compile my binutils with this.
more undefined reference follow. Seeing as it is the linker error. I guess that many build-system libraries being dragged along. Can it be the problem. If so how do I avoid it. I tried editing the makefile many times trying to hardcode the ld location etc but to no success.
Anyone ever had experience with this problem? Also it works if I try to make a cross compiler with the build-system's gcc.
Even the smallest person could change the course of the future- Lord Of The Rings.
In the end all that matters is what you have done- Alexander.
Even after a decade oh god those still gives me the shivers.
I have implemented all the 18 or 20 such stub functions before porting. Is there still functions to be written.. Could you please give more info on it.
Even the smallest person could change the course of the future- Lord Of The Rings.
In the end all that matters is what you have done- Alexander.
Even after a decade oh god those still gives me the shivers.
Or perhaps his libc does implement fcntl, and binutils just doesn't find the lib?
A quick check of ./configure --help turned up --with-stage1-libs, --with-boot-libs, and --with-build-sysroot as candidates for further investigation...
Every good solution is obvious once you've found it.
Solar wrote:Or perhaps his libc does implement fcntl, and binutils just doesn't find the lib?
Wouldn't it complain that it can't find the library file then?
If it isn't told to look for it? I don't see explicit mention of a libc on the command line before the error, and I honestly don't know how GCC / binutils behave in this specific constellation.
Every good solution is obvious once you've found it.
HardCoder wrote:I have implemented all the 18 or 20 such stub functions before porting. Is there still functions to be written.. Could you please give more info on it.
You probably need to implement some more functions. I've implemented enough to compile dash and here's a slightly out of date list that I needed for that. You will need to implement fcntl. The probable reason it's not listed as a stub is that none of the standard clib functions sits on top of it.
After implementing the five functions that binutils referred to as undefined namely fcntl, umask, chmod, access, lstat and adding it to the libc.a(removing the old syscall.o) using ar utility, now it says mutliple defenitions in libc.a and libg.a of almost all the functions I have implemented. Seeing it as a debugging enabled libc, I copied the libc.a to libg.a (because someone told iibc.a also comes with debugging info).
Anyways now the multiple defenitions error vanished only to be replaced with a new one called "implicit declaration of function utime and lstat". Knowing it as the old and frequent gcc message which appears when you havent declared the prototype, I checked the file in which this error occurs named "binutils-2.21/binutils/rename.c". It clearly had #include <sys/stat.h> wherein the prototype for lstat is declared. but following the "#include <utime.h>", function utime is not declared. Well the latter makes sense since I cant see it declared. But lstat was implemented by me in syscalls.o and inserted to libc.a using ar utility. The implicit error to lstat just doesnt make sense. Also I couldnt find utime in the list provided by gerryg400. Is it something I should implement Any help would be much appreciated.
EDIT: I also noticed that the functions "access" and "chmod" were not in the list provided by gerryg400. But I implemented them in syscalls.c. Can it contribute to the problem
EDIT: After removing those "access" and "chmod" compiling returns undefined references. So that proves they are valid inside syscalls.c and not provided by newlib. So 2 more in gerryg400's list.
EDIT: @gerryg500 : which version of binutils did you port to your Os hoping that I maybe relieved of this mess if I use that version.
Even the smallest person could change the course of the future- Lord Of The Rings.
In the end all that matters is what you have done- Alexander.
Even after a decade oh god those still gives me the shivers.
My list is not exhaustive, it's simply a list of functions I had to add to make a single program (dash shell) compile. I'm adding new functions every day. In fact I've added so many functions myself that I've considered dropping newlib completely.
In Linux both access and chmod are kernel calls and so it's not surprising that they don't exist.
There will be many others.
If a trainstation is where trains stop, what is a workstation ?
I finally managed to get binutils to successfully "configure" and "make all" after implementing these additional syscalls apart from newlibs 19 essential syscalls.
libtool: install: chmod 644 /home/HardCoder/Downloads/binutils/final/lib/libbfd.a
libtool: install: i586-elf-ranlib /home/HardCoder/Downloads/binutils/final/lib/libbfd.a
./libtool: line 1115: i586-elf-ranlib: command not found
make[5]: *** [install-bfdlibLTLIBRARIES] Error 127
I reckon my old problem. Must have to hardcode the path somewhere. This has happened to me before. Can anyone point out why it works when i586-elf-ranlib is entered into the terminal. But make cannot find it or in this case libtool in make.
Even the smallest person could change the course of the future- Lord Of The Rings.
In the end all that matters is what you have done- Alexander.
Even after a decade oh god those still gives me the shivers.
Hoooray ,
I got it worked. Had to hardcode the path of i586-elf-ranlib in
build-binutils/binutils/libtool
build-binutils/bfd/libtool
build-binutils/opcodes/libtool
here is a screenshot of ld with "-v" as arguement.
The output is different from ld "-v" on my ubuntu
GNU ld (GNU Binutils for Ubuntu) 2.21.0.20110327
---- But actually who cares..
Even the smallest person could change the course of the future- Lord Of The Rings.
In the end all that matters is what you have done- Alexander.
Even after a decade oh god those still gives me the shivers.