Page 1 of 1
Hosted GCC Cross Compiler: Where is my linker script?
Posted: Wed Jul 24, 2024 3:57 pm
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?
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Wed Jul 24, 2024 11:45 pm
by Ringding
-Wl or -Xlinker gcc options applied to the -T (--script) linker option
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Thu Jul 25, 2024 8:11 am
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.
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Thu Jul 25, 2024 1:25 pm
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.
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Thu Jul 25, 2024 10:05 pm
by Octocontrabass
I think
this step is where you'd set up the default linker script for your toolchain.
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Sun Jul 28, 2024 1:22 pm
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?
Re: Hosted GCC Cross Compiler: Where is my linker script?
Posted: Mon Jul 29, 2024 11:51 am
by Octocontrabass
That's correct. It should have options for everything you need, unless you're doing something extremely weird.