Recent

Author Topic: FPC console executables on Arch have blank output  (Read 1979 times)

Laphicet

  • New member
  • *
  • Posts: 9
FPC console executables on Arch have blank output
« on: September 03, 2022, 10:25:55 pm »
So I've been trying to code with FPC on Arch. The compiler and its tools are fine, but when I compile and run so much as a "Hello, world" program, nothing is output to the terminal when executed. I even copy and pasted a Tao Yue code snippet to see if I did something wrong missed by the compiler. That, too, was not output. C code works, Rust code works, but for some reason not FPC. The compiler issues no warnings or errors on it.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: FPC console executables on Arch have blank output
« Reply #1 on: September 03, 2022, 10:42:02 pm »
(1) Put a concise example in code tags, (2) say exactly how you're compiling and running it, (3) say in the body of your message what version of FPC etc. you're using.

If those are missing we quite simply don't have enough info to help.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11353
  • FPC developer.
Re: FPC console executables on Arch have blank output
« Reply #2 on: September 03, 2022, 11:47:46 pm »
You could also try to strace it to see what is happening.

And avoid unit crt for these tests, that is a special case.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: FPC console executables on Arch have blank output
« Reply #3 on: September 04, 2022, 02:52:53 am »
To be obsessively clear Laphicet, you are doing this -

https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Testing_the_FPC_Install   ?

What way have you used to install the compiler ? ie, from Arch repos or from means described further up on page linked to above ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 14169
  • Probably until I exterminate Putin.
Re: FPC console executables on Arch have blank output
« Reply #4 on: September 04, 2022, 01:38:54 pm »
Or AARCH vs ARCH linux?
Specialize a type, not a var.

Bogen85

  • Hero Member
  • *****
  • Posts: 595
Re: FPC console executables on Arch have blank output
« Reply #5 on: September 28, 2022, 08:02:43 pm »
FPC on Arch Linux x86_64 works.
FPC on a Aarch64 Linux works.

Waiting on @Laphicet's feedback from previous questions...

Code: Pascal  [Select][+][-]
  1. program hellofpcworld;
  2.  
  3. begin
  4.   writeln('Hello FPC world!');
  5. end.
  6.  

This is on Arch Linux x86_64
Code: Text  [Select][+][-]
  1. $ fpc lazforum/hellofpcworld.pas
  2. Free Pascal Compiler version 3.3.1 [2022/09/26] for x86_64
  3. Copyright (c) 1993-2022 by Florian Klaempfl and others
  4. Target OS: Linux for x86-64
  5. Compiling lazforum/hellofpcworld.pas
  6. Linking lazforum/hellofpcworld
  7. 5 lines compiled, 0.1 sec, 141968 bytes code, 54216 bytes data
  8.  
  9. ./lazforum/hellofpcworld
  10. Hello FPC world!
  11.  
  12. $ cat /etc/os-release
  13. NAME="Arch Linux"
  14. PRETTY_NAME="Arch Linux"
  15. ID=arch
  16. BUILD_ID=rolling
  17. ANSI_COLOR="38;2;23;147;209"
  18. HOME_URL="https://archlinux.org/"
  19. DOCUMENTATION_URL="https://wiki.archlinux.org/"
  20. SUPPORT_URL="https://bbs.archlinux.org/"
  21. BUG_REPORT_URL="https://bugs.archlinux.org/"
  22. LOGO=archlinux-logo
  23.  

