English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 22 January 2019, 18:31   #1041
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Quote:
Originally Posted by BastyCDGS View Post
Just a question:

Is it enough to recompile bgdbserver 0.5 with -mcrt=nix13 in order to get it working with OS1.3? I tried running the standard download, but it immediately returns to CLI without even printing the help info.
1.3 is not yet fully supported as far as I know in libnix. (If you need C startup and/or C library functions like malloc etc)

Better stay with 2.0 as min requirement
alkis is offline  
Old 22 January 2019, 18:51   #1042
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 39
Posts: 122
Send a message via ICQ to BastyCDGS
Hi, thank you for your reply.

Quote:
Originally Posted by alkis View Post
1.3 is not yet fully supported as far as I know in libnix. (If you need C startup and/or C library functions like malloc etc)

Better stay with 2.0 as min requirement
It doesn't make much sense if I can compile something for 1.3, but not debug it.

Sure, I could just use MonAm for that, too, but for C/C++ source this simply isn't the optimal debugger.
BastyCDGS is offline  
Old 22 January 2019, 19:09   #1043
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by alkis View Post
1.3 is not yet fully supported as far as I know in libnix. (If you need C startup and/or C library functions like malloc etc)

Better stay with 2.0 as min requirement
you need to improve your level of knowledge.
bebbo is offline  
Old 22 January 2019, 19:21   #1044
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by BastyCDGS View Post
Hi, thank you for your reply.



It doesn't make much sense if I can compile something for 1.3, but not debug it.

Sure, I could just use MonAm for that, too, but for C/C++ source this simply isn't the optimal debugger.
You'd need TCP and a KS1.3 debug stub like my bgdbserver (which is 2.0+ atm) to debug using KS1.3.

In my opinion it makes a lot of sense to debug programs for KS1.3 under KS2.0, because it is much more comfortable to debug in the C source code.
Debugging under KS1.3 will not be completely avoidable until all problems under KS1.3 are fixed. I use DBug from O.M.A. for this.
bebbo is offline  
Old 22 January 2019, 20:41   #1045
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Quote:
Originally Posted by bebbo View Post
you need to improve your level of knowledge.
I stand corrected. Happy, but corrected! Thank you.
alkis is offline  
Old 22 January 2019, 21:05   #1046
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by alkis View Post
I stand corrected. Happy, but corrected! Thank you.
Sorry, I just implemented malloc for KS1.3 at some point and I'm known for rough manners, if I have any at all. Please don't take it personally.

Quote:
Originally Posted by BastyCDGS View Post
Just a question:

Is it enough to recompile bgdbserver 0.5 with -mcrt=nix13 in order to get it working with OS1.3? I tried running the standard download, but it immediately returns to CLI without even printing the help info.
It might be possible to modify bgdbserver to start with KS1.3.
But first provide me a TCP stack for KS1.3,

... well gdb has support for serial connections...
... and bgdbserver doesn't ...

=> it's a bit more work than just recompiling
bebbo is offline  
Old 23 January 2019, 22:37   #1047
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
This gathers some tricks
https://medium.com/@renaudcerrato/th...w-33e788020221
alkis is offline  
Old 27 January 2019, 01:22   #1048
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 151
One more question with respect to LTO:
Presumed I use two separate gcc invocations for compile & link, which compiler flags have to be presented to the linking invocation, too, when using LTO?

Options like -mXXX -fxxx -Ox etc? All flags?
pipper is offline  
Old 30 January 2019, 21:40   #1049
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
has the "strcpy" optimization been regressed somehow?

code in compiler explorer
alkis is offline  
Old 31 January 2019, 11:43   #1050
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by pipper View Post
One more question with respect to LTO:
Presumed I use two separate gcc invocations for compile & link, which compiler flags have to be presented to the linking invocation, too, when using LTO?

Options like -mXXX -fxxx -Ox etc? All flags?
best read: https://gcc.gnu.org/onlinedocs/gcc/O...e-Options.html and search for -flto.
bebbo is offline  
Old 31 January 2019, 12:11   #1051
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by alkis View Post
has the "strcpy" optimization been regressed somehow?

code in compiler explorer
strcpy has return type char *

and thanks - void functions did mark d0 as used => couldn't eliminate assignment to d0.

https://franke.ms/cex/
bebbo is offline  
Old 31 January 2019, 18:14   #1052
kaffer
Registered User
 
Join Date: May 2011
Location: Cambridge
Posts: 581
I was a bit surprised but is it expected (and will remain the case) that .align N directive in gas will round up the location counter so that bottom N bits are zero (rather than N being a simple byte alignment)?

eg. .align 4 aligns to a 16-byte boundary.

I will switch to .balign 4 which has the less confusing byte alignment.
kaffer is offline  
Old 31 January 2019, 18:18   #1053
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 45
Posts: 1,312
Send a message via Yahoo to Samurai_Crow
Quote:
Originally Posted by kaffer View Post
I was a bit surprised but is it expected (and will remain the case) that .align N directive in gas will round up the location counter so that bottom N bits are zero (rather than N being a simple byte alignment)?

eg. .align 4 aligns to a 16-byte boundary.

I will switch to .balign 4 which has the less confusing byte alignment.
Despite the confusing description, it's just 2^N or 1<<N.
Samurai_Crow is offline  
Old 31 January 2019, 18:34   #1054
kaffer
Registered User
 
