Sign in Join

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

Mailing lists / fpc-pascal / 2021-06

Trying to update to: Xcode 12.5, FPC 3.2.2

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Unknown author

Guys,
I'm jumping up to the latest xcode 12.5to be able to develop on iOs 14.x My trusty old FPC 3.0.5 worked just fine for iOs Target. But the simulator is a different story...

Showing All Messages
ld: building for iOS/iOS Simulator, but linking in object file built for iOS Simulator,

file '/Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64/NilnocCalc.o' -----
I feel like xcode is now enforcing a rule which was a warning before. I then thought about regenerating my  x86_64-iphonesim

but then didn't really want to rewind to pre 3.0.5 So, I figured I'd jump to 3.2.2

cd Users/john/Desktop/Developer/FPC/3.2.2
sudo make distclean -j 3

export IOS_BASE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk export BIN_BASE=${IOS_BASE}/usr/bin
sudo make FPC=/usr/local/lib/fpc/3.0.5/ppc386 OPT="-ap" CPU_TARGET=x86_64 OS_TARGET=iphonesim CROSSOPT="-FD${BIN_BASE} -XR${IOS_BASE}" all

But.. that led to  ...

...
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C /Users/john/Desktop/Developer/FPC/3.2.2/rtl 'OPT=-ap  ' all /Applications/Xcode.app/Contents/Developer/usr/bin/make -C darwin all /usr/local/lib/fpc/3.0.5/ppc386 -Ur -dFPC_USE_LIBC -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 -Fi../unix -Fi../bsd -Fi../bsd/x86_64 -Fi../darwin/x86_64 -FE. -FU/Users/john/Desktop/Developer/FPC/3.2.2/rtl/units/x86_64-darwin -ap -dx86_64 -dRELEASE  -Us -Sg ../bsd/system.pp

system.inc(154,4) Fatal: Cannot open include file "i386.inc" Fatal: Compilation abortedmake[5]: *** [system.ppu] Error 1 make[4]: *** [darwin_all] Error 2
make[3]: *** [rtl] Error 2
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-iphonesim] Error 2

any ideas ?

thanks guys

john

-------------------

Note: This is on an Intel Mac

full dump on 3.0.5 targeting Sim :

