binutils/gcc destination directories

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.
Post Reply
User avatar
Satoshi
Member
Member
Posts: 28
Joined: Thu Sep 13, 2012 2:18 pm

binutils/gcc destination directories

Post by Satoshi »

Hi, could anyone explain me some things about cross compiling binutils/gcc?
This is file structure of my output file. http://pastebin.com/Kk5sDgWQ
../Output/x86_64 is my sysroot.

And my question is why are there so much directories and how can I change them to simple structure like
System
|-Binary
|-Include
|-C #include for C/C++
|-Library


This is my full tree output http://pastebin.com/N29GVKR3

Why are there multiple files?
First in usr/bin/x86_64-unknown-trinix-***
And second one in usr/x86_64-unknown-trinix/bin/***


Thanks
Trinix (written in D) https://github.com/Rikarin/Trinix
Streaming OS development https://www.livecoding.tv/satoshi/
User avatar
KemyLand
Member
Member
Posts: 213
Joined: Mon Jun 16, 2014 5:33 pm
Location: Costa Rica

Re: binutils/gcc destination directories

Post by KemyLand »

When you made your OS-Specific toolchain, you supplied a sysroot. This makes the compiler think that ../Output/x86_64 is equal to /. So what happens? Stuff is dropped in /usr or /usr/local by default when make installing. See your (real) /usr/bin, can you find gcc? Yes, it's there! That's what's happening here. Your binaries are dropped inside ../Output/x86_64/usr/bin. You can't reorganize it as you please. If you want to use a simple name for your OS-Specific GCC, just add that folder to your $PATH :wink: .

Edit: Those extra files are normal. All GNU-related software tends to use heavy use of symlinks. Remember that when you run gcc in your terminal, you're only calling a symlink, probably to x86_64-linux-gnu-gcc. It turns out that this binary is just a driver for cc1. You may think of it as something infamous, as it's name tends to appear altogether with errors, but it's the real GNU C Compiler. Other utilities are cpp (preprocessor), ld (linker), ar (archiver), etc...
Happy New Code!
Hello World in Brainfuck :D:

Code: Select all

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
[/size]
User avatar
Satoshi
Member
Member
Posts: 28
Joined: Thu Sep 13, 2012 2:18 pm

Re: binutils/gcc destination directories

Post by Satoshi »

But i wanna port binutils/gcc to my OS and dont wanna use standard POSIX directory names/structure. I found this

Code: Select all

/* Standard include directory. */
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR "/include"
but in gcc 4.9.2 its poisoned.
Trinix (written in D) https://github.com/Rikarin/Trinix
Streaming OS development https://www.livecoding.tv/satoshi/
Post Reply