Recent

Author Topic: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found  (Read 1730 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #15 on: November 07, 2024, 04:44:35 pm »
Did you already had a chance to try the option that was suggested by MarcoV and/or try a cross-build ? (both might be worth a shot).

Not yet on the native rpi and for cross-build I have to study how to do it this week-end...  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3619
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #16 on: November 07, 2024, 05:08:16 pm »
Not yet on the native rpi and for cross-build I have to study how to do it this week-end...  ;)
Ok, no problem.

Just take your time to understand how to do a cross-build. It is valuable knowledge (even though in practice it is used only once in a while).
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #17 on: November 07, 2024, 05:16:56 pm »
Not yet on the native rpi and for cross-build I have to study how to do it this week-end...  ;)
Ok, no problem.

Just take your time to understand how to do a cross-build. It is valuable knowledge (even though in practice it is used only once in a while).

I use the precious fpcupdeluxe to cross-compile since decades for all my apps but I was never able to cross-compile fpc src himself.  :'(
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Thaddy

  • Hero Member
  • *****
  • Posts: 16138
  • Censorship about opinions does not belong here.
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #18 on: November 07, 2024, 06:04:42 pm »
I can do that since rpi 1. maybe discuss in private?
The most important thing is getting the right toolchain.
If I smell bad code it usually is bad code and that includes my own code.

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #19 on: November 07, 2024, 06:49:00 pm »
I can do that since rpi 1. maybe discuss in private?
The most important thing is getting the right toolchain.
Or maybe it could be interesting for others too?  ;)
About the toolchain, the one from magic fpcupdeluxe works perfectly here (for all my apps, apart fpc-src of course).

Even better, to cross-compile from Linux to MacOS no need to be annoyed to install XCode, fpcupdeluxe has all needed...  :P
But this is for fpc-apps, not for fpc-src himself.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #20 on: November 07, 2024, 11:23:14 pm »
Did you already had a chance to try the option that was suggested by MarcoV and/or try a cross-build ? (both might be worth a shot).

OK, I did try on native Rpi to compile fpc 3.2.4 + libc symbol table with OPT="-Aas" and there is still the same error from assembler.  :-\

[EDIT] Did try on rpi with 2024-10-22-raspios-bullseye-arm64 but same error.
« Last Edit: November 08, 2024, 01:27:09 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #21 on: November 08, 2024, 06:37:51 am »
Some news from the front.

It's not just fpc-src that can't compile when assigning a symbol table.

This code doesn't compile on native rpi or with cross-compile:
Code: Pascal  [Select][+][-]
  1. program testaarch64;
  2. procedure free(__ptr:pointer);cdecl;external 'c' name 'free@GLIBC_2.17';
  3. begin
  4. free(nil);
  5. end.

Cross-compiled from Linux amd64 with:
Code: Bash  [Select][+][-]
  1. $ ppcrossa64 testaarch64.pas

