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

User projects written in or related to FreeBASIC.
Post Reply
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:@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 :-(
Hi SARG:

I missed this when I first ran the unit tests

Code: Select all


./fbc-tests 
      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)      
      
I've been trying to use the print suggestion you made with no success.

I added the + 1 as you suggested and indeed 5 failures were reported.

I shall keep trying.
robert
Posts: 169
Joined: Aug 06, 2019 18:45

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

Post by robert »

robert wrote:
SARG wrote:@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 :-(
Hi SARG:

I missed this when I first ran the unit tests

Code: Select all


./fbc-tests 
      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)      
      
I've been trying to use the print suggestion you made with no success.

I added the + 1 as you suggested and indeed 5 failures were reported.

I shall keep trying.
Adding the + 1 to the loop puts out this

Code: Select all


./fbc-tests 
      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)

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

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

Post by Xusinboy Bekchanov »

SARG wrote:@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.
Thank you. Now works in Windows.
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

Xusinboy Bekchanov wrote:Thank you. Now works in Windows.
Thank you for testing and reporting :-)

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
robert wrote:I've been trying to use the print suggestion you made with no success.
Separately I saw the print output but not when executing the full test.
So try with this code. It's exactly the same one in the test suite, just removed lines for an standalone compilation/execution.

Code: Select all

#macro CU_ASSERT_EQUAL(a,b)
    if a<>b then 
	    print"error ",__function__;" ";__line__,#a,#b
    else
       ' print __function__;" ";__line__
    end if	
#endmacro

'#include "fbcunit.bi"

'SUITE( fbc_tests.structs.obj_shared_array_ini )

	const ARRAY_LB = 0
	const ARRAY_UB = 4

	type bar
		as integer v = any
		declare constructor( byval value as integer )
	end type

	constructor bar( byval value as integer )
		v = value
	end constructor

	dim shared as bar b1(ARRAY_LB to ARRAY_UB) = { bar(1), bar(2), bar(3), bar(4), bar(5) }

'	TEST( all )
		
		dim as integer i
		for i = ARRAY_LB to ARRAY_UB

		print i;" ";b1(i).v,ARRAY_LB,ARRAY_UB

			CU_ASSERT_EQUAL( b1(i).v, 1 + i )
		next
		
'	END_TEST
	
'END_SUITE
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:
Xusinboy Bekchanov wrote:Thank you. Now works in Windows.
Thank you for testing and reporting :-)

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
robert wrote:I've been trying to use the print suggestion you made with no success.
Separately I saw the print output but not when executing the full test.
So try with this code. It's exactly the same one in the test suite, just removed lines for an standalone compilation/execution.

Code: Select all

#macro CU_ASSERT_EQUAL(a,b)
    if a<>b then 
	    print"error ",__function__;" ";__line__,#a,#b
    else
       ' print __function__;" ";__line__
    end if	
#endmacro

'#include "fbcunit.bi"

'SUITE( fbc_tests.structs.obj_shared_array_ini )

	const ARRAY_LB = 0
	const ARRAY_UB = 4

	type bar
		as integer v = any
		declare constructor( byval value as integer )
	end type

	constructor bar( byval value as integer )
		v = value
	end constructor

	dim shared as bar b1(ARRAY_LB to ARRAY_UB) = { bar(1), bar(2), bar(3), bar(4), bar(5) }

'	TEST( all )
		
		dim as integer i
		for i = ARRAY_LB to ARRAY_UB

		print i;" ";b1(i).v,ARRAY_LB,ARRAY_UB

			CU_ASSERT_EQUAL( b1(i).v, 1 + i )
		next
		
'	END_TEST
	
'END_SUITE
Hi SARG:

0 failures and this output

Code: Select all


./fbc-tests 
 0  1          0             4
 1  2          0             4
 2  3          0             4
 3  4          0             4
 4  5          0             4

So where was the failure?
Xusinboy Bekchanov
Posts: 782
Joined: Jul 26, 2018 18:28

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

Post by Xusinboy Bekchanov »

SARG wrote:
Xusinboy Bekchanov wrote:Thank you. Now works in Windows.
Thank you for testing and reporting :-)

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Yes. Linux version works too. Thank you very much.
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:Thank you for testing and reporting :-)

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Hi SARG:

