Forum > Other OS

[SOLVED] FPC 3.3.1 - /usr/lib/crt1.10.5.so missing

<< < (2/2)

Jonas Maebe:

--- Quote from: trev on August 10, 2019, 02:40:08 pm ---So near, yet so far...

How to now get rid of the 146 linking errors like:


--- Quote ---Error: ld: warning: object file (/usr/local/lib/fpc/3.3.1/units/x86_64-darwin/chm/fasthtmlparser.o) was built for newer OSX version (10.8) than being linked (10.5)

--- End quote ---

when compiling a program with Lazarus.

--- End quote ---

Those are not errors, but warnings (and harmless in case of FPC, at this time FPC does not generate code that requires at least version XXX of macOS if you use -WM10.XXX). I don't know where that extra "Error:" prefix comes from (maybe Lazarus adds it?). You can also add -WM10.8 when compiling programs in Lazarus to get rid of the warning.

trev:
> You can also add -WM10.8 when compiling programs in Lazarus to get rid of the warning.

I tried various things like Project Options > Compiler options > Custom Options > Conditionals:


--- Code: Pascal  window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if TargetOS = 'darwin' then begin  UsageCustomOptions += ' -WM10.8';end; 
and/or adding to Project Options > Compilation and Linking:

-k-macosx_version_min -k10.8

and failed to get rid of the error warnings.

Jonas Maebe:

--- Quote from: trev on August 10, 2019, 03:50:39 pm ---> You can also add -WM10.8 when compiling programs in Lazarus to get rid of the warning.

I tried various things like Project Options > Compiler options > Custom Options > Conditionals:


--- Code: Pascal  window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if TargetOS = 'darwin' then begin  UsageCustomOptions += ' -WM10.8';end; 
--- End quote ---
I have never managed to get these conditional parameters working. Adding them normally should work though.


--- Quote ---and/or adding to Project Options > Compilation and Linking:

-k-macosx_version_min -k10.8

and failed to get rid of the error warnings.

--- End quote ---
Never ever use that. Always use the compiler parameter.

trev:
To clarify the successful build process, after building with OPT=-WM10.8 but not installing, subsequent builds with OPT=-WM10.5 then work.

However, while building the cross compilers for win32 and win64 succeeds, attempts to install with:

make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64

produces:

/usr/local/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/usr/local/share/fpcsrc/fpc-3.3.1/rtl/units/x86_64-darwin -Fix86_64 -FEx86_64/bin/x86_64-darwin -FUx86_64/units/x86_64-darwin -dRELEASE    -dx86_64 -dGDB -dBROWSERLOG -Fux86 pp.pas
ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking

So, let's add OPT=-WM10.8 and yes, it gets further, but then dies a miserable death with:

/usr/local/share/fpcsrc/fpc-3.3.1/compiler/ppcrossx64 -Twin64 -XPx86_64-win64- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 -FE. -FU/usr/local/share/fpcsrc/fpc-3.3.1/rtl/units/x86_64-win64 -WM10.8 -dx86_64 -dRELEASE  -Us -Sg system.pp -Fi../win
Error: Illegal parameter: -WM10.8

when using the win64 cross compiler which doesn't understand -WM10.8.


[EDIT]

Why is FPC looking for crt1.10.5.o in /usr/lib instead of:

* /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o

=or=

* /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o

[EDIT 2]

Yes! This works:

make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/"

But does it have to be this difficult?

Jonas Maebe:

--- Quote from: trev on August 12, 2019, 01:39:35 am ---
Why is FPC looking for crt1.10.5.o in /usr/lib instead of:

* /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o

=or=

* /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o

--- End quote ---
Because from Mac OS X 10.5 till macOS 10.13, that is where that file could be found.


--- Quote ---make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 OPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/"

But does it have to be this difficult?

--- End quote ---
It wouldn't be if Apple would stop moving things around every other full moon. FPC 3.0.4 predates the release of macOS 10.14. I will try to fix it for FPC 3.2, although I'm sure macOS 10.15 will manage to mess up other things again.

Navigation

[0] Message Index

[*] Previous page

Go to full version