delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2009/01/28/18:45:04

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Jim Michaels <jmichae3 AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: linking the hard way
Date: Wed, 28 Jan 2009 15:31:07 -0800 (PST)
Organization: http://groups.google.com
Lines: 55
Message-ID: <98aac42e-1698-4f3c-a154-4a430c8d8a6e@i18g2000prf.googlegroups.com>
NNTP-Posting-Host: 76.115.70.155
Mime-Version: 1.0
X-Trace: posting.google.com 1233185467 31857 127.0.0.1 (28 Jan 2009 23:31:07 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Wed, 28 Jan 2009 23:31:07 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: i18g2000prf.googlegroups.com; posting-host=76.115.70.155;
posting-account=05hOMwoAAAB6R8xtiQKzEljSMzgOhVF1
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5)
Gecko/2008120122 Firefox/3.0.5,gzip(gfe),gzip(gfe)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I am having problems trying to link many object files together because
of long command lines that gpp won't accept.  I have several
questions:
1. will there be support for response files?  is there support for
response files already in the linker (ld)?  by response files I mean a
file that lists arguments you would normally have on the command-line.
2. in order to make an executeable that I can use with exe2coff and
cwsdstub.exe, I assume I need some sort of crt0.o, but I find several
such as gcrt0.o and libc.a.  which one(s) do I link in and what are
they for?


I am getting a ton of undefined reference errors about things related
to the C runtime and my own stuff.




Here is my makefile.  (I probably didn't need "all" rule)
--------------------------------------------------
all: wipegui.exe

wipegui.exe: wipegui.o mbrprint.o diskwipe.o ratldisk.o kbin.o
consout.o printmbr.o
	ld -o$a.exe f:/djc/lib/crt0.o $^
	exe2coff a.exe
	cmd /c copy /b f:\djgpp\v2misc\bin\cwsdstub.exe+a a2.exe
	rm a.exe a
	mv a2.exe wipegui.exe

printmbr.o: ..\printmbr.cpp
	gpp -O3 -c -s -fpack-struct ..\printmbr.cpp -o printmbr.o

consout.o: ..\consout.cpp
	gpp -O3 -c -s -fpack-struct ..\consout.cpp -o consout.o

kbin.o: ..\kbin.cpp
	gpp -O3 -c -s -fpack-struct ..\kbin.cpp -o kbin.o

ratldisk.o: ratldisk.cpp
	gpp -O3 -c -s -fpack-struct ratldisk.cpp -o ratldisk.o

diskwipe.o: diskwipe.cpp
	gpp -O3 -c -s -fpack-struct diskwipe.cpp -o diskwipe.o

mbrprint.o: mbrprint.cpp
	gpp -O3 -c -s -fpack-struct mbrprint.cpp -o mbrprint.o

biosdsk2.o: biosdsk2.cc
	gpp -O3 -c -s -fpack-struct biosdsk2.cc -o biosdsk2.o

wipegui.o: wipegui.cpp
	gpp -O3 -c -s -fpack-struct wipegui.cpp -o wipegui.o
---------------------------------------------------------------------------------------
Jim Michaels

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019