link.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. {
  2. $Id$
  3. Copyright (c) 1998 by the FPC development team
  4. This unit handles the linker and binder calls for programs and
  5. libraries
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. Unit link;
  20. Interface
  21. uses cobjects,files;
  22. Type
  23. TLinker = Object
  24. Glibc2,
  25. Glibc21,
  26. LinkToC, { Should we link to the C libs? }
  27. Strip : Boolean; { Strip symbols ? }
  28. ObjectFiles,
  29. SharedLibFiles,
  30. StaticLibFiles : TStringContainer;
  31. LibrarySearchPath, { Search path for libraries }
  32. LinkOptions : string; { Additional options to the linker }
  33. DynamicLinker : String[80]; { What Dynamic linker ? }
  34. LinkResName : String[32]; { Name of response file }
  35. { Methods }
  36. Constructor Init;
  37. Destructor Done;
  38. procedure AddModuleFiles(hp:pmodule);
  39. function FindObjectFile(s : string) : string;
  40. function FindLibraryFile(s:string;const ext:string) : string;
  41. Procedure AddObject(const S : String);
  42. Procedure AddStaticLibrary(const S : String);
  43. Procedure AddSharedLibrary(S : String);
  44. Function FindLinker:String; { Find linker, sets Name }
  45. Function DoExec(const command,para:string;info,useshell:boolean):boolean;
  46. Function WriteResponseFile:Boolean;
  47. Function MakeExecutable:boolean;
  48. Procedure MakeStaticLibrary(filescnt:longint);
  49. Procedure MakeSharedLibrary;
  50. end;
  51. PLinker=^TLinker;
  52. Var
  53. Linker : TLinker;
  54. Implementation
  55. uses
  56. {$ifdef Delphi}
  57. dmisc,
  58. {$endif Delphi}
  59. globtype,systems,
  60. script,globals,verbose
  61. {$ifdef i386}
  62. ,win_targ
  63. {$endif}
  64. {$ifdef linux}
  65. ,linux
  66. {$endif}
  67. ,dos
  68. ;
  69. {$ifndef linux}
  70. Procedure Shell(command:string);
  71. { This is already defined in the linux.ppu for linux, need for the *
  72. expansion under linux }
  73. var
  74. comspec : string;
  75. begin
  76. comspec:=getenv('COMSPEC');
  77. Exec(comspec,' /C '+command);
  78. end;
  79. {$endif}
  80. Constructor TLinker.Init;
  81. begin
  82. ObjectFiles.Init_no_double;
  83. SharedLibFiles.Init_no_double;
  84. StaticLibFiles.Init_no_double;
  85. LinkToC:=False;
  86. Glibc2:=false;
  87. Glibc21:=false;
  88. Strip:=false;
  89. LinkOptions:='';
  90. {$ifdef linux}
  91. { first try glibc2 }
  92. DynamicLinker:='/lib/ld-linux.so.2';
  93. if FileExists(DynamicLinker) then
  94. begin
  95. Glibc2:=true;
  96. { also glibc 2.1 / 2.1.1 ? }
  97. if FileExists('/lib/ld-2.1.so') or
  98. FileExists('/lib/ld-2.1.1.so') then
  99. Glibc21:=true;
  100. end
  101. else
  102. DynamicLinker:='/lib/ld-linux.so.1';
  103. LibrarySearchPath:='/lib;/usr/lib;/usr/X11R6/lib';
  104. {$else}
  105. DynamicLinker:='';
  106. LibrarySearchPath:='';
  107. {$endif}
  108. LinkResName:='link.res';
  109. end;
  110. Destructor TLinker.Done;
  111. begin
  112. ObjectFiles.Done;
  113. SharedLibFiles.Done;
  114. StaticLibFiles.Done;
  115. end;
  116. procedure TLinker.AddModuleFiles(hp:pmodule);
  117. begin
  118. with hp^ do
  119. begin
  120. while not linkunitfiles.empty do
  121. AddObject(linkunitfiles.Get);
  122. while not linkofiles.empty do
  123. AddObject(linkofiles.Get);
  124. while not linksharedlibs.empty do
  125. AddSharedLibrary(linksharedlibs.Get);
  126. while not linkstaticlibs.empty do
  127. AddStaticLibrary(linkstaticlibs.Get);
  128. end;
  129. end;
  130. var
  131. LastLDBin : string;
  132. Function TLinker.FindLinker:string;
  133. var
  134. ldfound : boolean;
  135. begin
  136. if LastLDBin='' then
  137. begin
  138. if utilsdirectory<>'' then
  139. begin
  140. LastLDBin:=Search(target_link.linkbin+source_os.exeext,
  141. utilsdirectory,ldfound)+target_link.linkbin+source_os.exeext;
  142. end
  143. else
  144. LastLDBin:=FindExe(target_link.linkbin,ldfound);
  145. if (not ldfound) and not(cs_link_extern in aktglobalswitches) then
  146. begin
  147. Message1(exec_w_linker_not_found,LastLDBin);
  148. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  149. end;
  150. if ldfound then
  151. Message1(exec_t_using_linker,LastLDBin);
  152. end;
  153. FindLinker:=LastLDBin;
  154. end;
  155. { searches an object file }
  156. function TLinker.FindObjectFile(s:string) : string;
  157. var
  158. found : boolean;
  159. begin
  160. if pos('.',s)=0 then
  161. s:=s+target_info.objext;
  162. s:=FixFileName(s);
  163. if FileExists(s) then
  164. begin
  165. Findobjectfile:=s;
  166. exit;
  167. end;
  168. { find object file
  169. 1. cwd
  170. 2. unit search path
  171. 3. local object path
  172. 4. global object path
  173. 5. exepath }
  174. found:=false;
  175. findobjectfile:=search(s,'.',found)+s;
  176. if (not found) then
  177. findobjectfile:=search(s,unitsearchpath,found)+s;
  178. if (not found) and assigned(current_module^.localobjectsearchpath) then
  179. findobjectfile:=search(s,current_module^.localobjectsearchpath^,found)+s;
  180. if (not found) then
  181. findobjectfile:=search(s,objectsearchpath,found)+s;
  182. if (not found) then
  183. findobjectfile:=search(s,exepath,found)+s;
  184. if not(cs_link_extern in aktglobalswitches) and (not found) then
  185. Message1(exec_w_objfile_not_found,s);
  186. end;
  187. { searches an library file }
  188. function TLinker.FindLibraryFile(s:string;const ext:string) : string;
  189. var
  190. found : boolean;
  191. begin
  192. if pos('.',s)=0 then
  193. s:=s+ext;
  194. if FileExists(s) then
  195. begin
  196. FindLibraryFile:=s;
  197. exit;
  198. end;
  199. { find libary
  200. 1. cwd
  201. 2. local libary dir
  202. 3. global libary dir
  203. 4. exe path of the compiler }
  204. found:=false;
  205. findlibraryfile:=search(s,'.',found)+s;
  206. if (not found) and assigned(current_module^.locallibrarysearchpath) then
  207. findlibraryfile:=search(s,current_module^.locallibrarysearchpath^,found)+s;
  208. if (not found) then
  209. findlibraryfile:=search(s,librarysearchpath,found)+s;
  210. if (not found) then
  211. findlibraryfile:=search(s,exepath,found)+s;
  212. if not(cs_link_extern in aktglobalswitches) and (not found) then
  213. Message1(exec_w_libfile_not_found,s);
  214. end;
  215. Procedure TLinker.AddObject(const S : String);
  216. begin
  217. ObjectFiles.Insert(FindObjectFile(s));
  218. end;
  219. Procedure TLinker.AddSharedLibrary(S:String);
  220. begin
  221. { remove prefix 'lib' }
  222. if Copy(s,1,length(target_os.libprefix))=target_os.libprefix then
  223. Delete(s,1,length(target_os.libprefix));
  224. { remove extension if any }
  225. if Copy(s,length(s)-length(target_os.sharedlibext)+1,length(target_os.sharedlibext))=target_os.sharedlibext then
  226. Delete(s,length(s)-length(target_os.sharedlibext)+1,length(target_os.sharedlibext)+1);
  227. { ready to be inserted }
  228. SharedLibFiles.Insert (S);
  229. end;
  230. Procedure TLinker.AddStaticLibrary(const S:String);
  231. begin
  232. StaticLibFiles.Insert(FindLibraryFile(s,target_os.staticlibext));
  233. end;
  234. Function TLinker.DoExec(const command,para:string;info,useshell:boolean):boolean;
  235. begin
  236. DoExec:=true;
  237. if not(cs_link_extern in aktglobalswitches) then
  238. begin
  239. swapvectors;
  240. if useshell then
  241. shell(command+' '+para)
  242. else
  243. exec(command,para);
  244. swapvectors;
  245. if (doserror<>0) then
  246. begin
  247. Message(exec_w_cant_call_linker);
  248. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  249. DoExec:=false;
  250. end
  251. else
  252. if (dosexitcode<>0) then
  253. begin
  254. Message(exec_w_error_while_linking);
  255. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  256. DoExec:=false;
  257. end;
  258. end;
  259. { Update asmres when externmode is set }
  260. if cs_link_extern in aktglobalswitches then
  261. begin
  262. if info then
  263. AsmRes.AddLinkCommand(Command,Para,current_module^.exefilename^)
  264. else
  265. AsmRes.AddLinkCommand(Command,Para,'');
  266. end;
  267. end;
  268. Function TLinker.WriteResponseFile : Boolean;
  269. Var
  270. LinkResponse : Text;
  271. i : longint;
  272. cprtobj,
  273. gprtobj,
  274. prtobj : string[80];
  275. s,s2 : string;
  276. found,linux_link_c,
  277. linklibc : boolean;
  278. procedure WriteRes(const s:string);
  279. begin
  280. if s<>'' then
  281. WriteLn(Linkresponse,s);
  282. end;
  283. procedure WriteResFileName(const s:string);
  284. begin
  285. if s<>'' then
  286. begin
  287. if not(s[1] in ['a'..'z','A'..'Z','/','\','.']) then
  288. Write(Linkresponse,'.',DirSep);
  289. WriteLn(Linkresponse,s);
  290. end;
  291. end;
  292. begin
  293. WriteResponseFile:=False;
  294. linux_link_c:=false;
  295. { set special options for some targets }
  296. linklibc:=SharedLibFiles.Find('c');
  297. prtobj:='prt0';
  298. cprtobj:='cprt0';
  299. gprtobj:='gprt0';
  300. if glibc21 then
  301. begin
  302. cprtobj:='cprt21';
  303. gprtobj:='gprt21';
  304. end;
  305. case target_info.target of
  306. target_m68k_Palmos,
  307. target_i386_Win32 :
  308. begin
  309. if DLLsource then
  310. prtobj:='wdllprt0'
  311. else
  312. prtobj:='wprt0';
  313. end;
  314. target_m68k_linux,
  315. target_i386_linux :
  316. begin
  317. if cs_profile in aktmoduleswitches then
  318. begin
  319. prtobj:=gprtobj;
  320. if not glibc2 then
  321. AddSharedLibrary('gmon');
  322. AddSharedLibrary('c');
  323. linklibc:=true;
  324. end
  325. else
  326. begin
  327. if linklibc then
  328. prtobj:=cprtobj;
  329. end;
  330. if linklibc then
  331. linux_link_c:=true;
  332. end;
  333. end;
  334. { Fix command line options }
  335. If not SharedLibFiles.Empty then
  336. LinkOptions:='-dynamic-linker='+DynamicLinker+' '+LinkOptions;
  337. if Strip and not(cs_debuginfo in aktmoduleswitches) and
  338. not (Target_Link.StripBind) then
  339. LinkOptions:=LinkOptions+' '+target_link.stripopt;
  340. { Open linkresponse and write header }
  341. assign(linkresponse,current_module^.outpath^+LinkResName);
  342. {$I-}
  343. rewrite(linkresponse);
  344. {$I+}
  345. if ioresult<>0 then
  346. exit;
  347. { Write library searchpath }
  348. if assigned(current_module^.locallibrarysearchpath) then
  349. begin
  350. S2:=current_module^.locallibrarysearchpath^;
  351. Repeat
  352. i:=Pos(';',S2);
  353. If i=0 then
  354. i:=255;
  355. S:=Copy(S2,1,i-1);
  356. If S<>'' then
  357. WriteRes(target_link.libpathprefix+s+target_link.libpathsuffix);
  358. Delete (S2,1,i);
  359. until S2='';
  360. end;
  361. S2:=LibrarySearchPath;
  362. Repeat
  363. i:=Pos(';',S2);
  364. If i=0 then
  365. i:=255;
  366. S:=Copy(S2,1,i-1);
  367. If S<>'' then
  368. WriteRes(target_link.libpathprefix+s+target_link.libpathsuffix);
  369. Delete (S2,1,i);
  370. until S2='';
  371. WriteRes(target_link.inputstart);
  372. { add objectfiles, start with prt0 always }
  373. if prtobj<>'' then
  374. WriteResFileName(FindObjectFile(prtobj));
  375. { try to add crti and crtbegin, they are normally not required, but
  376. adding can sometimes be usefull }
  377. if linux_link_c then
  378. begin
  379. s:=search('crtbegin.o',librarysearchpath,found)+'crtbegin.o';
  380. if found then
  381. WriteResFileName(s);
  382. s:=search('crti.o',librarysearchpath,found)+'crti.o';
  383. if found then
  384. WriteResFileName(s);
  385. end;
  386. while not ObjectFiles.Empty do
  387. begin
  388. s:=ObjectFiles.Get;
  389. if s<>'' then
  390. WriteResFileName(s);
  391. end;
  392. if linux_link_c then
  393. begin
  394. s:=search('crtend.o',librarysearchpath,found)+'crtend.o';
  395. if found then
  396. WriteResFileName(s);
  397. s:=search('crtn.o',librarysearchpath,found)+'crtn.o';
  398. if found then
  399. WriteResFileName(s);
  400. end;
  401. { Write sharedlibraries like -l<lib> }
  402. While not SharedLibFiles.Empty do
  403. begin
  404. S:=SharedLibFiles.Get;
  405. if s<>'c' then
  406. begin
  407. i:=Pos(target_os.sharedlibext,S);
  408. if i>0 then
  409. Delete(S,i,255);
  410. WriteRes(target_link.libprefix+s);
  411. end
  412. else
  413. linklibc:=true;
  414. end;
  415. { be sure that libc is the last lib }
  416. { arghhhh this is wrong for DJGPP !!!
  417. DJGPP need gcc after c lib (umod...) (PM) }
  418. if linklibc then
  419. WriteRes(target_link.libprefix+'c');
  420. { add libgcc after ! }
  421. if linklibc and (target_info.target=target_i386_go32v2) then
  422. WriteRes(target_link.libprefix+'gcc');
  423. WriteRes(target_link.inputend);
  424. { Write staticlibraries }
  425. if not StaticLibFiles.Empty then
  426. begin
  427. WriteRes(target_link.GroupStart);
  428. While not StaticLibFiles.Empty do
  429. begin
  430. S:=StaticLibFiles.Get;
  431. WriteResFileName(s)
  432. end;
  433. WriteRes(target_link.GroupEnd);
  434. end;
  435. { Close response }
  436. close(linkresponse);
  437. WriteResponseFile:=True;
  438. end;
  439. function TLinker.MakeExecutable:boolean;
  440. var
  441. bindbin : string[80];
  442. bindfound : boolean;
  443. s : string;
  444. success : boolean;
  445. ii : longint;
  446. begin
  447. {$ifdef linux}
  448. if LinkToC then
  449. begin
  450. AddObject('/usr/lib/crt0.o');
  451. AddObject('lprt');
  452. AddStaticLibrary('libc.a');
  453. AddStaticLibrary('libgcc.a');
  454. end;
  455. {$endif Linux}
  456. { Write used files and libraries }
  457. WriteResponseFile;
  458. { Call linker }
  459. if not(cs_link_extern in aktglobalswitches) then
  460. Message1(exec_i_linking,current_module^.exefilename^);
  461. s:=target_link.linkcmd;
  462. if DLLsource then
  463. Replace(s,'$EXE',current_module^.sharedlibfilename^)
  464. else
  465. Replace(s,'$EXE',current_module^.exefilename^);
  466. Replace(s,'$OPT',LinkOptions);
  467. Replace(s,'$RES',current_module^.outpath^+LinkResName);
  468. success:=DoExec(FindLinker,s,true,false);
  469. {Bind}
  470. if (target_link.bindbin[1]<>'') and
  471. ((target_info.target<>target_i386_win32) or bind_win32_dll) then
  472. for ii:=1 to target_link.binders do
  473. begin
  474. s:=target_link.bindcmd[ii];
  475. Replace(s,'$OPT',LinkOptions);
  476. Replace(s,'$RES',current_module^.outpath^+LinkResName);
  477. if DLLsource then
  478. Replace(s,'$EXE',current_module^.sharedlibfilename^)
  479. else
  480. Replace(s,'$EXE',current_module^.exefilename^);
  481. {Size of the heap when an EMX program runs in OS/2.}
  482. Replace(s,'$HEAPMB',tostr((maxheapsize+1048575) shr 20));
  483. {Size of the stack when an EMX program runs in OS/2.}
  484. Replace(s,'$STACKKB',tostr((stacksize+1023) shr 10));
  485. {When an EMX program runs in DOS, the heap and stack share the
  486. same memory pool. The heap grows upwards, the stack grows downwards.}
  487. Replace(s,'$DOSHEAPKB',tostr((stacksize+maxheapsize+1023) shr 10));
  488. if Strip and Target_Link.StripBind then
  489. Replace (S, '$STRIP', Target_Link.StripOpt) else
  490. Replace (S, '$STRIP', '');
  491. if utilsdirectory<>'' then
  492. begin
  493. bindbin:=Search(target_link.bindbin[ii]+source_os.exeext,
  494. utilsdirectory,bindfound)+target_link.bindbin[ii]+source_os.exeext;
  495. end
  496. else
  497. bindbin:=FindExe(target_link.bindbin[ii],bindfound);
  498. if (not bindfound) and not (cs_link_extern in aktglobalswitches) then
  499. begin
  500. Message1(exec_w_binder_not_found,bindbin);
  501. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  502. end;
  503. DoExec(bindbin,s,false,false);
  504. end;
  505. { Post processor executable }
  506. {$ifdef i386}
  507. if (target_info.target=target_i386_Win32) and success and
  508. not(cs_link_extern in aktglobalswitches) then
  509. if DLLsource then
  510. win_targ.postprocessexecutable(current_module^.sharedlibfilename^)
  511. else
  512. win_targ.postprocessexecutable(current_module^.exefilename^);
  513. {$endif}
  514. {Remove ReponseFile}
  515. if (success) and not(cs_link_extern in aktglobalswitches) then
  516. RemoveFile(current_module^.outpath^+LinkResName);
  517. MakeExecutable:=success; { otherwise a recursive call to link method }
  518. end;
  519. Procedure TLinker.MakeStaticLibrary(filescnt:longint);
  520. {
  521. FilesCnt holds the amount of .o files created, if filescnt=0 then
  522. no smartlinking is used
  523. }
  524. var
  525. smartpath,
  526. s,
  527. arbin : string;
  528. arfound : boolean;
  529. cnt : longint;
  530. begin
  531. smartpath:=current_module^.path^+FixPath(FixFileName(current_module^.modulename^)+target_info.smartext,false);
  532. { find ar binary }
  533. if utilsdirectory<>'' then
  534. begin
  535. arbin:=Search(target_ar.arbin+source_os.exeext,
  536. utilsdirectory,arfound)+target_ar.arbin+source_os.exeext;
  537. end
  538. else
  539. arbin:=FindExe(target_ar.arbin,arfound);
  540. if (not arfound) and not(cs_link_extern in aktglobalswitches) then
  541. begin
  542. Message(exec_w_ar_not_found);
  543. aktglobalswitches:=aktglobalswitches+[cs_link_extern];
  544. end;
  545. s:=target_ar.arcmd;
  546. Replace(s,'$LIB',current_module^.staticlibfilename^);
  547. if filescnt=0 then
  548. Replace(s,'$FILES',current_module^.objfilename^)
  549. else
  550. Replace(s,'$FILES',FixFileName(smartpath+current_module^.asmprefix^+'*'+target_info.objext));
  551. DoExec(arbin,s,false,true);
  552. { Clean up }
  553. if not(cs_asm_leave in aktglobalswitches) then
  554. if not(cs_link_extern in aktglobalswitches) then
  555. begin
  556. if filescnt=0 then
  557. RemoveFile(current_module^.objfilename^)
  558. else
  559. begin
  560. for cnt:=1 to filescnt do
  561. if not RemoveFile(FixFileName(smartpath+current_module^.asmprefix^+tostr(cnt)+target_info.objext)) then
  562. RemoveFile(FixFileName(smartpath+current_module^.asmprefix^+'e'+tostr(cnt)+target_info.objext));
  563. RemoveDir(smartpath);
  564. end;
  565. end
  566. else
  567. begin
  568. if filescnt=0 then
  569. AsmRes.AddDeleteCommand(current_module^.objfilename^)
  570. else
  571. begin
  572. AsmRes.AddDeleteCommand(smartpath+current_module^.asmprefix^+'*'+target_info.objext);
  573. AsmRes.Add('rmdir '+smartpath);
  574. end;
  575. end;
  576. end;
  577. Procedure TLinker.MakeSharedLibrary;
  578. var
  579. s : string;
  580. begin
  581. s:=' -shared -o $LIB $FILES';
  582. Replace(s,'$LIB',current_module^.sharedlibfilename^);
  583. Replace(s,'$FILES',current_module^.objfilename^);
  584. if DoExec(FindLinker,s,false,false) then
  585. RemoveFile(current_module^.objfilename^);
  586. end;
  587. end.
  588. {
  589. $Log$
  590. Revision 1.55 1999-06-15 13:57:31 peter
  591. * merged
  592. Revision 1.54.2.1 1999/06/15 13:51:56 peter
  593. * also check ld-2.1.so for glibc 2.1, previous was only for 2.1.1
  594. Revision 1.54 1999/06/02 13:25:35 hajny
  595. * fixed stripping symbols for OS/2
  596. Revision 1.53 1999/05/04 21:44:44 florian
  597. * changes to compile it with Delphi 4.0
  598. Revision 1.52 1999/05/03 21:30:30 peter
  599. + glibc 2.1
  600. Revision 1.51 1999/04/28 23:42:33 pierre
  601. * removing of temporary directory with -s option
  602. Revision 1.50 1999/04/25 14:31:48 daniel
  603. * Bug fixed in linking: compiling files on another drive than the one you
  604. currently use you is done correctly.
  605. Revision 1.49 1999/03/25 16:55:30 peter
  606. + unitpath,librarypath,includepath,objectpath directives
  607. Revision 1.48 1999/03/23 16:22:43 peter
  608. * crtbegin/crtend only added if found
  609. Revision 1.47 1999/02/05 16:45:47 michael
  610. + Fixed gluing of options
  611. Revision 1.46 1999/02/05 08:54:26 pierre
  612. + linkofiles splitted inot linkofiles and linkunitfiles
  613. because linkofiles must be stored with directory
  614. to enabled linking of different objects with same name
  615. in a different directory
  616. Revision 1.45 1999/01/29 10:33:07 peter
  617. * objectsearchpath is now also searched if an object is not found
  618. Revision 1.44 1999/01/27 13:07:58 pierre
  619. * problem related with libc : go32v2 and linux differences
  620. Revision 1.43 1999/01/25 15:02:13 peter
  621. * link libc always as last
  622. Revision 1.42 1998/12/11 00:03:19 peter
  623. + globtype,tokens,version unit splitted from globals
  624. Revision 1.41 1998/12/01 23:39:46 pierre
  625. * postprocessexec for win32 changed
  626. Revision 1.40 1998/12/01 12:51:20 peter
  627. * fixed placing of ppas.sh and link.res when using -FE
  628. Revision 1.39 1998/11/30 13:26:23 pierre
  629. * the code for ordering the exported procs/vars was buggy
  630. + added -WB to force binding (Ozerski way of creating DLL)
  631. this is off by default as direct writing of .edata section seems
  632. OK
  633. Revision 1.38 1998/11/30 09:43:13 pierre
  634. * some range check bugs fixed (still not working !)
  635. + added DLL writing support for win32 (also accepts variables)
  636. + TempAnsi for code that could be used for Temporary ansi strings
  637. handling
  638. Revision 1.37 1998/10/26 22:23:31 peter
  639. + fixpath() has an extra option to allow a ./ as path
  640. Revision 1.36 1998/10/22 15:18:44 florian
  641. + switch -vx for win32 added
  642. Revision 1.35 1998/10/19 18:06:23 peter
  643. * use no_double
  644. Revision 1.34 1998/10/16 13:37:18 florian
  645. + switch -FD added to specify the path for utilities
  646. Revision 1.33 1998/10/14 13:38:22 peter
  647. * fixed path with staticlib/objects in ppufiles
  648. Revision 1.32 1998/10/14 11:03:55 daniel
  649. * Forgot to dereference a pointer.
  650. Revision 1.31 1998/10/14 11:01:21 daniel
  651. * Staticlibfilename no longer not include a path. Correction when calling
  652. ar.
  653. Revision 1.30 1998/10/13 13:10:18 peter
  654. * new style for m68k/i386 infos and enums
  655. Revision 1.29 1998/10/13 08:19:34 pierre
  656. + source_os is now set correctly for cross-processor compilers
  657. (tos contains all target_infos and
  658. we use CPU86 and CPU68 conditionnals to
  659. get the source operating system
  660. this only works if you do not undefine
  661. the source target !!)
  662. * several cg68k memory leaks fixed
  663. + started to change the code so that it should be possible to have
  664. a complete compiler (both for m68k and i386 !!)
  665. Revision 1.28 1998/10/08 23:28:56 peter
  666. * -vu shows unit info, -vt shows tried/used files
  667. Revision 1.27 1998/10/06 17:16:52 pierre
  668. * some memory leaks fixed (thanks to Peter for heaptrc !)
  669. Revision 1.26 1998/09/29 15:23:05 peter
  670. * remove also the end files for smartlinking
  671. Revision 1.25 1998/09/10 15:25:31 daniel
  672. + Added maxheapsize.
  673. * Corrected semi-bug in calling the assembler and the linker
  674. Revision 1.24 1998/09/07 18:32:45 peter
  675. * fixed for m68k
  676. Revision 1.23 1998/09/03 17:39:04 florian
  677. + better code for type conversation longint/dword to real type
  678. Revision 1.22 1998/09/01 09:01:00 peter
  679. + glibc2 support
  680. Revision 1.21 1998/08/31 12:26:26 peter
  681. * m68k and palmos updates from surebugfixes
  682. Revision 1.20 1998/08/19 10:06:14 peter
  683. * fixed filenames and removedir which supports slash at the end
  684. Revision 1.19 1998/08/17 09:17:47 peter
  685. * static/shared linking updates
  686. Revision 1.18 1998/08/14 21:56:34 peter
  687. * setting the outputfile using -o works now to create static libs
  688. Revision 1.17 1998/08/14 18:16:08 peter
  689. * return after a failed call will now add it to ppas
  690. Revision 1.16 1998/08/12 19:28:15 peter
  691. * better libc support
  692. Revision 1.15 1998/08/10 14:50:02 peter
  693. + localswitches, moduleswitches, globalswitches splitting
  694. Revision 1.14 1998/06/17 14:10:13 peter
  695. * small os2 fixes
  696. * fixed interdependent units with newppu (remake3 under linux works now)
  697. Revision 1.13 1998/06/08 22:59:46 peter
  698. * smartlinking works for win32
  699. * some defines to exclude some compiler parts
  700. Revision 1.12 1998/06/04 23:51:44 peter
  701. * m68k compiles
  702. + .def file creation moved to gendef.pas so it could also be used
  703. for win32
  704. Revision 1.11 1998/05/27 00:20:31 peter
  705. * some scanner optimizes
  706. * automaticly aout2exe for go32v1
  707. * fixed dynamiclinker option which was added at the wrong place
  708. Revision 1.10 1998/05/22 12:32:47 peter
  709. * fixed -L on the commandline, Dos commandline is only 128 bytes
  710. Revision 1.9 1998/05/12 10:46:59 peter
  711. * moved printstatus to verb_def
  712. + V_Normal which is between V_Error and V_Warning and doesn't have a
  713. prefix like error: warning: and is included in V_Default
  714. * fixed some messages
  715. * first time parameter scan is only for -v and -T
  716. - removed old style messages
  717. Revision 1.8 1998/05/11 13:07:54 peter
  718. + $ifdef NEWPPU for the new ppuformat
  719. + $define GDB not longer required
  720. * removed all warnings and stripped some log comments
  721. * no findfirst/findnext anymore to remove smartlink *.o files
  722. Revision 1.7 1998/05/08 09:21:20 michael
  723. * Added missing -Fl message to messages file.
  724. * Corrected mangling of file names when doing Linklib
  725. * -Fl now actually WORKS.
  726. * Librarysearchpath is now a field in linker object.
  727. Revision 1.6 1998/05/06 09:26:49 peter
  728. * fixed ld call with shell
  729. Revision 1.4 1998/05/04 17:54:25 peter
  730. + smartlinking works (only case jumptable left todo)
  731. * redesign of systems.pas to support assemblers and linkers
  732. + Unitname is now also in the PPU-file, increased version to 14
  733. Revision 1.3 1998/04/16 10:54:30 daniel
  734. * Fixed linking for OS/2.
  735. }