Gives that error:
Code: Pascal  [Select][+][-]
  1. Free Pascal Compiler version 3.2.3-1397-g22da36f83e [2024/07/30] for aarch64
  2. Copyright (c) 1993-2024 by Florian Klaempfl and others
  3. Target OS: Linux for AArch64
  4. Compiling testaarch64.pas
  5. Assembling testaarch64
  6. testaarch64.s: Assembler messages:
  7. testaarch64.s:16: Error: unexpected characters following instruction at operand 1 -- `bl free@GLIBC_2.17'
  8. testaarch64.pas(5,4) Error: Error while assembling exitcode 1
  9. testaarch64.pas(5,4) Fatal: There were 2 errors compiling module, stopping
  10. Fatal: Compilation aborted

 %)

Note that this code with direct compile on Linux amd64:
Code: Pascal  [Select][+][-]
  1. program testamd64;
  2. procedure free(__ptr:pointer);cdecl;external 'c' name 'free@GLIBC_2.2.5';
  3. begin
  4. free(nil);
  5. end.

Compiled with this is ok:
Code: Pascal  [Select][+][-]
  1. $ fpc testamd64.pas

Note also that I was able to cross-compile fpc-source form Linux amd64 to aarch64 but get the same error when some libc methods have symbol table.
« Last Edit: November 08, 2024, 08:30:27 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3619
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #22 on: November 08, 2024, 06:47:51 pm »
Yes, confirmed on pi native with 3.2.4rc1 Fred.

Code: ASM  [Select][+][-]
  1.         .file "testaarch64.pas"
  2. // Begin asmlist al_procedures
  3.  
  4. .section .text.n_main
  5.         .balign 8
  6. .globl  PASCALMAIN
  7.         .type   PASCALMAIN,@function
  8. PASCALMAIN:
  9. .globl  main
  10.         .type   main,@function
  11. main:
  12.         stp     x29,x30,[sp, #-16]!
  13.         mov     x29,sp
  14.         bl      fpc_initializeunits
  15.         movz    x0,#0
  16.         bl      free@GLIBC_2.17
  17.         bl      fpc_do_exit
  18.         ldp     x29,x30,[sp], #16
  19.         ret
  20. .Le0:
  21.         .size   main, .Le0 - main
  22.  
  23. .section .text
  24. // End asmlist al_procedures
  25. // Begin asmlist al_globals
  26.  
  27. .section .data.n_INITFINAL
  28.         .balign 8
  29. .globl  INITFINAL
  30.         .type   INITFINAL,@object
  31. INITFINAL:
  32.         .quad   1,0
  33.         .quad   INIT$_$SYSTEM
  34.         .quad   0
  35. .Le1:
  36.         .size   INITFINAL, .Le1 - INITFINAL
  37.  
  38. .section .data.n_FPC_THREADVARTABLES
  39.         .balign 8
  40. .globl  FPC_THREADVARTABLES
  41.         .type   FPC_THREADVARTABLES,@object
  42. FPC_THREADVARTABLES:
  43.         .long   1
  44.         .quad   THREADVARLIST_$SYSTEM$indirect
  45. .Le2:
  46.         .size   FPC_THREADVARTABLES, .Le2 - FPC_THREADVARTABLES
  47.  
  48. .section .data.n_FPC_RESOURCESTRINGTABLES
  49.         .balign 8
  50. .globl  FPC_RESOURCESTRINGTABLES
  51.         .type   FPC_RESOURCESTRINGTABLES,@object
  52. FPC_RESOURCESTRINGTABLES:
  53.         .quad   0
  54. .Le3:
  55.         .size   FPC_RESOURCESTRINGTABLES, .Le3 - FPC_RESOURCESTRINGTABLES
  56.  
  57. .section .data.n_FPC_WIDEINITTABLES
  58.         .balign 8
  59. .globl  FPC_WIDEINITTABLES
  60.         .type   FPC_WIDEINITTABLES,@object
  61. FPC_WIDEINITTABLES:
  62.         .quad   0
  63. .Le4:
  64.         .size   FPC_WIDEINITTABLES, .Le4 - FPC_WIDEINITTABLES
  65.  
  66. .section .data.n_FPC_RESSTRINITTABLES
  67.         .balign 8
  68. .globl  FPC_RESSTRINITTABLES
  69.         .type   FPC_RESSTRINITTABLES,@object
  70. FPC_RESSTRINITTABLES:
  71.         .quad   0
  72. .Le5:
  73.         .size   FPC_RESSTRINITTABLES, .Le5 - FPC_RESSTRINITTABLES
  74.  
  75. .section .fpc.n_version
  76.         .balign 16
  77.         .type   __fpc_ident,@object
  78. __fpc_ident:
  79.         .ascii  "FPC 3.2.4-rc1 [2024/09/23] for aarch64 - Linux"
  80. .Le6:
  81.         .size   __fpc_ident, .Le6 - __fpc_ident
  82.  
  83. .section .data.n___stklen
  84.         .balign 8
  85. .globl  __stklen
  86.         .type   __stklen,@object
  87. __stklen:
  88.         .quad   8388608
  89. .Le7:
  90.         .size   __stklen, .Le7 - __stklen
  91.  
  92. .section .data.n___heapsize
  93.         .balign 8
  94. .globl  __heapsize
  95.         .type   __heapsize,@object
  96. __heapsize:
  97.         .quad   0
  98. .Le8:
  99.         .size   __heapsize, .Le8 - __heapsize
  100.  
  101. .section .data.n___fpc_valgrind
  102.         .balign 8
  103. .globl  __fpc_valgrind
  104.         .type   __fpc_valgrind,@object
  105. __fpc_valgrind:
  106.         .byte   0
  107. .Le9:
  108.         .size   __fpc_valgrind, .Le9 - __fpc_valgrind
  109.  
  110. .section .data.n_FPC_RESLOCATION
  111.         .balign 8
  112. .globl  FPC_RESLOCATION
  113.         .type   FPC_RESLOCATION,@object
  114. FPC_RESLOCATION:
  115.         .quad   0
  116. .Le10:
  117.         .size   FPC_RESLOCATION, .Le10 - FPC_RESLOCATION
  118. // End asmlist al_globals
  119. .section .note.GNU-stack,"",%progbits
  120.  

edit:
Quote
Note that this code with direct compile on Linux amd64:

FWIW:
Code: Bash  [Select][+][-]
  1. $ fpc -B -a testx86_64.pas
  2. Free Pascal Compiler version 3.2.3 [2024/09/23] for x86_64
  3. Copyright (c) 1993-2024 by Florian Klaempfl and others
  4. Note: Switching assembler to default source writing assembler
  5. Target OS: Linux for x86-64
  6. Compiling testx86_64.pas
  7. Assembling testx86_64
  8. testx86_64.s: Assembler messages:
  9. testx86_64.s:21: Error: junk `@GLIBC_2.2.5' after expression
  10. Error: Error while assembling exitcode 1
  11. Fatal: There were 2 errors compiling module, stopping
  12. Fatal: Compilation aborted
  13. Error: ppcx64 returned an error exitcode
  14.  
