Recent

Author Topic: Recompile FPC on Mac OS Sonoma  (Read 674 times)

Odacir

  • Jr. Member
  • **
  • Posts: 53
Recompile FPC on Mac OS Sonoma
« on: May 19, 2024, 07:22:39 pm »
I need recompile the FPC because a modification on openssl, to suport TLS 1.2, but i don't know how to-do this on Mac.

I instaled lazarus using the packages:
fpc-2.3.3.intelarm64-macosx.dmg
fpc-src-3.2.2-20210709-macosx.dmg
Lazarus-2.2.2-0-x86_64-macosx.pkg

 

TRon

  • Hero Member
  • *****
  • Posts: 2801
Re: Recompile FPC on Mac OS Sonoma
« Reply #1 on: May 19, 2024, 07:40:11 pm »
I need recompile the FPC because a modification on openssl, to suport TLS 1.2, but i don't know how to-do this on Mac.
That depends on the changes. Are they your changes or are they changes that where made in trunk ?

In case the latter it is probably the easiest to use FPCUpDeluxe and build a FPC trunk compiler.

In case the former then things can become a tad more complicated because there are several approaches possible:
- either a complete build of a modified compiler and its packages, in which case it is important tot know for which version of the compiler the modifications were made (because you need a startup compiler). See also buildfaq.
- or rebuild the package(s) that are depending on the change(s). You could even do that manually and let your modified package take precedence over the default compiler package.

So, more information is required on the changes themselves and/or on how you wish to pursue.


Odacir

  • Jr. Member
  • **
  • Posts: 53
Re: Recompile FPC on Mac OS Sonoma
« Reply #2 on: May 19, 2024, 08:21:22 pm »
I need solve this problem, (this exactly post show the solution):

https://forum.lazarus.freepascal.org/index.php/topic,58392.msg434948.html#msg434948

I tryed make the
make all on the folder fpcsrc, but i receive a error while linking.

Last lines:

Quote
/usr/local/bin/ppcx64 -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/usr/local/share/fpcsrc/rtl/units/x86_64-darwin -dx86_64 -dRELEASE ../inc/objcbase.pp
/Library/Developer/CommandLineTools/usr/bin/make cycleclean compiler
/bin/rm -f pp pp.o libppp.a libimppp.a
/bin/rm -rf units
/bin/rm -rf bin
/bin/rm -f *.o *.ppu *.rst *.s *.a *.so *.ppl
/bin/rm -rf *.sl
/bin/rm -f fpcmade.* Package.fpc ./ppas.sh script.res link.res 
/bin/rm -f *_ppas.sh ppas.sh ppaslink.sh
/Library/Developer/CommandLineTools/usr/bin/make -C utils cleanall
/bin/rm -f fpc ppufiles ppudump ppumove mka64ins mkarmins mkx86ins fpc.o ppufiles.o ppudump.o ppumove.o mka64ins.o mkarmins.o mkx86ins.o libpfpc.a libpppufiles.a libpppudump.a libpppumove.a libpmka64ins.a libpmkarmins.a libpmkx86ins.a libimpfpc.a libimpppufiles.a libimpppudump.a libimpppumove.a libimpmka64ins.a libimpmkarmins.a libimpmkx86ins.a
/bin/rm -f units/x86_64-darwin/ppu.ppu units/x86_64-darwin/crc.ppu
/bin/rm -rf units
/bin/rm -rf bin
/bin/rm -f *.o *.ppu *.rst *.s *.a *.so *.ppl
/bin/rm -rf *.sl
/bin/rm -f fpcmade.* Package.fpc ./ppas.sh script.res link.res 
/bin/rm -f *_ppas.sh ppas.sh ppaslink.sh
/bin/rm -rf x86_64/units
/bin/rm -rf x86_64/bin
/bin/rm -f x86_64/*.o x86_64/*.ppu x86_64/*.rst x86_64/*.s x86_64/*.a x86_64/*.so x86_64/*.ppl
/bin/rm -f x86_64/ppc386 x86_64/ppc68k x86_64/ppcppc x86_64/ppcsparc x86_64/ppcarm x86_64/ppcarmeb x86_64/ppcx64 x86_64/ppcppc64 x86_64/ppcmips x86_64/ppcmipsel x86_64/ppcavr x86_64/ppcjvm x86_64/ppc8086 x86_64/ppca64 x86_64/ppcsparc64
/bin/rm -f ppcx64
/bin/mkdir -p x86_64/units/x86_64-darwin
/usr/local/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems -Fu/usr/local/share/fpcsrc/rtl/units/x86_64-darwin -Fix86_64 -FE. -FUx86_64/units/x86_64-darwin -dRELEASE    -dx86_64 -dGDB -dBROWSERLOG -Fux86 pp.pas
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: library 'c' not found
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[5]: *** [ppcx64] Error 1
make[4]: *** [next] Error 2
make[3]: *** [ppc1] Error 2
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-darwin] Error 2

All i need is get an URL with TSL 1.2 on Mac :( but have this problem.

PierceNg

  • Sr. Member
  • ****
  • Posts: 377
    • SamadhiWeb
Re: Recompile FPC on Mac OS Sonoma
« Reply #3 on: May 20, 2024, 03:01:19 am »
I tryed make the
make all on the folder fpcsrc, but i receive a error while linking.

Try what the wiki says: https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Installing_from_source_2

TRon

  • Hero Member
  • *****
  • Posts: 2801
Re: Recompile FPC on Mac OS Sonoma
« Reply #4 on: May 20, 2024, 10:00:24 am »
make all on the folder fpcsrc, but i receive a error while linking.
The error message you showed(linking error against libc)  seems to indicate that you do not have codetools installed correctly (or (pointing to) the wrong version).

Anyhows: the compiler is unable to locate the library to be able to link against.

Same link as PierceNg shared but a couple of lines above that.

Note that if you made your changes against 3.2.2 ad in case building the complete compiler that you need the previous point release as starting compiler (ppc) to compile your (modified) FPC sources.
« Last Edit: May 20, 2024, 10:18:33 am by TRon »

 

TinyPortal © 2005-2018