Recent

Author Topic: [SOLVED] what we gone do with the exec_w_objfile_not_found message?  (Read 1394 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
./compiler/link.pas (line 272) we have:
Code: Pascal  [Select][+][-]
  1.  
  2.   found:=FindFile(s,exepath,false,foundfile);
  3.   if not(cs_link_nolink in current_settings.globalswitches) and (not found) then
  4.          Message1(exec_w_objfile_not_found,s);
  5.  

this tells us, we get the warning:
Code: Pascal  [Select][+][-]
  1. Warning: Object libgte.a not found, Linking may fail !

its because he search in the exe path.

Now I specify -Fl./path/

but this has no effect on the message.

Should we change this behavior in the source?
« Last Edit: July 28, 2024, 09:25:29 pm by Key-Real »

TRon

  • Hero Member
  • *****
  • Posts: 3137
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #1 on: July 20, 2024, 11:25:38 am »
Hi key-real:
Dunno in what state the linker support is and it is a longshot but have you tried passing -k--library-path=searchdir instead of using -Fl ?

Do you have all the linker control scripts present as well for your cross-compiler/utils ?

Usually you can pass along other options to the linker with the -k option as well in order to obtain more detailed output.
All software is open source (as long as you can read assembler)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #2 on: July 20, 2024, 11:32:08 am »
It is not the part of my linker.
Its a warning generated of FPC before my linker is envoked.
the -Fl option passes me the lib search dir and it works, so I can call ld.

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #3 on: July 20, 2024, 11:41:05 am »
correction:

./compiler/linker.pas (line 243):
Code: Pascal  [Select][+][-]
  1. if pos('.',s)=0 then
  2.          s:=s+target_info.objext;                                        <---- he searchs only for .o files not for .a (target_info.staticlibext)
  3.         { find object file
  4.            1. output unit path
  5.            2. output exe path
  6.            3. specified unit path (if specified)
  7.            4. cwd
  8.            5. unit search path
  9.            6. local object path
  10.            7. global object path
  11.            8. exepath (not when linking on target)
  12.           for all finds don't use the directory caching }
  13.         found:=false;
  14.         if isunit and (OutputUnitDir<>'') then
  15.           found:=FindFile(s,OutPutUnitDir,false,foundfile)
  16.         else
  17.           if OutputExeDir<>'' then
  18.             found:=FindFile(s,OutPutExeDir,false,foundfile);
  19.         if (not found) and (unitpath<>'') then
  20.          found:=FindFile(s,unitpath,false,foundfile);
  21.         if (not found) then
  22.          found:=FindFile(s, CurDirRelPath(source_info),false,foundfile);
  23.         if (not found) then
  24.          found:=UnitSearchPath.FindFile(s,false,foundfile);
  25.         if (not found) then
  26.          found:=current_module.localobjectsearchpath.FindFile(s,false,foundfile);
  27.         if (not found) then
  28.          found:=objectsearchpath.FindFile(s,false,foundfile);
  29.         if not(cs_link_on_target in current_settings.globalswitches) and (not found) then
  30.          found:=FindFile(s,exepath,false,foundfile);
  31.         if not(cs_link_nolink in current_settings.globalswitches) and (not found) then
  32.          Message1(exec_w_objfile_not_found,s);
  33.  

TRon

  • Hero Member
  • *****
  • Posts: 3137
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #4 on: July 20, 2024, 12:07:11 pm »
It is not the part of my linker.
I see (had a look at your github).

In that case I am unable to provide any meaningful help simply because I lack the knowledge on how to implement a (custom) linker for FPC.

BTW and fwiw I see that you are making your changes at your github in main/trunk (which is probably fine at this stage) but realize that it is much easier to have a separated branch where you make your changes (small steps) in order to create MR's to be accepted by the FPC team in case you wish to do so ?
All software is open source (as long as you can read assembler)

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #5 on: July 20, 2024, 12:17:01 pm »
BTW and fwiw I see that you are making your changes at your github in main/trunk (which is probably fine at this stage) but realize that it is much easier to have a separated branch where you make your changes (small steps) in order to create MR's to be accepted by the FPC team in case you wish to do so ?

I'm writing a step by step doc to create a FPC Wiki entry with the full explanation how to build a crosscompiler.
So finally I gonna put everything together on an own brunch.

ccrause

  • Hero Member
  • *****
  • Posts: 933
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #6 on: July 20, 2024, 12:21:56 pm »
I do not think there is a problem in the common fpc source, it works on many other systems.  It may help if you show the full compiler command line that results in this error, also the full path to the library you are linking to.  Lastly, this error is in FindObjectFile but you are specifying a static library.  How did you specify the library (compiler command line, {$linklib })?

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #7 on: July 20, 2024, 12:23:23 pm »
Its not en error. It's just not checked there for .a.

I do
{$L myLib.a}

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #8 on: July 20, 2024, 12:25:09 pm »
btw: on the PC Linux Target I got:

....
Linking FlyTracker
Warning: "crtbeginS.o" not found, this will probably cause a linking failure
Warning: "crtendS.o" not found, this will probably cause a linking failure
117041 lines compiled, 3.5 sec, 3198640 bytes code, 2287872 bytes data

compiling a big prog.

Seenkao

  • Hero Member
  • *****
  • Posts: 579
    • New ZenGL.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Key-Real

  • Sr. Member
  • ****
  • Posts: 362
Re: what we gone do with the exec_w_objfile_not_found message?
« Reply #10 on: July 28, 2024, 09:25:16 pm »
As I was told to link the system unit against the psy-q-sdk I moved the .a file link list to the linker script.
No I do not have this issue any more :)

thx

 

TinyPortal © 2005-2018