Paths manually specified. lazarus / 79-Embedded - ARM ---------------------------------------------------------------------- funlw65 · 2021-03-12 15:55 Sometimes I use JALv2 compiler for PIC projects... compiler executable is accessed directly and paths to the include files are specified in the command line. Because of this, you can have (if you want) a folder structure like this: Code: [Select][your_home_folder]    |    o---[jalv2]          |          o---[includes]          |          jalv2_executable           So, I call the executable with path to [includes] and my project as parameters. Can I do the same with the ppcrossarm executable, disregarding fpc.cfg and specifying the paths to where I put the RTL units and so on? If it works, will this allow me to have separate folders for targeted RTLs (for different cores)? ---------------------------------------------------------------------- Laksen · 2021-03-12 18:43 Should be possible if you create a new fpc.cfg. I can't remember but I think the compiler might look for fpc.cfg in the same directory in which case you are in luck ---------------------------------------------------------------------- funlw65 · 2021-03-12 19:09 yes, that would be ideal! I'll make some tests... ---------------------------------------------------------------------- funlw65 · 2021-03-12 19:34 Ok, I think I found a combination of parameters for the configuration files, hopefully it will work... So first we have:   @ which specifies a configuration file, but it says it will read it in addition to the default fpc.cfg but then there is this option:   -n which says Do not read the default configuration files. So, no fpc.cfg for you, but I will read the configuration file you delivered... I am right? I'll test this. ---------------------------------------------------------------------- MiR · 2021-03-12 21:54 You can use the configuration done in fpcupdeluxe as a base for your experiments, there all is in place to have several subarchs/fp-abi's in parallel. However, $FPCABI was added recently to the compiler, so you will need to compile a trunk compiler for it to work. This of course depends on your needs. If you do not need to distinguish between floating point implementations then prod compilers will also work well. # begin fpcup do not remove arm-embedded # Inserted by fpcup 11-3-21 22:37:43 # Cross compile settings dependent on both target OS and target CPU #IFDEF FPC_CROSSCOMPILING #IFDEF EMBEDDED #IFDEF CPUARM #IFDEF CPUARMV6M -CaEABI #ENDIF CPUARMV6M #IFDEF CPUARMV7EM -CfFPV4_SP_D16 -OoFASTMATH -CaEABIHF #ENDIF CPUARMV7EM #IFDEF CPUARMV7M -CaEABI #ENDIF CPUARMV7M -FD/Users/ring/fpcupdeluxe/cross/bin/arm-embedded/ -XParm-none-eabi- -Fl/Users/ring/fpcupdeluxe/cross/lib/arm-embedded/$FPCSUBARCH/$FPCABI/ -Fu/Users/ring/fpcupdeluxe/fpc/units/arm- embedded/$FPCSUBARCH/$FPCABI/rtl -Fu/Users/ring/fpcupdeluxe/fpc/units/arm- embedded/$FPCSUBARCH/$FPCABI/packages #ENDIF CPUARM #ENDIF EMBEDDED #ENDIF FPC_CROSSCOMPILING # end fpcup do not remove ---------------------------------------------------------------------- funlw65 · 2021-03-12 22:43 Thank you! ---------------------------------------------------------------------- funlw65 · 2021-03-13 12:50 Regarding the configuration file, or it's required presence or not, this sums it well: https://www.freepascal.org/docs-html/user/usersu10.html ---------------------------------------------------------------------- Fred vS · 2021-03-13 13:23 Quote from: funlw65 on March 13, 2021, 01:50:08 pmRegarding the configuration file, or it's required presence or not, this sums it well: https://www.freepascal.org/docs-html/user/usersu10.html Hello. I think there are errors for Unix OS in the document and in the comment of /fpc/compiler/options.pas. In the link you give, they say: QuoteUnless you specify the -n (see page 104) option, the compiler will look for a configuration file fpc.cfg in the following places:     Under unix (such as linux)     1.         The current directory.     2.         Your home directory, it looks for .fpc.cfg.     3.         The directory specified in the environment variable PPC_CONFIG_PATH.     4.         in the etc directory above the compiler directory.         For instance, if the compiler is in /usr/local/bin, it will look in /usr/local/etc.         See below for some additional information about this point.     5.         The directory /etc. But if you take a look at /fpc/compiler/options.pas, there is: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {********** ******************************************************************                            Callable Routines**************************** ************************************************} function check_configfile(fn:string; var foundfn:string):boolean;   function CfgFileExists(const fn:string):boolean;  begin    Comment(V_Tried,'Configfile search: '+fn);    CfgFileExists:=FileExists(fn);  end; var{$ifdef Unix}  hs,{$endif Unix}  configpath : string;begin  foundfn:=fn;  check_configfile:=true;  { retrieve configpath }  configpath:=FixPath( GetEnvironmentVariable('PPC_CONFIG_PATH'),false);{$ifdef Unix}  if configpath='' then   configpath:=ExpandFileName(FixPath(exepath+'../et c/',false));{$endif}  {    Order to read configuration file :    try reading fpc.cfg in :     1 - current dir     2 - configpath     3 - compiler path  }  if not FileExists(fn) then   begin{$ifdef Unix}     hs:=GetEnvironmentVariable('HOME');     if (hs<>'') and CfgFileExists(FixPath(hs,false)+'.'+fn) then      foundfn:=FixPath(hs,false)+'.'+fn     else{$endif}      if CfgFileExists(configpath+fn) then       foundfn:=configpath+fn     else{$ifdef WINDOWS}       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn) then         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn     else       if (GetEnvironmentVariable('ALLUSERSPROFILE')<>'') and Cfg FileExists(FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn ) then         foundfn:=FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn     else{$endif WINDOWS}{$ifndef Unix}      if CfgFileExists(exepath+fn) then       foundfn:=exepath+fn     else{$else}      if CfgFileExists('/etc/'+fn) then       foundfn:='/etc/'+fn     else{$endif}      check_configfile:=false;   end;end; The comment says: Quote{     Order to read configuration file :     try reading fpc.cfg in :      1 - current dir      2 - configpath      3 - compiler path   } But if you take a look at code, in fact it is:  Order to read configuration file :     try reading fpc.cfg in :      1 - environement variable (/HOME)+'.'      2 - configpath      3 - /etc/ Fre;D ---------------------------------------------------------------------- funlw65 · 2021-03-13 14:24 Thank you Fred, that is even clearer about the path priority of a config file... for now... The best method is to take control for what I intend to do, to assure the desired outcome. In my book, -n option means no more confusion. For embedded, $HOME folder is enough. ---------------------------------------------------------------------- Fred vS · 2021-03-13 14:53 Quote from: funlw65 on March 13, 2021, 03:24:35 pmFor embedded, $HOME folder is enough. Yes but, afaik, the fpc.cfg must be in $HOME folder and hidden (a dot before), for example: /home/me/.fpc.cfg