Thread overview | |||||
---|---|---|---|---|---|
|
August 13, 2012 Link .s file with dmd? | ||||
---|---|---|---|---|
| ||||
Can i link an assembler file .s with dmd like gcc with "gcc out.s any.c -o out.exe"? If so, how? |
August 13, 2012 Re: Link .s file with dmd? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On Monday, 13 August 2012 at 22:06:08 UTC, Namespace wrote:
> Can i link an assembler file .s with dmd like gcc with "gcc out.s any.c -o out.exe"? If so, how?
.s, .c, .d files (source files), are not linked. What is linked, are object files (.obj or .o).
GCC either compiles the .s file to an object file, or passes it to assembler to do it - I don't know.
I think what you need to is to create an object file from the .s file and link it to your D executable.
To do it:
gcc out.s -c
The -c switch stops after compiling. It doesn't do the linking.
A .o file will be created, out.o
Then dmd your_source_file.d out.o
|
August 14, 2012 Re: Link .s file with dmd? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Minas Mina | > .s, .c, .d files (source files), are not linked. What is linked, are object files (.obj or .o).
>
> GCC either compiles the .s file to an object file, or passes it to assembler to do it - I don't know.
>
> I think what you need to is to create an object file from the .s file and link it to your D executable.
>
> To do it:
>
> gcc out.s -c
>
> The -c switch stops after compiling. It doesn't do the linking.
>
> A .o file will be created, out.o
>
> Then dmd your_source_file.d out.o
Ah ok, thanks.
|
Copyright © 1999-2021 by the D Language Foundation