Join Date: May 2011
Location: Cambridge
Posts: 581
Quote:
Originally Posted by Samurai_Crow View Post
Despite the confusing description, it's just 2^N or 1<<N.
Is it a normal Amiga assembler convention to do it this way?
kaffer is offline  
Old 31 January 2019, 22:40   #1055
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by kaffer View Post
Is it a normal Amiga assembler convention to do it this way?
amiga assemblers used

CNOP displacement,alignment


bebbo is offline  
Old 01 February 2019, 04:25   #1056
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,719
I just had a quick go at building AmiWolf (basic C application) using the latest GCC 6.5 but I'm having linker issues. I've probably stuffed something silly up again

Does anyone have any idea what I've done wrong?

PHP Code:
gcc -m68040 -noixemul -I"/home/novacoder/Development/tools/eclipse/df/AmiWolf" -O0 -Wall --fmessage-length=
PHP Code:
12:45:51 **** Incremental Build of configuration Debug for project AmiWolf ****
make all 
Building target
AmiWolf
Invoking
Cross GCC Linker
m68k
-amigaos-gcc -noixemul -"AmiWolf"  ./src/env/com_string.
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /opt/amiga/m68k-amigaos/libnix/lib/libm.a(atan.o):(.text+0x4): undefined reference to `__MathIeeeDoubTransBase'
makefile:31: recipe for target 'AmiWolf' failed
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /opt/amiga/m68k-amigaos/libnix/lib/libm.a(atan2.o):(.text+0x5a): undefined reference to 
`__MathIeeeDoubTransBase
NovaCoder is offline  
Old 01 February 2019, 10:27   #1057
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
Quote:
Originally Posted by NovaCoder View Post
I just had a quick go at building AmiWolf (basic C application) using the latest GCC 6.5 but I'm having linker issues. I've probably stuffed something silly up again

Does anyone have any idea what I've done wrong?

PHP Code:
gcc -m68040 -noixemul -I"/home/novacoder/Development/tools/eclipse/df/AmiWolf" -O0 -Wall --fmessage-length=
PHP Code:
12:45:51 **** Incremental Build of configuration Debug for project AmiWolf ****make all Building targetAmiWolfInvokingCross GCC Linkerm68k-amigaos-gcc -noixemul -"AmiWolf"  ./src/env/com_string./opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /opt/amiga/m68k-amigaos/libnix/lib/libm.a(atan.o):(.text+0x4): undefined reference to `__MathIeeeDoubTransBase'makefile:31: recipe for target 'AmiWolf' failed/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /opt/amiga/m68k-amigaos/libnix/lib/libm.a(atan2.o):(.text+0x5a): undefined reference to `__MathIeeeDoubTransBase
goto [Project Properties]->C/C++ Build->Settings->Tool Settings
a) use g++ as cross-linker (adds -lm early so `__MathIeeeDoubTransBase' gets picked up)
b) add -lm (either add library `m' oder add miscellaneous `-lm')
bebbo is offline  
Old 01 February 2019, 12:07   #1058
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,719
Okay thanks, I'll try it

Update: Finally got one of my old ports running under a newer GCC

Thanks Stefan!

Last edited by NovaCoder; 02 February 2019 at 01:06.
NovaCoder is offline  
Old 02 February 2019, 12:46   #1059
Auscoder
Registered User

 
Join Date: Jan 2019
Location: Brisbane
Posts: 21
Hey all new here, but I have been playing around with the 6.2 toolchain for a couple weeks now, actually porting a project from console to Amiga. It is all compiling/linking and running after dealing with some platform and endian issues. So that's very cool and it's amazing to see it running on Miggy! I am running in to performance issues though and was hoping for some advice and direction.

First one is how to inline 68k assembly, or advice on best way to use 68k assembly with the C/C++ project. Also on this I cant' figure out how to see the assembly dump of the various methods and functions, to spot optimization targets.

For optimization I tried using http://aminet.net/package/dev/misc/AProf334 and not sure why this happens, it opens the executable fine, and shows a whole lot of functions but when I start my port just terminates after a short time. The port works fine when starting from shell. I am using the AGA SDL framework also on Aminet could that be taking over the system or something like that? Not really sure.

Any help you could provide would be awesome.
Auscoder is offline  
Old 02 February 2019, 13:20   #1060
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 48
Posts: 498
Quote:
Originally Posted by Auscoder View Post
...

First one is how to inline 68k assembly, or advice on best way to use 68k assembly with the C/C++ project. Also on this I cant' figure out how to see the assembly dump of the various methods and functions, to spot optimization targets.
On how to inline you might want to take a look at https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
The syntax is not intuitive. It would be better to have a separate assembly file where your assembler code would be.
Assembly dump with compiler flags -S

Quote:
Originally Posted by Auscoder View Post
For optimization I tried using http://aminet.net/package/dev/misc/AProf334 and not sure why this happens, it opens the executable fine, and shows a whole lot of functions but when I start my port just terminates after a short time. The port works fine when starting from shell. I am using the AGA SDL framework also on Aminet could that be taking over the system or something like that? Not really sure.
You can use '-pg' on compiling/linking with gcc. Run the program normally. It will produce a file gmon.out. Then run m68k-amigaos-gprof executable_name gmon.out
alkis is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 11:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 23:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 04:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 22:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 15:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.12620 seconds with 16 queries