Page 1 of 1

Asking for suggestions

Posted: Tue Oct 25, 2005 8:09 pm
by xiaofeng
I develope my mini os using DJGPP on windows.
When i input command line"ld -T link.ld -o kernel.bin start.o main.o .....(16 .o files in total)",it tells me "System can't execute the specific program".I also try on Cygwin,which tells
me "Invalid argument".
Please give me some suggestions to make me continue my work.

Re:Asking for suggestions

Posted: Wed Oct 26, 2005 12:33 am
by AR
You may have exceeded the maximum commandline length, to get around it you'll need to use the archive tool (ar) to combine the packages or use a 32bit compiler which will have a longer commandline.

Re:Asking for suggestions

Posted: Wed Oct 26, 2005 2:53 am
by Pype.Clicker
do you call cygwin's linker from DOS command line ? or from cygwin's shell ?

Either you actually have one of your .o files that has wrong format, or your command line is too long -- for the shell, not for LD which could happily handle dozens more of files. You can indeed use AR to pack .o files together, or you can just use "ld ... *.o", then making explicit reference to "start.ko" in your linker script to make sure it bypasses the completion's ordering ...

Re:Asking for suggestions

Posted: Wed Oct 26, 2005 3:26 am
by AR
DOS Program's commandline (ie. DJGPP) have a 127 character limit whereas a 32bit build (Cygwin, MinGW, cross-compiler, etc) has a limit of about 32767 characters.

Re:Asking for suggestions

Posted: Wed Oct 26, 2005 3:28 am
by Pype.Clicker
AR wrote: DOS Program's commandline (ie. DJGPP) have a 127 character limit whereas a 32bit build (Cygwin, MinGW, cross-compiler, etc) has a limit of about 32767 characters.
Yeah, true, yet he mentions "invalid argument" reported by cygwin ...

Re:Asking for suggestions

Posted: Wed Oct 26, 2005 6:53 am
by xiaofeng
Thanks very much!
I also resolved it several hours ago.I write a Makefile,and use the make tool of Djgpp.This method can bypass the length limit of Dos command line.