CoderJeff has updated the 1.0.8 source on GitHub with some new fixes.

Using source code from the above fbc64_gas64.zip

Linux Fedora 32 x64 compile of GitHub FreeBASIC 1.0.8 of fbc64_gas64, no errors

Unit-tests same as before, 1 failure

Code: Select all


./fbc-tests 
      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)


5         4         1  fbc_tests.structs.obj_shared_array_ini         1

SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

Hi all,
Xusinboy Bekchanov wrote:Yes. Linux version works too. Thank you very much.
Good news :-)
robert wrote:So where was the failure?
Don't know....
Execute this after setting the right names (folder/exe) and keeping the print from previous post in the bas file :

Code: Select all

fbc64_gas64_108 -RR -R -mt -g -exx -i ./fbcunit/inc -lib ./fbcunit/src/fbcunit.bas ./fbcunit/src/fbcunit_qb.bas ./fbcunit/src/fbcunit_console.bas ./fbcunit/src/fbcunit_report.bas -x ./fbcunit/lib/libfbcunit.a

fbc64_gas64_108 -w none  -i ./fbcunit/inc -p ./fbcunit/lib  -RR -R   ./fbc-tests.bas ./structs/obj_shared_array_ini.bas
./fbc-tests -v
Another possibility for finding the problem : upload the exe somewhere and I'll compare on my side.
robert wrote:CoderJeff has updated the 1.0.8 source on GitHub with some new fixes.
Thanks for the information and all. He is back :-)
Currently I'm exchanging with him for updating my repository (in github) for a next version of fbc. Not so easy ;-)
I'll quickly see the changes.
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,
robert wrote:So where was the failure?
Don't know....
Execute this after setting the right names (folder/exe) and keeping the print from previous post in the bas file :

Code: Select all

fbc64_gas64_108 -RR -R -mt -g -exx -i ./fbcunit/inc -lib ./fbcunit/src/fbcunit.bas ./fbcunit/src/fbcunit_qb.bas ./fbcunit/src/fbcunit_console.bas ./fbcunit/src/fbcunit_report.bas -x ./fbcunit/lib/libfbcunit.a

fbc64_gas64_108 -w none  -i ./fbcunit/inc -p ./fbcunit/lib  -RR -R   ./fbc-tests.bas ./structs/obj_shared_array_ini.bas
./fbc-tests -v
Another possibility for finding the problem : upload the exe somewhere and I'll compare on my side.
I'll send you my fbc64_gas64 executable, if that is what you mean by "upload the .exe"?

Regarding the above instructions, is the following output what you want or do do want everything from the ./fbc-tests -v?

Code: Select all


  fbc_tests.structs.obj_shared_array_ini
    all
  fbc_tests.structs.anon_align
    anonPadding
    offsetof_
    size
  fbc_tests.structs.const_access
    test6
    test5
    test4
    test3
    test2
    test1
  fbc_tests.structs.derived_param
    withCtorBase.default
    noCtorBase.default
  fbc_tests.structs.anon_assign
    anonCtorCallInit.default
    ctorcallDespiteConstBits.default
    test4
    test3
    test2
    test1

SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

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

Post by SARG »

robert wrote:
SARG wrote:Hi all,
robert wrote:So where was the failure?
Don't know....
Execute this after setting the right names (folder/exe) and keeping the print from previous post in the bas file :

Code: Select all

fbc64_gas64_108 -RR -R -mt -g -exx -i ./fbcunit/inc -lib ./fbcunit/src/fbcunit.bas ./fbcunit/src/fbcunit_qb.bas ./fbcunit/src/fbcunit_console.bas ./fbcunit/src/fbcunit_report.bas -x ./fbcunit/lib/libfbcunit.a

fbc64_gas64_108 -w none  -i ./fbcunit/inc -p ./fbcunit/lib  -RR -R   ./fbc-tests.bas ./structs/obj_shared_array_ini.bas
./fbc-tests -v
Another possibility for finding the problem : upload the exe somewhere and I'll compare on my side.
I'll send you my fbc64_gas64 executable, if that is what you mean by "upload the .exe"?

