Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag> </module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
This would require a semi-major feature addition to rbuild, but shouldn't be too difficult.
Here's an idea of how we could do it that would give some flexibility:
<linkerflag>-Wl,-T,%lowalign.path.src%/ldscript</linkerflag>
and you could also do this (referring to the current module):
<linkerflag>-Wl,-T,%module.path.src%/ldscript</linkerflag>
Here's another way to do it that would be more consistent with the current design:
<linkerfile base="lowalign" prefix="-Wl,-T," postfix="">ldscript</linkerfile>
Thoughts anyone?
Hartmut Birr wrote:
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag>
</module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
.
option 3:
<file linkfile="true" linkprefix="-Wl,-T," linkpostfix="">ldscript</file>
Royce Mitchell III wrote:
This would require a semi-major feature addition to rbuild, but shouldn't be too difficult.
Here's an idea of how we could do it that would give some flexibility:
<linkerflag>-Wl,-T,%lowalign.path.src%/ldscript</linkerflag>
and you could also do this (referring to the current module):
<linkerflag>-Wl,-T,%module.path.src%/ldscript</linkerflag>
Here's another way to do it that would be more consistent with the current design:
<linkerfile base="lowalign" prefix="-Wl,-T," postfix="">ldscript</linkerfile>
Thoughts anyone?
Hartmut Birr wrote:
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag>
</module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
.
Why not use XML tags:
<linkerflag>-Wl,-T,<lowalign/>/ldscript</linkerflag>
or
<linkerflag>-Wl,-T,<variable id="lowalign"/>/ldscript</linkerflag>
Maarten Bosma
Royce Mitchell III wrote:
This would require a semi-major feature addition to rbuild, but shouldn't be too difficult.
Here's an idea of how we could do it that would give some flexibility:
<linkerflag>-Wl,-T,%lowalign.path.src%/ldscript</linkerflag>
and you could also do this (referring to the current module):
<linkerflag>-Wl,-T,%module.path.src%/ldscript</linkerflag>
Here's another way to do it that would be more consistent with the current design:
<linkerfile base="lowalign" prefix="-Wl,-T," postfix="">ldscript</linkerfile>
Thoughts anyone?
That is not valid XML.
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Maarten Bosma Sent: 23. oktober 2005 09:12 To: ReactOS Development List Subject: Re: [ros-dev] rbuild question
Why not use XML tags:
<linkerflag>-Wl,-T,<lowalign/>/ldscript</linkerflag>
or
<linkerflag>-Wl,-T,<variable id="lowalign"/>/ldscript</linkerflag>
Maarten Bosma
Royce Mitchell III wrote:
Maarten Bosma wrote:
Why not use XML tags:
<linkerflag>-Wl,-T,<lowalign/>/ldscript</linkerflag>
or
<linkerflag>-Wl,-T,<variable id="lowalign"/>/ldscript</linkerflag>
not possible - that's not valid xml
Yes, Casper told me that too but why ? If you mean because of the slash that your code is not vaild, too.
<linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag>
Maarten Bosma
<linkerflag> is a hack to fix some peculiarities of mingw. It should go away eventually so we shouldn't add more code which depend on it.
<linkerfile base="lowalign">ldscript</linkerfile>
is enough because the MinGW rbuild backend can add the rest of the information. Maybe:
<linkerscript base="lowalign">ldscript</linkerscript>
since it makes it more clear that it is a linker script.
Casper
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Royce Mitchell III Sent: 23. oktober 2005 02:31 To: ReactOS Development List Subject: Re: [ros-dev] rbuild question
This would require a semi-major feature addition to rbuild, but shouldn't be too difficult.
Here's an idea of how we could do it that would give some flexibility:
<linkerflag>-Wl,-T,%lowalign.path.src%/ldscript</linkerflag>
and you could also do this (referring to the current module):
<linkerflag>-Wl,-T,%module.path.src%/ldscript</linkerflag>
Here's another way to do it that would be more consistent with the current design:
<linkerfile base="lowalign" prefix="-Wl,-T," postfix="">ldscript</linkerfile>
Thoughts anyone?
Hartmut Birr wrote:
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag>
</module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Casper Hornstrup wrote:
<linkerflag> is a hack to fix some peculiarities of mingw. It should go away eventually so we shouldn't add more code which depend on it.
<linkerfile base="lowalign">ldscript</linkerfile>
is enough because the MinGW rbuild backend can add the rest of the information. Maybe:
<linkerscript base="lowalign">ldscript</linkerscript>
since it makes it more clear that it is a linker script.
Casper
I would prefer something like this:
<linkerscript>ldscript</linkerscript>
- Hartmut
Hartmut Birr wrote:
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag>
</module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
It's a bit off-topic, but why do you need a linker script for making low alignment executables? I fixed the default binutils script quite some time ago to work with alignment < PAGE_SIZE.
- Filip
Filip Navara wrote:
Hartmut Birr wrote:
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag>
</module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
It's a bit off-topic, but why do you need a linker script for making low alignment executables? I fixed the default binutils script quite some time ago to work with alignment < PAGE_SIZE.
- Filip
I've used your lowalign example. Without the linker script, the image isn't executable on WinXP. I'm using gcc 3.4.2 and binutils 2.16.91.
- Hartmut
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Hartmut Birr Sent: 22. oktober 2005 16:45 To: ReactOS Development List Subject: [ros-dev] rbuild question
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag> </module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Implemented in r18758. Use like:
<linkerscript base="lowalign">ldscript</linkerscript>
Casper
Casper Hornstrup wrote:
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Hartmut Birr Sent: 22. oktober 2005 16:45 To: ReactOS Development List Subject: [ros-dev] rbuild question
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag> </module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Implemented in r18758. Use like:
<linkerscript base="lowalign">ldscript</linkerscript>
Casper
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Hi,
I've some problems with your implementation. With the original xml file I get the following cmd line:
gcc -Wl,--subsystem,console -Wl,--entry,_mainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -o .\up\output-i386\modules\myapps\lowalign\lowalign.exe .\up\obj-i386\modules\myapps\lowalign\lowalign.o .\up\obj-i386\lib\ntdll\libntdll.a -Wl,-T,modules/myapps/lowalign/ldscript -Wl,--file-alignment=0x80 -Wl,--section-alignment=0x80 -g
With the new syntax, I get the following error:
gcc -Wl,--subsystem,console -Wl,--entry,_mainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -o -Wl,-T,modules\myapps\lowalign\ldscript .\up\output-i386\modules\myapps\lowalign\lowalign.exe .\up\obj-i386\modules\myapps\lowalign\lowalign.o .\up\obj-i386\lib\ntdll\libntdll.a -Wl,--file-alignment=0x80 -Wl,--section-alignment=0x80 -g e:\mingw\bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: cannot open output file -Wl,-T,modules\myapps\lowalign\ldscript.exe: No such file or directory collect2: ld returned 1 exit status _make: *** [.\up\output-i386\modules\myapps\lowalign\lowalign.exe] Error 1
The problem is, that '-Wl,-T,modules\myapps\lowalign\ldscript' is inserted between '-o' and '.\up\output-i386\modules\myapps\lowalign\lowalign.exe'.
- Hartmut
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Hartmut Birr Sent: 24. oktober 2005 22:43 To: ReactOS Development List Subject: Re: [ros-dev] rbuild question
Casper Hornstrup wrote:
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Hartmut Birr Sent: 22. oktober 2005 16:45 To: ReactOS Development List Subject: [ros-dev] rbuild question
Hi,
for a sample program, I have to specify a linker script file. I'm using the following xml-file:
<module name="lowalign" type="win32cui" installbase="bin" installname="lowalign.exe"> <include base="lowalign">.</include> <define name="__USE_W32API" /> <file>lowalign.c</file> <linkerflag>-Wl,-T,modules/myapps/lowalign/ldscript</linkerflag> <linkerflag>-Wl,--file-alignment=0x80</linkerflag> <linkerflag>-Wl,--section-alignment=0x80</linkerflag> </module>
I would like it if I can remove the absolute path from the linker script file. Any ideas?
- Hartmut
Implemented in r18758. Use like:
<linkerscript base="lowalign">ldscript</linkerscript>
Casper
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Hi,
I've some problems with your implementation. With the original xml file I get the following cmd line:
gcc -Wl,--subsystem,console -Wl,--entry,_mainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file- alignment,0x1000 -Wl,--section-alignment,0x1000 -o .\up\output-i386\modules\myapps\lowalign\lowalign.exe .\up\obj-i386\modules\myapps\lowalign\lowalign.o .\up\obj-i386\lib\ntdll\libntdll.a -Wl,-T,modules/myapps/lowalign/ldscript -Wl,--file-alignment=0x80 -Wl,--section-alignment=0x80 -g
With the new syntax, I get the following error:
gcc -Wl,--subsystem,console -Wl,--entry,_mainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file- alignment,0x1000 -Wl,--section-alignment,0x1000 -o -Wl,-T,modules\myapps\lowalign\ldscript .\up\output-i386\modules\myapps\lowalign\lowalign.exe .\up\obj- i386\modules\myapps\lowalign\lowalign.o .\up\obj-i386\lib\ntdll\libntdll.a -Wl,--file-alignment=0x80 -Wl,--section-alignment=0x80 -g e:\mingw\bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: cannot open output file -Wl,-T,modules\myapps\lowalign\ldscript.exe: No such file or directory collect2: ld returned 1 exit status _make: *** [.\up\output-i386\modules\myapps\lowalign\lowalign.exe] Error 1
The problem is, that '-Wl,-T,modules\myapps\lowalign\ldscript' is inserted between '-o' and '.\up\output-i386\modules\myapps\lowalign\lowalign.exe'.
- Hartmut
Yes, that was a bit buggy ;-( Try HEAD.
Casper