Import asm errno - linker wrong version (purebasic.o?)

Post bugreports for the Linux version here
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Import asm errno - linker wrong version (purebasic.o?)

Post by mk-soft »

Purebasic Linker Error:
/usr/bin/ld: errno: TLS definition in /lib/x86_64-linux-gnu/libc.so.6 section .tbss mismatches non-TLS reference in purebasic.o
/usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: Fehler beim Hinzufügen von Symbolen: bad value
collect2: error: ld returned 1 exit status
Code:

Code: Select all

;-TOP
; By mk-soft, v1.01.1, 08.01.2023
; Not work with ASM (Bug version)

CompilerIf Not Defined(PB_Compiler_Backend, #PB_Constant)
  #PB_Backend_Asm = 0
  #PB_Backend_C = 1
  #PB_Compiler_Backend = 0
CompilerEndIf

CompilerIf #PB_Compiler_OS = #PB_OS_Windows
  Macro GetLastError()
    GetLastError_()
  EndMacro
CompilerElse
  CompilerIf #PB_Compiler_Backend = #PB_Backend_C
    Procedure GetLastError()
      !#include "errno.h"
      !extern int errno;
      Protected r1
      !v_r1=errno;
      ProcedureReturn r1
    EndProcedure
  CompilerElse
    ImportC ""
      errno
    EndImport
    Procedure GetLastError()
      Protected r1
      r1 = errno
      ProcedureReturn r1
    EndProcedure
  CompilerEndIf
CompilerEndIf

; ----

CompilerIf #PB_Compiler_IsMainFile
  
  err = GetLastError()
  Debug "LastError = " + GetLastError()
  
CompilerEndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
juergenkulow
Enthusiast
Enthusiast
Posts: 544
Joined: Wed Sep 25, 2019 10:18 am

Re: Import asm errno - linker wrong version (purebasic.o?)

Post by juergenkulow »

Code: Select all

PureBasic 6.01 LTS beta 1 - C Backend (Linux - x64)
Loading external modules...
Loading 'c' subsystem
Starting compilation...
Starting compilation...
43 lines processed.
Creating the executable.
Error: Linker
/usr/bin/ld: purebasic.o: in function `SYS_BankerRound':
purebasic.c:(.text+0x27): undefined reference To `fmod'
/usr/bin/ld: purebasic.o: in function `SYS_BankerRoundQuad':
purebasic.c:(.text+0xcf): undefined reference To `fmod'
collect2: error: ld returned 1 exit status
:?:
juergenkulow
Enthusiast
Enthusiast
Posts: 544
Joined: Wed Sep 25, 2019 10:18 am

Re: Import asm errno - linker wrong version (purebasic.o?)

Post by juergenkulow »

Code: Select all

PureBasic 6.01 LTS beta 2 (Linux - x64)
Loading external modules...
Starting compilation...
Starting compilation...
44 lines processed.
Creating the executable.
Error: Linker
/usr/bin/ld: errno: TLS definition in /lib/x86_64-linux-gnu/libc.so.6 section .tbss mismatches non-TLS reference in purebasic.o
/usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: Fehler beim Hinzufügen von Symbolen: bad value
collect2: error: ld returned 1 exit status
Post Reply