« Last Edit: November 08, 2024, 07:35:26 pm by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #23 on: November 08, 2024, 07:37:24 pm »
Yes, confirmed on pi native with 3.2.4rc1 Fred.

Code: ASM  [Select][+][-]
  1.         .file "testaarch64.pas"
  2. // Begin asmlist al_procedures
  3.  
  4. .section .text.n_main
  5.         .balign 8
  6. .globl  PASCALMAIN
  7.         .type   PASCALMAIN,@function
  8. PASCALMAIN:
  9. .globl  main
  10.         .type   main,@function
  11. main:
  12.         stp     x29,x30,[sp, #-16]!
  13.         mov     x29,sp
  14.         bl      fpc_initializeunits
  15.         movz    x0,#0
  16.         bl      free@GLIBC_2.17
  17.         bl      fpc_do_exit
  18.         ldp     x29,x30,[sp], #16
  19.         ret
  20. .Le0:
  21.         .size   main, .Le0 - main
  22.  
  23. .section .text
  24. // End asmlist al_procedures
  25. // Begin asmlist al_globals
  26.  
  27. .section .data.n_INITFINAL
  28.         .balign 8
  29. .globl  INITFINAL
  30.         .type   INITFINAL,@object
  31. INITFINAL:
  32.         .quad   1,0
  33.         .quad   INIT$_$SYSTEM
  34.         .quad   0
  35. .Le1:
  36.         .size   INITFINAL, .Le1 - INITFINAL
  37.  
  38. .section .data.n_FPC_THREADVARTABLES
  39.         .balign 8
  40. .globl  FPC_THREADVARTABLES
  41.         .type   FPC_THREADVARTABLES,@object
  42. FPC_THREADVARTABLES:
  43.         .long   1
  44.         .quad   THREADVARLIST_$SYSTEM$indirect
  45. .Le2:
  46.         .size   FPC_THREADVARTABLES, .Le2 - FPC_THREADVARTABLES
  47.  
  48. .section .data.n_FPC_RESOURCESTRINGTABLES
  49.         .balign 8
  50. .globl  FPC_RESOURCESTRINGTABLES
  51.         .type   FPC_RESOURCESTRINGTABLES,@object
  52. FPC_RESOURCESTRINGTABLES:
  53.         .quad   0
  54. .Le3:
  55.         .size   FPC_RESOURCESTRINGTABLES, .Le3 - FPC_RESOURCESTRINGTABLES
  56.  
  57. .section .data.n_FPC_WIDEINITTABLES
  58.         .balign 8
  59. .globl  FPC_WIDEINITTABLES
  60.         .type   FPC_WIDEINITTABLES,@object
  61. FPC_WIDEINITTABLES:
  62.         .quad   0
  63. .Le4:
  64.         .size   FPC_WIDEINITTABLES, .Le4 - FPC_WIDEINITTABLES
  65.  
  66. .section .data.n_FPC_RESSTRINITTABLES
  67.         .balign 8
  68. .globl  FPC_RESSTRINITTABLES
  69.         .type   FPC_RESSTRINITTABLES,@object
  70. FPC_RESSTRINITTABLES:
  71.         .quad   0
  72. .Le5:
  73.         .size   FPC_RESSTRINITTABLES, .Le5 - FPC_RESSTRINITTABLES
  74.  
  75. .section .fpc.n_version
  76.         .balign 16
  77.         .type   __fpc_ident,@object
  78. __fpc_ident:
  79.         .ascii  "FPC 3.2.4-rc1 [2024/09/23] for aarch64 - Linux"
  80. .Le6:
  81.         .size   __fpc_ident, .Le6 - __fpc_ident
  82.  
  83. .section .data.n___stklen
  84.         .balign 8
  85. .globl  __stklen
  86.         .type   __stklen,@object
  87. __stklen:
  88.         .quad   8388608
  89. .Le7:
  90.         .size   __stklen, .Le7 - __stklen
  91.  
  92. .section .data.n___heapsize
  93.         .balign 8
  94. .globl  __heapsize
  95.         .type   __heapsize,@object
  96. __heapsize:
  97.         .quad   0
  98. .Le8:
  99.         .size   __heapsize, .Le8 - __heapsize
  100.  
  101. .section .data.n___fpc_valgrind
  102.         .balign 8
  103. .globl  __fpc_valgrind
  104.         .type   __fpc_valgrind,@object
  105. __fpc_valgrind:
  106.         .byte   0
  107. .Le9:
  108.         .size   __fpc_valgrind, .Le9 - __fpc_valgrind
  109.  
  110. .section .data.n_FPC_RESLOCATION
  111.         .balign 8
  112. .globl  FPC_RESLOCATION
  113.         .type   FPC_RESLOCATION,@object
  114. FPC_RESLOCATION:
  115.         .quad   0
  116. .Le10:
  117.         .size   FPC_RESLOCATION, .Le10 - FPC_RESLOCATION
  118. // End asmlist al_globals
  119. .section .note.GNU-stack,"",%progbits
  120.  

Note that the first post talk about /lib/arm-linux-gnueabihf/libc.so.6 and this is the arm cpu 32 bit.
And it that case assigning symbol table is ok.

Thanks to jump into this TRon.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #24 on: November 08, 2024, 08:05:05 pm »
edit:
Quote
Note that this code with direct compile on Linux amd64:

FWIW:
...

Ooops I did not see that.

Sorry but I don't understand what this means.  :-\

with this on x86_64 it compiles and runs ok.
Code: Pascal  [Select][+][-]
  1. $ fpc -B testx86_64.pas

But with this I get error at compil, like you:
Code: Pascal  [Select][+][-]
  1. $ fpc -B -a testx86_64.pas

 %)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11930
  • FPC developer.
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #25 on: November 09, 2024, 05:49:30 pm »
-a is with the external assembler. So apparently GAS doesn't grok your symbol stuff, while the FPC internal assembler either ignores or processes it.

