Hosted GCC Cross Compiler: Where is my linker script?

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
lambduh
Posts: 17
Joined: Thu May 23, 2024 8:41 am

Hosted GCC Cross Compiler: Where is my linker script?

Post by lambduh »

I've followed the Hosted GCC Cross-Compiler tutorial on the wiki. I have a working compiler for my operating system, but I have not told it what linker script to use. How do I configure the compiler so that it uses the linker script I wrote for my operating system?
Ringding
Posts: 10
Joined: Fri Nov 26, 2021 11:08 am

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by Ringding »

-Wl or -Xlinker gcc options applied to the -T (--script) linker option
lambduh
Posts: 17
Joined: Thu May 23, 2024 8:41 am

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by lambduh »

Ringding wrote: Wed Jul 24, 2024 11:45 pm -Wl or -Xlinker gcc options applied to the -T (--script) linker option
I don't understand what you're trying to say. I can use `-T` to set a linker script when I compile, but I want to be able to use the hosted compiler that I ported for my operating system without having to add switches to the command line.

edit: I realize now that might have been unclear in my original post. I can compile software with "m68k-lambda-gcc -T [...]", I would like to be able to run just "m68k-lambda-gcc", but it's trying to use a default linker script that I didn't write.
Ringding
Posts: 10
Joined: Fri Nov 26, 2021 11:08 am

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by Ringding »

Maybe you can create a script that invokes the linker with the desired options and reference it in --with-ld at gcc configure time.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by Octocontrabass »

I think this step is where you'd set up the default linker script for your toolchain.
lambduh
Posts: 17
Joined: Thu May 23, 2024 8:41 am

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by lambduh »

oh, I see, so instead of giving it a linker script, I give it configuration options and it generates linker scripts to my needs?
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: Hosted GCC Cross Compiler: Where is my linker script?

Post by Octocontrabass »

That's correct. It should have options for everything you need, unless you're doing something extremely weird.
Post Reply