This is on AlmaLinux 9 aarch64
Code: Text  [Select][+][-]
  1. $ fpc ./lazforum/hellofpcworld.pas
  2. Free Pascal Compiler version 3.2.2 [2022/08/17] for aarch64
  3. Copyright (c) 1993-2021 by Florian Klaempfl and others
  4. Target OS: Linux for AArch64
  5. Compiling ./lazforum/hellofpcworld.pas
  6. Assembling hellofpcworld
  7. Linking ./lazforum/hellofpcworld
  8. 5 lines compiled, 0.1 sec
  9. Wed 28Sep22 12:58:12 /home/shared-development/fedora-almalinux-live-installers
  10.  
  11. ./lazforum/hellofpcworld
  12. Hello FPC world!
  13. Wed 28Sep22 12:58:24 /home/shared-development/fedora-almalinux-live-installers
  14.  
  15. $ cat /etc/os-release
  16. NAME="AlmaLinux"
  17. VERSION="9.0 (Emerald Puma)"
  18. ID="almalinux"
  19. ID_LIKE="rhel centos fedora"
  20. VERSION_ID="9.0"
  21. PLATFORM_ID="platform:el9"
  22. PRETTY_NAME="AlmaLinux 9.0 (Emerald Puma)"
  23. ANSI_COLOR="0;34"
  24. LOGO="fedora-logo-icon"
  25. CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
  26. HOME_URL="https://almalinux.org/"
  27. DOCUMENTATION_URL="https://wiki.almalinux.org/"
  28. BUG_REPORT_URL="https://bugs.almalinux.org/"
  29.  
  30. ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
  31. ALMALINUX_MANTISBT_PROJECT_VERSION="9.0"
  32. REDHAT_SUPPORT_PRODUCT="AlmaLinux"
  33. REDHAT_SUPPORT_PRODUCT_VERSION="9.0"
  34.  

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: FPC console executables on Arch have blank output
« Reply #6 on: September 28, 2022, 08:14:29 pm »
FPC on Arch Linux x86_64 works.
FPC on a Aarch64 Linux works.

Thanks for doing that. Comparatively few of us run Arch- although at least the Linux users are obviously very much aware of it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: FPC console executables on Arch have blank output
« Reply #7 on: September 28, 2022, 09:53:16 pm »
FPC on Arch Linux x86_64 works.
FPC on a Aarch64 Linux works.
ARM32 - +
ARM64 - +
yes. Its Works.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: FPC console executables on Arch have blank output
« Reply #8 on: September 29, 2022, 09:09:42 am »
FPC on Arch Linux x86_64 works.
FPC on a Aarch64 Linux works.

Thanks for doing that. Comparatively few of us run Arch- although at least the Linux users are obviously very much aware of it.

I run Arch. Both natively on x86_64 and aarch64 and on WSL. :D

MarkMLl

  • Hero Member
  • *****
  • Posts: 6647
Re: FPC console executables on Arch have blank output
« Reply #9 on: September 29, 2022, 10:41:50 am »
I run Arch. Both natively on x86_64 and aarch64 and on WSL. :D

Yeah well, you're incomparable (in terms of your knowledge of the innards of FPC etc.) even if there are areas in which we disagree :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

colo

  • New Member
  • *
  • Posts: 41
Re: FPC console executables on Arch have blank output
« Reply #10 on: October 02, 2022, 06:50:58 pm »
So I've been trying to code with FPC on Arch. The compiler and its tools are fine, but when I compile and run so much as a "Hello, world" program, nothing is output to the terminal when executed. I even copy and pasted a Tao Yue code snippet to see if I did something wrong missed by the compiler. That, too, was not output.

Can you provide a transcript of your "Hello, world" toy programs executing under strace(1)?

For reference, on my Arch Linux x86_84 system:

Code: [Select]
$ cat hello.pas
program hellofpcworld;
 
begin
  writeln('Hello FPC world!');
end.
$ fpc hello.pas >/dev/null
$ ./hello
Hello FPC world!
$ strace ./hello
execve("./hello", ["./hello"], 0x7ffe79d8f2c0 /* 45 vars */) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
rt_sigaction(SIGFPE, {sa_handler=0x423290, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x401280}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x423290, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x401280}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x423290, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x401280}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGILL, {sa_handler=0x423290, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x401280}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
readlink("/proc/self/exe", "/tmp/hello", 255) = 10
write(1, "Hello FPC world!\n", 17Hello FPC world!
)      = 17
exit_group(0)                           = ?
+++ exited with 0 +++

 

TinyPortal © 2005-2018