Recent

Author Topic: FPC Manual Build - Segmentation Fault.  (Read 655 times)

lambdacoresw

  • Newbie
  • Posts: 2
FPC Manual Build - Segmentation Fault.
« on: February 23, 2026, 10:07:23 pm »
Hi,
I want to build 3.2.2 from the source but I get error. How can I solve this?
Code: Bash  [Select][+][-]
  1. #!/bin/bash
  2.  
  3. INSTALL_PREFIX="/home/freeman/BACKUP/freepascal/FPC322"
  4. BOOTSTRAP_FPC="/home/freeman/BACKUP/freepascal/FPC304/bin/fpc"
  5.  
  6. SOURCE_DIR="/home/freeman/BACKUP/freepascal/source"
  7. LOG_FILE="$SOURCE_DIR/build.log"
  8.  
  9. echo "Derleme süreci başlatılıyor..."
  10. echo "Kaynak Dizini: $SOURCE_DIR"
  11. echo "Yükleme Dizini: $INSTALL_PREFIX"
  12. echo "Bootstrap Derleyicisi: $BOOTSTRAP_FPC"
  13.  
  14. # 1. Temizlik
  15. echo "Adım 1: Eski dosyalar temizleniyor (make distclean)..."
  16. make distclean PP=$BOOTSTRAP_FPC
  17.  
  18. # 2. Derleme
  19. echo "Adım 2: Derleme başlatılıyor, detaylar build.log dosyasına yazılıyor..."
  20. # Daha kararlı olması için optimizasyon seviyesi düşürüldü ve versiyon kontrolü esnetildi
  21. make all PP=$BOOTSTRAP_FPC OVERRIDEVERSIONCHECK=1 > "$LOG_FILE" 2>&1
  22.  
  23.  
  24. if [ $? -eq 0 ]; then
  25.     echo "Derleme başarılı! Sonuçlar build.log dosyasına kaydedildi."
  26. else
  27.     echo "Derleme HATASI! Lütfen build.log dosyasını kontrol edin."
  28.     exit 1
  29. fi
  30.  
  31. # 3. Yükleme
  32. echo "Adım 3: Belirtilen dizine yükleniyor ($INSTALL_PREFIX)..."
  33. make install INSTALL_PREFIX="$INSTALL_PREFIX" PP=$BOOTSTRAP_FPC
  34.  
  35. if [ $? -eq 0 ]; then
  36.     echo "Yükleme tamamlandı: $INSTALL_PREFIX"
  37. else
  38.     echo "Yükleme sırasında hata oluştu!"
  39.     exit 1
  40. fi
  41.  
  42. echo "İşlem başarıyla tamamlandı."
  43.  
  44.  

And here is build log:


https://pastes.io/buildlog

My system:
Code: [Select]
uname -a
Linux blackmesa 6.17.0-14-generic #14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2 x86_64 x86_64 x86_64 GNU/Linux


and my directory structure is:
Code: [Select]
tree -L 1 .
.
├── FPC304
├── fpc-3.0.4.x86_64-linux.tar
├── FPC322
├── fpc-3.2.2.source.tar.gz
├── fpcdocs
├── projects
└── source

6 directories, 2 files


Thanks.

Thausand

  • Hero Member
  • *****
  • Posts: 501
Re: FPC Manual Build - Segmentation Fault.
« Reply #1 on: February 23, 2026, 10:24:44 pm »
I want to build 3.2.2 from the source but I get error. How can I solve this?
Make use 3.2.0 for bootstrap compiler for compile 3.2.2. Only have need ppcx64 executable and can download sourceforge (https://sourceforge.net/projects/freepascal/files/Linux/3.2.0/fpc-3.2.0-x86_64-linux.tar/download)

3.2.2 not support 3.0.4 bootstrap compiler, if work then lucky.

lambdacoresw

  • Newbie
  • Posts: 2
Re: FPC Manual Build - Segmentation Fault.
« Reply #2 on: February 23, 2026, 10:38:50 pm »
Ohh, thank you very much. The Makefile had told me to use version 3.0.4, so I was trying that. When I tried 3.2.0 as the bootstrap compiler, the build process completed successfully.

Thanks again. I am appreciated.

n7800

  • Hero Member
  • *****
  • Posts: 683
  • Lazarus IDE contributor
    • GitLab profile
Re: FPC Manual Build - Segmentation Fault.
« Reply #3 on: February 24, 2026, 11:39:00 pm »
The Makefile had told me to use version 3.0.4, so I was trying that. When I tried 3.2.0 as the bootstrap compiler, the build process completed successfully.

Where did you get the source code? That's strange, I see the version is correct for the release tag in Git. There's a commit with a version fix, but it's included in that tag...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12302
  • Debugger - SynEdit - and more
    • wiki
Re: FPC Manual Build - Segmentation Fault.
« Reply #4 on: February 25, 2026, 12:31:50 am »
You are trying to build with 3.0.4 => that is not supported.

The OVERRIDEVERSIONCHECK is no guarantee for this to work. In fact the version check happens because it will fail in many cases.

To be honest, I am surprised you get as far as the log says you got... I would have thought an error to happen way earlier.

Quote
Code: Text  [Select][+][-]
  1. /home/freeman/BACKUP/freepascal/source/compiler/ppc1 -Ur -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 -Fi../unix -Fix86_64 -FE. -FU/home/freeman/BACKUP/freepascal/source/rtl/units/x86_64-linux -Cg -O1 -dx86_64 -dRELEASE  -Us -Sg system.pp
  2. make[7]: *** [Makefile:3848: system.ppu] Segmentation fault

It looks like you made it through the first "cycle". I would have thought that it may bail out before with some error. But it created a ppc1.
Though given that this crashes, it created this with errors.

I don't know the kind of error, and I recommend a newer version of fpc as start-compiler.
But if you insist on trying then try
   OPTNEW="-O-"
I have no idea if it will help at all. It may not. It would be pure luck. And even if it does compile all the way, then it does not mean the result is correct (i.e. without bugs due to the old starting compiler).

 

TinyPortal © 2005-2018