Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-11

paths in cross-compiling

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adam Naumowicz

Hello,

Is there a way to strictly define the paths where FPC looks for objects and libraries?

AFAIK -Fl can only add a new value, not override the old one. I'm trying to compile with solaris target on a linux machine, so I need to tell FPC to use solaris libc.a, crti.o, and crtn.o instead of those from linux. But the produced link.res file always has
SEARCH_DIR(/usr/)
SEARCH_DIR(/usr/lib/)
at the begining. Only when I remove them by hand and provide a proper path for crti.o and crtn.o does the linker produce a good solaris executable. Can it be done in a less nasty way?

Thanks in advance,

Adam Naumowicz

====================================================================== Department of Applied Logic fax. +48 (85) 745-7662 Institute of Computer Science tel. +48 (85) 745-7559 (office) University of Bialystok e-mail:
Sosnowa 64, 15-887 Bialystok, Poland http://math.uwb.edu.pl/~adamn/ ======================================================================

Reply by email

George Patterson
to Adam Naumowicz
Show quoted text 15 lines
Hello, Is there a way to strictly define the paths where FPC looks for objects and libraries? AFAIK -Fl can only add a new value, not override the old one. I'm trying to compile with solaris target on a linux machine, so I need to tell FPC to use solaris libc.a, crti.o, and crtn.o instead of those from linux. But the produced link.res file always has SEARCH_DIR(/usr/) SEARCH_DIR(/usr/lib/) at the begining. Only when I remove them by hand and provide a proper path for crti.o and crtn.o does the linker produce a good solaris executable. Can it be done in a less nasty way?

Adam,

This might be a nasty hack but have you tried putting in the new path right at the top of the link.res file.

George Patterson

Reply by email

Adam Naumowicz
to George Patterson
George Patterson wrote
This might be a nasty hack but have you tried putting in the new path right at the top of the link.res file.