/Users/john/Desktop/Project/NilnocCalc
...Compiling for SIM (x64)
/usr/local/lib/fpc/3.0.5/ppcx64 -Mdelphi -XX -djciOS -k-ios_simulator_version_min -k9.3 -Fu/Users/john/Desktop/Project/NilnocCalc/src -Fu/Users/john/Desktop/Project/NilnocCalc/src/* -Fu/Users/john/Desktop/Project/NilnocCalc/../Common/* -Fu/Users/john/Desktop/Project/NilnocCalc/../Common/iOs/* -Fu/Users/john/Desktop/Project/NilnocCalc/../Common/wolf/iOs/ -XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -Fu/Users/john/Desktop/Project/NilnocCalc/../Common/wolf/iOs/Debug-iphonesimulator -CiroR -gltw -Sa -Xg -Fu~/Desktop/Developer/FPC/iOS10.3/x86_64-iphonesim -Tiphonesim -FU/Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64 -o/Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64/NilnocCalc /Users/john/Desktop/Project/NilnocCalc/NilnocCalc/NilnocCalc.pas

Free Pascal Compiler version 3.0.5 [2017/11/26] for x86_64Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Darwin/iPhoneSim for x86_64
Compiling /Users/john/Desktop/Project/NilnocCalc/NilnocCalc/NilnocCalc.pas Assembling (pipe) /Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64/NilnocCalc.s

Linking /Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64/NilnocCalc ld: building for iOS/iOS Simulator, but linking in object file built for iOS Simulator, file '/Users/john/Library/Developer/Xcode/DerivedData/NilnocCalc-afoipenxsapytphgpvzuywbyzbfb/Build/Intermediates.noindex/NilnocCalc.build/Debug-iphonesimulator/NilnocCalc.build/Objects-normal/x86_64/NilnocCalc.o' An error occurred while linking NilnocCalc.pas(24,2) Error: Error while linking NilnocCalc.pas(24,2) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

Reply by email

Jonas Maebe
to Unknown author
conlin664 wrote
So, I figured I'd jump to 3.2.2

Sorry, I didn't get around yet to building and uploading the iOS cross-compiler and units for 3.2.2

As your build problem, don't start with that 3.0.5 compiler, but with plain 3.0.4 or 3.2.2 ppcx64 (or add CPU_SOURCE=x86-64 to hack around the issue)

Jonas

Reply by email

Unknown author
to Jonas Maebe

Jonas,
thanks but I'm still a little stuck.I only do this kind of thing once every 5 years or so.. sudo make FPC=/usr/local/lib/fpc/3.0.4/ppcx64 OPT="-ap -FD${IOS_BASE_BIN} -XR${IOS_BASE}" CPU_TARGET=x86_64 OS_TARGET=iphonesim CROSSOPT="-FD${IOS_BASE_BIN} -XR${IOS_BASE}" all

it seems that crt1.10.5.o  is no longer in /usr/lib for the iphone sdk when I tried to use a MacOs version, I get more conflicts..

has anyone been using fpc with the latest xcode 12.5 and Big Sur  11.4 ?

/usr/local/lib/fpc/3.0.4/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/john/Desktop/Developer/FPC/3.2.2/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE -ap -FD/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk   -dx86_64 -dGDB -dBROWSERLOG -Fux86 pp.pas ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking
pp.pas(252,36) Error: Error while linking
pp.pas(252,36) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [ppc] Error 1
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-iphonesim] Error 2

On Wednesday, June 9, 2021, 11:50:08 AM PDT, Jonas Maebe via fpc-pascal wrote:

conlin664 wrote
So, I figured I'd jump to 3.2.2

Sorry, I didn't get around yet to building and uploading the iOS cross-compiler and units for 3.2.2

As your build problem, don't start with that 3.0.5 compiler, but with plain 3.0.4 or 3.2.2 ppcx64 (or add CPU_SOURCE=x86-64 to hack around the issue)

Jonas

Reply by email

Unknown author
to Unknown author

Okay, I'm still trying to get past one issue.When trying to compile for iphonesim I get errors:

sudo /usr/local/lib/fpc/3.0.5/ppcx64      -Tiphonesim  -dIPHONEALL iPhoneAll.pas

Free Pascal Compiler version 3.0.5 [2017/11/26] for x86_64 Copyright (c) 1993-2015 by Florian Klaempfl and others Target OS: Darwin/iPhoneSim for x86_64
Compiling iPhoneAll.pas
Assembling (pipe) iPhoneAll.s

clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot] 297901 lines compiled, 1.2 sec

From using XCODE on cpp code, I believe the problem is that when invoking clangI need to be passing:

-target x86_64-apple-ios9.3-simulator
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk

But I'm not sure how fpc invokes clangor how to change any options/flags in the clang call.. can you point me in the right direction  ?
like where is -T iphonesim processed ?

thanks
john

On Wednesday, June 16, 2021, 10:43:33 AM PDT, conlin664 via fpc-pascal wrote:

Jonas,
thanks but I'm still a little stuck.I only do this kind of thing once every 5 years or so.. sudo make FPC=/usr/local/lib/fpc/3.0.4/ppcx64 OPT="-ap -FD${IOS_BASE_BIN} -XR${IOS_BASE}" CPU_TARGET=x86_64 OS_TARGET=iphonesim CROSSOPT="-FD${IOS_BASE_BIN} -XR${IOS_BASE}" all

it seems that crt1.10.5.o  is no longer in /usr/lib for the iphone sdk when I tried to use a MacOs version, I get more conflicts..

has anyone been using fpc with the latest xcode 12.5 and Big Sur  11.4 ?

/usr/local/lib/fpc/3.0.4/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/john/Desktop/Developer/FPC/3.2.2/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE -ap -FD/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/bin -XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk   -dx86_64 -dGDB -dBROWSERLOG -Fux86 pp.pas ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking
pp.pas(252,36) Error: Error while linking
pp.pas(252,36) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [ppc] Error 1
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-iphonesim] Error 2

On Wednesday, June 9, 2021, 11:50:08 AM PDT, Jonas Maebe via fpc-pascal wrote:

conlin664 wrote
So, I figured I'd jump to 3.2.2

Sorry, I didn't get around yet to building and uploading the iOS cross-compiler and units for 3.2.2

As your build problem, don't start with that 3.0.5 compiler, but with plain 3.0.4 or 3.2.2 ppcx64 (or add CPU_SOURCE=x86-64 to hack around the issue)

Jonas

Reply by email

Ng Pheng Siong
to Unknown author
conlin664 wrote
Okay, I'm still trying to get past one issue.When trying to compile for iphonesim I get errors:

I hope it is ok to follow up to an oldish thread.

I am on an Intel MBP, MacOS 10.15.7 Catalina, XCode 12.4. I installed FPC 3.2.0 from the download DMG. I then checked out fpc_source from Gitlab, and from it built a local installation for 3.2.2.

Using this 3.2.2, building the aarch64 iOS cross compiler completed, although I haven't tested it yet. But I can't get the iphonesim target to build. I've tried several combinations of the make command line (trying out stuff I see in manpages or on the web). Here's one attempt:

% echo $IOS_SDK
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk % make FPC="<my local ppcx64>" \
CROSSOPT="-ap -XR${IOS_SDK} -ao-isysroot${IOS_SDK} -k\"-syslibroot ${IOS_SDK}\"" \ CPU_TARGET=x86_64 OS_TARGET=iphonesim \
CPU_SOURCE=x86_64 OS_SOURCE=darwin \
all
<some minutes later>
/Users/ngps/src/fpc_source/compiler/ppcrossx64 -Tiphonesim -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/ngps/src/fpc_source/rtl/units/x86_64-iphonesim -Fix86_64 -FEx86_64/bin/x86_64-iphonesim -FUx86_64/units/x86_64-iphonesim -dRELEASE -ap -XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -ao-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -k"-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" -DD2021/09/20 -dx86_64 -dGDB -Fux86 -Fix86 -Sew -o/Users/ngps/src/fpc_source/compiler/ppcx64 pp.pas ld: building for iOS, but linking in object file built for iOS Simulator, file 'x86_64/units/x86_64-iphonesim/pp.o' pp.pas(288,36) Error: Error while linking
pp.pas(288,36) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[3]: *** [ppcx64] Error 1
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-iphonesim] Error 2

Here's the error:

ld: building for iOS, but linking in object file built for iOS Simulator, file 'x86_64/units/x86_64-iphonesim/pp.o'

Any hints appreciated.

Pheng

Reply by email

Jonas Maebe
to Ng Pheng Siong
Ng Pheng Siong wrote 13 lines
/Users/ngps/src/fpc_source/compiler/ppcrossx64 -Tiphonesim -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/Users/ngps/src/fpc_source/rtl/units/x86_64-iphonesim -Fix86_64 -FEx86_64/bin/x86_64-iphonesim -FUx86_64/units/x86_64-iphonesim -dRELEASE -ap -XR/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -ao-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -k"-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" -DD2021/09/20 -dx86_64 -dGDB -Fux86 -Fix86 -Sew -o/Users/ngps/src/fpc_source/compiler/ppcx64 pp.pas ld: building for iOS, but linking in object file built for iOS Simulator, file 'x86_64/units/x86_64-iphonesim/pp.o' pp.pas(288,36) Error: Error while linking pp.pas(288,36) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[3]: *** [ppcx64] Error 1 make[2]: *** [cycle] Error 2 make[1]: *** [compiler_cycle] Error 2 make: *** [build-stamp.x86_64-iphonesim] Error 2 Here's the error: ld: building for iOS, but linking in object file built for iOS Simulator, file 'x86_64/units/x86_64-iphonesim/pp.o'

I've finally looked into this and found the error: the compiler has to specify -ios_simulator_version_min rather than -iphoneos_version_min to the linker when targeting the simulator. This is fixed in latest trunk and in the fixes_3_2 branch.

You might be able to also work around it on 3.2.2 by adding CROSSOPT="-k-ios_simulator_version_min -9.0" to the make command line, and also add those parameters when compiling a program for the iphonesim target.

Jonas

Reply by email