link.pas 23 KB

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