Well, the link.res file is created automatically following the compiler's config file. Normally, there should be no need to change link.res manually. So the whole thing should be done in the config file, but I don't see how ;-(

Adam Naumowicz

====================================================================== Department of Applied Logic fax. +48 (85) 745-7662 Institute of Computer Science tel. +48 (85) 745-7559 (office) University of Bialystok e-mail:
Sosnowa 64, 15-887 Bialystok, Poland http://math.uwb.edu.pl/~adamn/ ======================================================================

Reply by email

George Patterson
to Adam Naumowicz
Show quoted text 12 lines
On Fri, 7 Nov 2003, George Patterson wrote: > This might be a nasty hack but have you tried putting in the new > path right at the top of the link.res file. Well, the link.res file is created automatically following the compiler's config file. Normally, there should be no need to change link.res manually. So the whole thing should be done in the config file, but I don't see how ;-( Adam Naumowicz

True, but as i understand it a program should not add /usr/local/lib to the search path under FreeBSD. Something to do with FreeBSD policy or something. :-(

George Patterson

Reply by email

Marco van de Voort
to Adam Naumowicz: Is there a way to strictly define the paths where FPC looks for objects and libraries?…
Show quoted text 12 lines
Is there a way to strictly define the paths where FPC looks for objects and libraries? AFAIK -Fl can only add a new value, not override the old one. I'm trying to compile with solaris target on a linux machine, so I need to tell FPC to use solaris libc.a, crti.o, and crtn.o instead of those from linux. But the produced link.res file always has SEARCH_DIR(/usr/) SEARCH_DIR(/usr/lib/) at the begining. Only when I remove them by hand and provide a proper path for crti.o and crtn.o does the linker produce a good solaris executable. Can it be done in a less nasty way?

1.9+: add parameter -Xd to not add the std paths. 1.0.x: No.

Other "new" 1.9 parameters with regarding to crosslinking: -XP<prefix> : prefix to be placed before crosstools calls. (like -XPi686-linux-) -Xr<rlinkpath>: (still working and testing if this helps): set --rlink-path (override dynlib searchpath locally)
-Xt : pass -static to linker.

Reply by email

Marco van de Voort
to George Patterson: On Fri, 7 Nov 2003 00:43:55 +0100 (CET) True, but as i understand it a program should not…
Show quoted text 19 lines
On Fri, 7 Nov 2003 00:43:55 +0100 (CET) Adam Naumowicz wrote: > On Fri, 7 Nov 2003, George Patterson wrote: > > > This might be a nasty hack but have you tried putting in the new > > path right at the top of the link.res file. > > Well, the link.res file is created automatically following the > compiler's config file. Normally, there should be no need to change > link.res manually. So the whole thing should be done in the config > file, but I don't see how ;-( > > Adam Naumowicz > True, but as i understand it a program should not add /usr/local/lib to the search path under FreeBSD. Something to do with FreeBSD policy or something. :-(

I got fed up fixing that on IRC, so 1.9 default .cfg adds this :-)

Screw policy...

Reply by email

Florian Klaempfl
to Marco van de Voort: 1.9+: add parameter -Xd to not add the std paths. 1.0.x: No. Other "new" 1.9 parameters…
Marco van de Voort wrote 16 lines
>Is there a way to strictly define the paths where FPC looks for objects >and libraries? > >AFAIK -Fl can only add a new value, not override the old one. I'm trying >to compile with solaris target on a linux machine, so I need to tell FPC >to use solaris libc.a, crti.o, and crtn.o instead of those from linux. >But the produced link.res file always has >SEARCH_DIR(/usr/) >SEARCH_DIR(/usr/lib/) >at the begining. Only when I remove them by hand and provide a proper path >for crti.o and crtn.o does the linker produce a good solaris executable. >Can it be done in a less nasty way? 1.9+: add parameter -Xd to not add the std paths. 1.0.x: No.

You can tweak compiler/targets/t_sunos.pas:

Constructor TLinkersunos.Init;
begin
   Inherited Init;
   LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true);
end;

around line 200. I guess removing the Library... line should solve your problem.

Reply by email

Marco van de Voort
to Florian Klaempfl
Show quoted text 28 lines
Marco van de Voort wrote: >>Is there a way to strictly define the paths where FPC looks for objects >>and libraries? >> >>AFAIK -Fl can only add a new value, not override the old one. I'm trying >>to compile with solaris target on a linux machine, so I need to tell FPC >>to use solaris libc.a, crti.o, and crtn.o instead of those from linux. >>But the produced link.res file always has >>SEARCH_DIR(/usr/) >>SEARCH_DIR(/usr/lib/) >>at the begining. Only when I remove them by hand and provide a proper path >>for crti.o and crtn.o does the linker produce a good solaris executable. >>Can it be done in a less nasty way? > > > 1.9+: add parameter -Xd to not add the std paths. > 1.0.x: No. You can tweak compiler/targets/t_sunos.pas: Constructor TLinkersunos.Init; begin Inherited Init; LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true); end; around line 200. I guess removing the Library... line should solve your problem.

Yes, that is what -Xd does.

Reply by email

Adam Naumowicz
to Florian Klaempfl: You can tweak compiler/targets/t_sunos.pas: Constructor TLinkersunos.Init; begin…
Florian Klaempfl wrote 13 lines
> 1.9+: add parameter -Xd to not add the std paths. > 1.0.x: No. You can tweak compiler/targets/t_sunos.pas: Constructor TLinkersunos.Init; begin Inherited Init; LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true); end; around line 200. I guess removing the Library... line should solve your problem.

Thanks, it works as expected.

Regards,

Adam Naumowicz

====================================================================== Department of Applied Logic fax. +48 (85) 745-7662 Institute of Computer Science tel. +48 (85) 745-7559 (office) University of Bialystok e-mail:
Sosnowa 64, 15-887 Bialystok, Poland http://math.uwb.edu.pl/~adamn/ ======================================================================

Reply by email