Gas64 (no more use of gcc, only gas) WDS / LNX

User projects written in or related to FreeBASIC.
robert
Posts: 125
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby robert » Mar 15, 2020 6:12

SARG wrote:Hi all,

Thank you for your reports and sorry for the inconvenience. I hope that I'll can fix quickly these new issues.

@robert
It should be easy to find the bug by compiling the concerned module.



Yeah, well, you know ....

I will return to my level of competence after I sweep up the mercury from the exploded vacuum tubes of the Univac which could not process the makefile to make GAS.

I shall stick with your compile/link scripts until further notice and continue exploring the FreeBASIC code labyrinthe.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Mar 15, 2020 17:39

robert wrote:I will return to my level of competence after I sweep up the mercury from the exploded vacuum tubes of the Univac which could not process the makefile to make GAS.

Threfore you have a big house with strong floor :-)

robert wrote:I shall stick with your compile/link scripts until further notice and continue exploring the FreeBASIC code labyrinthe.

The fault was on my side.
So I have reviewed how parts of code are assembled to avoid the last issue.
Strangely when the module symb-proc is compiled with as.exe under Windows (as I did several months ago) no error.

http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Xusinboy Bekchanov » Mar 15, 2020 18:00


I get this error:

Code: Select all

/media/nasbackup/FreeBASIC-1.07.0-linux-x86_64/bin/fbc64_gas64: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory


I could not install libtinfo.so.6, apt-get install does not find such a package.
robert
Posts: 125
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby robert » Mar 15, 2020 21:24

SARG wrote:
robert wrote:I will return to my level of competence after I sweep up the mercury from the exploded vacuum tubes of the Univac which could not process the makefile to make GAS.

Threfore you have a big house with strong floor :-)

robert wrote:I shall stick with your compile/link scripts until further notice and continue exploring the FreeBASIC code labyrinthe.

The fault was on my side.
So I have reviewed how parts of code are assembled to avoid the last issue.
Strangely when the module symb-proc is compiled with as.exe under Windows (as I did several months ago) no error.

http://users.freebasic-portal.de/sarg/fbc64_gas64.zip


Hi SARG:

Thank you for the update.

On Linux Fedora 31, using your scripts to compile fbc64_gas64 with the Github FreeBASIC 1.0.8 source code is successful.

However, using the makefile is still problematic but with new errors. As before on the first "make" fbc, with the modified GAS64 files, is compiled with no problems and "make install" installs the fbc as expected.

Running fbc -v emits

Code: Select all


FreeBASIC Compiler - Version 1.07-(08).0 (2020-03-15), built for linux-x86_64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
target:       linux-x86_64, x86-64, 64bit
backend:      gas64



Then, a "make clean" is run to clear out the previous objs and then the second "make" is run resulting in linker errors.

I will email you a .zip file of the text from the compiler output.
Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) :-)

Postby Xusinboy Bekchanov » Mar 15, 2020 23:37

SARG wrote:Provided (only 64bit exes) :
- fbc 1.07 windows
- fbc 1.08 windows (needs daily build by St_W)
- fbc 1.07 linux
- fbc 1.08 linux to come
- 9 bas/bi new or changed files. Github not yet updated.

http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

Install the fbc64_gas64(.exe) in the same folder than fbc(.exe). Use it and report any issue.

When you released the update on March 5, I have not yet tested the operation of the Windows version. Just tried to compile Linux and Windows version. Now I checked the Windows version. When I checked such a code everything is fine:

Code: Select all

?97 ' prints: 97
?WChr(97) ' prints: a

But when I compile the entire project, this code in the file EditControl.bas does not work correctly:

Code: Select all

Case WM_CHAR
?msg.wParam ' prints: 97 - Ok
?WChr (msg.wParam) ' prints: 0 - [b]Error[/b]

That is, it is not possible to print on my own control. On the latest version, too.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Mar 16, 2020 9:41

Hi all,

Sorry for all those problems. I'm a Linux newbie.... and also in programming (only 45 years) :-) Thank you again.

Xusinboy Bekchanov wrote:I could not install libtinfo.so.6, apt-get install does not find such a package.
libtinfo6 is the default lib on my Linux box.

Try to install libtinfo6.

For the other issues I have to investigate.

robert wrote:I will email you a .zip file of the text from the compiler output.
File well received. I guess 'extern variable' doesn't works well....
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Mar 16, 2020 20:05

Hi all,