Fred vS

  • Hero Member
  • *****
  • Posts: 3410
    • StrumPract is the musicians best friend
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #26 on: November 09, 2024, 06:32:17 pm »
-a is with the external assembler. So apparently GAS doesn't grok your symbol stuff, while the FPC internal assembler either ignores or processes it.

For Linux on i386, x86_64 and ARM32 the FPC internal assembler processes perfectly:

Compiled with "official" fpc:
Code: Pascal  [Select][+][-]
  1. $ nm -D  testx86_64
  2.                  U free@GLIBC_2.2.5
  3.                  w __gmon_start__
  4.                  U __libc_start_main@GLIBC_2.34

Compiled with "patched" fpc-ootb:
Code: Pascal  [Select][+][-]
  1. $ nm -D  testx86_64
  2.                  U free@GLIBC_2.2.5
  3.                  w __gmon_start__
  4.                  U __libc_start_main@GLIBC_2.2.5
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3619
Re: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found
« Reply #27 on: November 10, 2024, 04:57:21 am »
-a is with the external assembler. So apparently GAS doesn't grok your symbol stuff, while the FPC internal assembler either ignores or processes it.
Since -Aelf is illegal option for aarch64 shouldn't the generated assembler use .symver declaration for the asm output ?

I mean, do you perhaps happen to known what the end-goal/approach is here (in case there is any) ? PD mentioned being in preference of using the linker to solve this but that requires mapping (at least that is how gcc (to my understanding) seems to approach it).

Or is the idea perhaps to support the same features for all the other available internal writers ?
« Last Edit: November 10, 2024, 05:15:46 am by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

 

TinyPortal © 2005-2018