link.pas 23 KB

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