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.
Thanks to all who helped. Next is an attempt on GCC and then I guess I will drop this porting business for sometime and concentrate on my Os.
porting of binutils is over. porting of gcc is about to begin
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.
HardCoder wrote:The output is different from ld "-v" on my ubuntu
GNU ld (GNU Binutils for Ubuntu) 2.21.0.20110327
Virtually all Linux distributions employ customized / patched versions of common tools like binutils / GCC. One of the reasons (for me, at least) to use a cross-compiler even under Linux - I don't want to end up having relied on something distro-specific and being caught unaware by some system update. (The sources for the Cygwin binutils / GCC, for example, don't even compile when following our tutorial.)
Congratulations on going self-hosted. I believe it's the most important step in the history of any hobbyist OS - being capable to compile itself.
Some commercial operating systems weren't...
Every good solution is obvious once you've found it.
And finally I got my wish. SUCCESSFULLY PORTED GCC.
For anyone who wishes to port GCC, you must have to implement these functions apart from newlib essentials and binutils-essentials(see earlier post)
/* <dirent.h> includes <sys/dirent.h>, which is this file. On a
system which supports <dirent.h>, this file is overridden by
dirent.h in the libc/sys/.../sys directory. On a system which does
not support <dirent.h>, we will get this file which uses #error to force
an error. */
// as per unix dirstreams.h
struct __dirstream {
int fd;
};
typedef struct __dirstream DIR;
struct dirent {
ino_t d_ino ;// file serial number
char d_name[512];// name of entry
};
#ifdef __cplusplus
extern "C" {
#endif
int closedir(DIR *);
DIR *opendir(const char *);
struct dirent *readdir(DIR *);
int readdir_r(DIR *, struct dirent *, struct dirent **);
void rewinddir(DIR *);
void seekdir(DIR *, long int);
long int telldir(DIR *);
#ifdef __cplusplus
}
#endif
I feel very self-hosted.
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.