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

User projects written in or related to FreeBASIC.
Post Reply
wallyg
Posts: 270
Joined: May 08, 2009 7:08
Location: Tucson Arizona

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

Post by wallyg »

Thank you, I will give it a try the next time I get bored.

There are commands like

.stabs "integer:t1=-1",128,0,0,0
.section .text
.stabn 68,0,30,.Lt_16C4-__ZN9BASICHASHC1Ev
.globl __ZN9BASICHASHC1Ev
.lcomm _OPTNAMES,4808

Plus others, some I can deduce, but the rest, especially the argument lists. Is there some document that describes in detail all possible commands?

Wally
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

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

Post by jj2007 »

Where did you see these commands?
wallyg
Posts: 270
Joined: May 08, 2009 7:08
Location: Tucson Arizona

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

Post by wallyg »

I saw them from the output of -R -RR -PP command line in winFBE.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

Hi wallyg,

In your last post there is a mix of debugging data (when adding option -g) --> (stabs stabn) and others are instructions more for the assembler itself --> globl lcomm.
I can send you some documents and links that should help you to sort and better understand all those commands, instructions, etc
Tell me.
However I guess It will take you a lot of time to swallow them. :-)

By the way, maybe opening a new topic should be better.
wallyg
Posts: 270
Joined: May 08, 2009 7:08
Location: Tucson Arizona

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

Post by wallyg »

I would love to read the information you have.

If you know how to take these last few replies and make it a new topic, that would be great. Show some of the younger people what real programming is all about.

Wally
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

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

Post by dodicat »

If you have mingw on path you can demangle the names with

Code: Select all

 

#define demangle(s) shell "C++filt "+(s)
demangle( "_ZN9BASICHASHC1Ev")
demangle( "_Znwm")
sleep

 
 
Note only one underscore before the Z
You can get a full mingw distribution from the news page.
The MinGW-w64 toolchains used for the main win32 . . .
in
viewtopic.php?f=1&p=264580#p264580
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

Request to mods (move some posts)

Post by SARG »

@wally
Although I'm not sure to understand exactly what you want to do I have sent you docs and links. :-)
Create a new topic.

@mods
When wally will have create the new topic, could you move the last posts (begin at the first wally's one until mine) in that one.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

Hi all,

Finally I could execute the test suite under linux without error after 3 self compilations.
@robert please confirm. I hope no mistake.

@xusinboy
Maybe the bug with visualeditor is fixed as I found one that seems to match. But not tested.

@deltarho
Looking at the asm code generated by gcc for NR32 test I saw some optimizations to improve the execution time when using gas64. However as some subs are removed by direct inclusion in the main procedure it will be hard (unless big changes in the compiler) to reach such small times.

@dodicat and others
So that one can easily find the latest version I will try to keep the first post with an uptodate link.

http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

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

Post by srvaldez »

congratulations on this milestone SARG :-)
Xusinboy Bekchanov
Posts: 789
Joined: Jul 26, 2018 18:28

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

Post by Xusinboy Bekchanov »

This is the error shown:

Code: Select all

05:47:55: Compilation: ""D:\FreeBasic\FreeBASIC-1.07.1-win64\fbc64_gas64.exe"  -b "VisualFBEditor.bas" -x "../VisualFBEditor64.exe" "VisualFBEditor.rc" -exx -i "D:\GitHub\VisualFBEditor/./MyFbFramework" 2> "D:\GitHub\VisualFBEditor/Temp/Compile.log""

D:\GitHub\VisualFBEditor\src\Main.bi(50) error 17: Syntax error, found 'rtlib'

05:48:01: Do not build file.

Code: Select all

Extern "rtlib" <- error line
   Declare Function LineInputWstr Alias "fb_FileLineInputWstr"(ByVal filenumber As Long, ByVal dst As WString Ptr, ByVal maxchars As Integer) As Long
End Extern
In Windows:

Code: Select all

[New Thread 7824.0x2a80]
 1

Program received signal SIGSEGV, Segmentation fault.
0x000000000047c56f in _ZN2MY3SYS5FORMS11EDITCONTROL12SHOWCARETPOS$Eb ()

Code: Select all

                If OldLine <> FSelEndLine OrElse OldChar <> FSelEndChar Then
			?1:If OnSelChange Then OnSelChange(This, FSelEndLine, FSelEndChar):?2 <- error line
		End If
In Linux:

Code: Select all

 06:14:37: Compilation: "/media/FreeBasic/FreeBASIC-1.07.1-linux-x86_64/bin/fbc64_gas64"  -b "VisualFBEditor.bas" -x "../VisualFBEditor64_gtk3" -R -RR -s gui -i "/media/FreeBasic/VisualFBEditor.1.2.4/./MyFbFramework" ...

VisualFBEditor.a64: Сообщения ассемблера:
VisualFBEditor.a64:122225: Ошибка: несоответствие типа операнда для «push»
VisualFBEditor.a64:123588: Ошибка: несоответствие типа операнда для «push»
VisualFBEditor.a64:289154: Ошибка: несоответствие типа операнда для «push»
VisualFBEditor.a64:289192: Ошибка: несоответствие типа операнда для «push»
VisualFBEditor.a64:294268: Ошибка: несоответствие типа операнда для «push»
VisualFBEditor.a64:294306: Ошибка: несоответствие типа операнда для «push»

06:15:21: Do not build file.
This is 20 lines before error:

Code: Select all

   setne al
   mov r10b, al
   mov r8b, BYTE PTR 3160[r11]
   and r8b, r10b
   mov r11b, BYTE PTR STRINGS$[rip+130]
   or r11b, r8b
   mov r10, -120[rbp]
   mov r8, -120[rbp]
   mov r9, QWORD PTR 3208[r8]
   mov rax, -1
   add r9, rax
   mov r8, -120[rbp]
   mov rdx, -120[rbp]
   mov rdi, -120[rbp]
   mov rsi, 2992[rdx]
   mov rdx, 3024[r8]
   mov rcx, r9
   mov r8, 3000[r10]
   lea r9, STRINGS$[rip+0]
   push r11b
robert
Posts: 169
Joined: Aug 06, 2019 18:45

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

Post by robert »

SARG wrote:Hi all,

Finally I could execute the test suite under linux without error after 3 self compilations.
@robert please confirm. I hope no mistake.
Hi SARG:

Thank you for the update. Looking good!

Linux Fedora 32, Github FreeBASIC 1.0.8 source makefile three compiles, one warning

Code: Select all

FBC src/compiler/obj/linux-x86_64/ir-gas64.o
src/compiler/ir-gas64.bas(1895) warning 15(1): No explicit BYREF or BYVAL, at parameter 1 (allowed) of reg_allowed()
make unit-tests 1 failure

Code: Select all

       5         4         1  fbc_tests.structs.obj_shared_array_ini         1

log-tests 0 failures

Code: Select all

FAILED LOG - for log-tests -lang fb
None Found

FAILED LOG - for log-tests -lang qb
None Found

FAILED LOG - for log-tests -lang deprecated
None Found
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

srvaldez wrote:congratulations on this milestone SARG :-)
Thank you.

@xusinboy
I'm going back on work :-)

robert wrote:make unit-tests 1 failure
Strange I did not get this error.
And it would seem more normal to get 5 errors as there is only this cu_assert line.

Code: Select all

		for i = ARRAY_LB to ARRAY_UB
			CU_ASSERT_EQUAL( b1(i).v, 1 + i )
		next
Look in the log for finding some thing like that (I intentionnally cause errors for the example by adding an extra 1) :

Code: Select all

      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
You can also add a print inside the loop for displaying values : print i,b1(i).v,ARRAY_LB,ARRAYUB

And the warning is fixed, everyone is happy ;-)
robert
Posts: 169
Joined: Aug 06, 2019 18:45

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

Post by robert »

SARG wrote:
srvaldez wrote:congratulations on this milestone SARG :-)
Thank you.
robert wrote:make unit-tests 1 failure
Strange I did not get this error.
And it would seem more normal to get 5 errors as there is only this cu_assert line.

Code: Select all

		for i = ARRAY_LB to ARRAY_UB
			CU_ASSERT_EQUAL( b1(i).v, 1 + i )
		next
Look in the log for finding some thing like that (I intentionnally cause errors for the example by adding an extra 1) :

Code: Select all

      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
      ./structs/obj_shared_array_ini.bas(23) : error : TESTS.FBC_TESTS.STRUCTS.OBJ_SHARED_ARRAY_INI.ALL CU_ASSERT_EQUAL(b1(i).v,1 + i+1)
You can also add a print inside the loop for displaying values : print i,b1(i).v,ARRAY_LB,ARRAYUB

And the warning is fixed, everyone is happy ;-)
Hi SARG:

Nothing in any of the logs. ???????????
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

Hi robert
Very weird.
Did you add the print in obj_shared_array_ini.bas ?
Try also (if not already done) to add -v after fbc-test

About error with extern "rtlib", after exchanging with xusinboy we found that this feature has been added in 1.07.1 version and as I was still using sources for 1.07.....
Now updated for next release.
SARG
Posts: 1766
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

@xusinboy
Finally bug fixed for the WDS version. it had been almost fixed before but I was not using the procedure on the correct variables ....
http://users.freebasic-portal.de/sarg/f ... s64WDS.zip

About 'push bug' on LNX, release planned tomorrow.

@robert
Some news ?

offtopic
Not too hot at home? here it's too much, too long and very unusual :-(
Post Reply