Regarding the above instructions, is the following output what you want or do do want everything from the ./fbc-tests -v?
Sorry not to be clear.
Create a script with the 3 lines and after setting the right names for the compiler and the folder execute it. It takes in account only shared_obj_ini not all the other modules.
Don't forget to add this print i;" ";b1(i).v,ARRAY_LB,ARRAY_UB
I hope we can see something wrong that explains the problem.

About the exe it was fbc-test. But you can also upload fbc64_gas64.
Thanks again for your help.
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:
robert wrote:
SARG wrote:Hi all,

Don't know....
Execute this after setting the right names (folder/exe) and keeping the print from previous post in the bas file :

Code: Select all

fbc64_gas64_108 -RR -R -mt -g -exx -i ./fbcunit/inc -lib ./fbcunit/src/fbcunit.bas ./fbcunit/src/fbcunit_qb.bas ./fbcunit/src/fbcunit_console.bas ./fbcunit/src/fbcunit_report.bas -x ./fbcunit/lib/libfbcunit.a

fbc64_gas64_108 -w none  -i ./fbcunit/inc -p ./fbcunit/lib  -RR -R   ./fbc-tests.bas ./structs/obj_shared_array_ini.bas
./fbc-tests -v
Another possibility for finding the problem : upload the exe somewhere and I'll compare on my side.
I'll send you my fbc64_gas64 executable, if that is what you mean by "upload the .exe"?

Regarding the above instructions, is the following output what you want or do do want everything from the ./fbc-tests -v?
Sorry not to be clear.
Create a script with the 3 lines and after setting the right names for the compiler and the folder execute it. It takes in account only shared_obj_ini not all the other modules.
Don't forget to add this print i;" ";b1(i).v,ARRAY_LB,ARRAY_UB
I hope we can see something wrong that explains the problem.

About the exe it was fbc-test. But you can also upload fbc64_gas64.
Thanks again for your help.
O.K.

Code: Select all


TESTS

  fbc_tests.structs.obj_shared_array_ini
    all
 0  1          0             4
 1  2          0             4
 2  3          0             4
 3  4          0             4
 4  5          0             4

SUMMARY

 Asserts    Passed    Failed  Suite                                      Tests
--------  --------  --------  --------------------------------------  --------
       5         5         0  fbc_tests.structs.obj_shared_array_ini         1
--------  --------  --------  --------------------------------------  --------
       5         5         0  Total                                          1

?????????????????
robert
Posts: 169
Joined: Aug 06, 2019 18:45

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

Post by robert »

Hi SARG:

I ran the unit-tests using the fbc64_gas64_108 linux executable that is included in the last posted
http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

The result was the same as with the fbc64_gas64 executable that I compiled.

Code: Select all


5         4         1  fbc_tests.structs.obj_shared_array_ini         1


SARG
Posts: 1756
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 with Robert's help the bug found in test-suite is fixed.
On my side the modules of the test-suite are not executed in the same order than the one using make. And in one of these modules a bugged assignement overwrote the first element of the array. So the test failed depending of what module was executed before the other....

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

Uptodate with the last changes 1.08 from Github. 2 files (fb.bi/fbc.bas) compatible 1.07.1/1.08
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

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

Post by D.J.Peters »

@SARG well done I like it :-)

After all your experiments with 64 bit assembler at all can you help "mister fxm" to write the missing
X86_64 inline assembler stuff for the FreeBASIC wiki [please] ?

(Most important in this topic are how to accessing the parameters and local vars and return a function value
from 64bit inline assembler and the differences between Windows 64bit and Linux 64bit.)

Joshy
Xusinboy Bekchanov
Posts: 782
Joined: Jul 26, 2018 18:28

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

Post by Xusinboy Bekchanov »

SARG wrote:Hi all,

Finally with Robert's help the bug found in test-suite is fixed.
On my side the modules of the test-suite are not executed in the same order than the one using make. And in one of these modules a bugged assignement overwrote the first element of the array. So the test failed depending of what module was executed before the other....

Full release WDS/LNX : http://users.freebasic-portal.de/sarg/fbc64_gas64.zip

Uptodate with the last changes 1.08 from Github. 2 files (fb.bi/fbc.bas) compatible 1.07.1/1.08
Very good work.
Now need to merge into the official assembly.

Will you continue towards Android, MacOS?
Post Reply