Like every day...... http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

@robert
Effectively an issue with extern variables only in Linux, not in Windows. Fixed now.

@Xusinboy
The issue with Wchr fixed. Too strong optimization....
I have not yet used what you sent me but not forgotten.
Did you install libtinfo6 ?
nov79
Posts: 47
Joined: Feb 23, 2020 15:31

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby nov79 » Mar 16, 2020 20:18

fbc itself uses the legacy libtinfo5. So you have to install libtinfo5, not 6.
robert
Posts: 125
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby robert » Mar 17, 2020 1:27

SARG wrote:Hi all,

Like every day...... http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

@robert
Effectively an issue with extern variables only in Linux, not in Windows. Fixed now.


Hi SARG:

Thank you for the update. You are a Wizard!

You are eliminating problems.

Me ??? I have found more for you to get rid of.

On Linux Fedora 31, using the standard fbc makefile to compile fbc64_gas64 with the Github FreeBASIC 1.0.8 source code. First make O.K. We've got your backend in fbc.

Code: Select all


FreeBASIC Compiler - Version 1.07-(08).0 (2020-03-16), built for linux-x86_64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
target:       linux-x86_64, x86-64, 64bit
backend:      gas64



Second attempt at make, now with gas64 backended fbc, errors are

Code: Select all


FBC src/compiler/obj/linux-x86_64/ir-gas64.o
LINK bin/fbc
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `EDBGEMITHEADER_ASM64':
(.text+0x3733): undefined reference to `ENV'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `EDBGEMITGLOBALVAR_ASM64':
(.text+0x3ae5): undefined reference to `ENV'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `EDBGEMITLOCALVAR_ASM64':
(.text+0x3d56): undefined reference to `ENV'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `EDBGEMITPROCHEADER_ASM64':
(.text+0x3f2e): undefined reference to `ENV'
ld: (.text+0x4076): undefined reference to `LEX'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `EDBGEMITPROCARG_ASM64':
(.text+0x4200): undefined reference to `ENV'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_INIT':
(.text+0xf1c8): undefined reference to `IR'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `HEMITVARIABLE':
(.text+0xf73d): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_EMITBEGIN':
(.text+0x10bd1): undefined reference to `ENV'
ld: (.text+0x10be6): undefined reference to `ENV'
ld: (.text+0x10c05): undefined reference to `ENV'
ld: (.text+0x10c0c): undefined reference to `ENV'
ld: (.text+0x10c13): undefined reference to `ENV'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o:(.text+0x10d75): more undefined references to `ENV' follow
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_PROCBEGIN':
(.text+0x11655): undefined reference to `LEX'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_PROCEND':
(.text+0x11686): undefined reference to `LEX'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `STRUCT_PARAM':
(.text+0x11794): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_PROCALLOCARG':
(.text+0x1287d): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x1431b): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `HLOADOPERANDSANDWRITEBOP':
(.text+0x18802): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x18fd6): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o:(.text+0x19735): more undefined references to `SYMB_DTYPETB' follow
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `HDOCALL':
(.text+0x36124): undefined reference to `IRHL'
ld: (.text+0x385e0): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x388cd): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x3bdca): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x3d0c3): undefined reference to `IRHL'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_EMITVARINIBEGIN':
(.text+0x43d07): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_EMITVARINII':
(.text+0x440fb): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir-gas64.o: in function `_EMITVARINIWSTR':
(.text+0x46b02): undefined reference to `SYMB_DTYPETB'
ld: (.text+0x46c7d): undefined reference to `SYMB_DTYPETB'
ld: src/compiler/obj/linux-x86_64/ir.o: in function `IRINIT':
ir.c:(.text+0xe1): undefined reference to `IRGAS64_VTBL$'
make: *** [makefile:572: bin/fbc] Error 1

Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Xusinboy Bekchanov » Mar 17, 2020 2:31

SARG wrote:@Xusinboy
The issue with Wchr fixed. Too strong optimization....
I have not yet used what you sent me but not forgotten.
Did you install libtinfo6 ?

The change date of the three files has not changed.
Maybe you sent the old version. WChr problem has not been resolved yet.
Do not install libtinfo6 yet. Do not find such a package. I myself compiled fbc from source in Linux. But there was not enough time to test the compiler. I test in the evening.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Mar 17, 2020 11:29

Hi all,

Xusinboy Bekchanov wrote:The change date of the three files has not changed.
Maybe you sent the old version. WChr problem has not been resolved yet.
Do not install libtinfo6 yet. Do not find such a package. I myself compiled fbc from source in Linux. But there was not enough time to test the compiler. I test in the evening.
Files are well updated. Check again. Take your time no emergency.
Synaptic doesn't show this library ?

robert wrote:You are a Wizard!
You are eliminating problems.
Me ??? I have found more for you to get rid of.
Just an apprentice. :-)
No reason only for that module. I suppose it's an old/previous ir_gas.o file.
Check if there is not an error when ir_gas64 is compiled.

nov79 wrote:fbc itself uses the legacy libtinfo5. So you have to install libtinfo5, not 6.
libtinfo5 is installed but no change, always linked version 6. And no information in the linker command.
I have seen in usr/lib/x86_64-linux-gnu a link 'libtinfo.so' pointing to libtinfo.so.6
Don't know what I could do.
Maybe change this link however libtinfo.a could be wrong.
Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Xusinboy Bekchanov » Mar 17, 2020 16:11

SARG wrote:Hi all,

Xusinboy Bekchanov wrote:The change date of the three files has not changed.
Maybe you sent the old version. WChr problem has not been resolved yet.
Do not install libtinfo6 yet. Do not find such a package. I myself compiled fbc from source in Linux. But there was not enough time to test the compiler. I test in the evening.
Files are well updated. Check again. Take your time no emergency.
Synaptic doesn't show this library ?

Now downloaded again. Windows version is normal, works correctly. Linux version shows previous errors (Assembler Messages).
robert
Posts: 125
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby robert » Mar 17, 2020 16:12

SARG wrote:Hi all,

No reason only for that module. I suppose it's an old/previous ir_gas.o file.
Check if there is not an error when ir_gas64 is compiled.



You are correct. I must have copied an earlier version of the ir-gas64.bas to the fbc src.

Now, error corrected, on Linux Fedora 31, using the standard fbc makefile to compile fbc64_gas64 with the Github FreeBASIC 1.0.8 source code. First make O.K. As before we've got your backend in fbc.

Second attempt at make, now with gas64 backended fbc, no errors.

Third attempt at make now with the gas64 backended fbc from the second make, core dump.

Code: Select all

mkdir -p src/compiler/obj/linux-x86_64
FBC src/compiler/obj/linux-x86_64/ast-gosub.o
/bin/sh: line 1: 21978 Segmentation fault      (core dumped) fbc -e -m fbc -w pedantic -maxerr 1 -c src/compiler/ast-gosub.bas -o src/compiler/obj/linux-x86_64/ast-gosub.o
make: *** [makefile:576: src/compiler/obj/linux-x86_64/ast-gosub.o] Error 139


I tried three times and each time core dump. Let me know if you would like to see the core dump files and I will send them to you.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Mar 20, 2020 21:18

Hi all,

@robert
4 days ago when fixing the issue with extern variables I did a small mistake but the punishing was a lot of hours spend for catching this new bug.
In some modules of fbc there are shared variables all named ctx with a limited scope to each module. With my last fix they all share the same address. I let you imagine how to understand what was happening. The version for Windows was also impacted.

This version can compile it self.
http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

@Xusinboy
The issue found with visualFBEditor,much simplier, is almost fixed.
Edit : fix done. However as gtk3, cario pango, etc are not installed I can not test.

And the 1.07 WDS version was not updated in the zip file. Also done now.
robert
Posts: 125
Joined: Aug 06, 2019 18:45

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby robert » Mar 21, 2020 4:04

SARG wrote:Hi all,

@robert
4 days ago when fixing the issue with extern variables I did a small mistake but the punishing was a lot of hours spend for catching this new bug.
In some modules of fbc there are shared variables all named ctx with a limited scope to each module. With my last fix they all share the same address. I let you imagine how to understand what was happening. The version for Windows was also impacted.

This version can compile it self.


On Linux Fedora 31, using the standard fbc makefile to compile fbc64_gas64 with the Github FreeBASIC 1.0.8 source code.

Three recursive warning-free error-free self compiles.

Code: Select all


FreeBASIC Compiler - Version 1.07-(08).0 (2020-03-20), built for linux-x86_64 (64bit)
Copyright (C) 2004-2019 The FreeBASIC development team.
target:       linux-x86_64, x86-64, 64bit
backend:      gas64



A fantastic job! Thank you SARG.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 7 guests