View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0021963FPCCompilerpublic2012-05-06 17:312012-05-06 17:45
Assigned ToJonas Maebe 
Platformx86_64OSUbuntu (host) Darwin (target)OS Version12.04 / 10.6
Product Version2.6.0Product Build 
Target VersionFixed in Version 
Summary0021963: crosscompiling to Darwin and -Xd causes linkage fail
DescriptionI'm crosscompiling Hedgewars' engine from Ubuntu 12.04 targetting Darwin 10.6.
The cross environment is working fine and it has been used to compile fpc 2.6.0

The fpc help command suggests to use -Xd to perform a crosscompile; however if you do, then linkage will fail, claiming that /usr/lib/crt1.o is not found. That happens because contains an hardcoded /usr/lib/crt1.o and no matter which library search path (-XR) you pass, linkage will fail.
However, when you don't add -Xd, then the correct path from the -XR command is computed and the correct path for crt1.o will be added in

The fact that Xd prevents standard library search path should not prevent the possibility of adding a search path, something which is usually done when crosscompiling.
Steps To ReproduceInstall Ubuntu, an Apple cross binutils (such as [^]), compile the latest fpc and then try to crosscompile your software (such as hedgewars engine
Additional InformationI've had a discussion on this with oliebol, I'm adding more information for future reference.

the linker searches in the librarysearchpath for it [crt1.o]; if it can't find it, it hardcodes startupfile. Under darwin sysroot/usr/lib is added to the libsearchpath.
As far as I can see it should then be found. There was a dontlinkstdlibpath around it, that is -Xd :-) (t_bsd:129 if interested)
TagsNo tags attached.
Fixed in Revision21248
Attached Files

- Relationships

-  Notes
Jonas Maebe (manager)
2012-05-06 17:45

-XR prepends the specified directory to all supplied library search paths. -Xd is orthogonal to that: it removes certain directories from the default library search path (which, if not removed, are prepended by any specified -XR path).

I've adjusted the description of the -Xd switch in the help.

- Issue History
Date Modified Username Field Change
2012-05-06 17:31 koda New Issue
2012-05-06 17:45 Jonas Maebe Fixed in Revision => 21248
2012-05-06 17:45 Jonas Maebe Status new => resolved
2012-05-06 17:45 Jonas Maebe Resolution open => fixed
2012-05-06 17:45 Jonas Maebe Assigned To => Jonas Maebe
2012-05-06 17:45 Jonas Maebe Note Added: 0059317

MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker