English Amiga Board


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

 
 
Thread Tools
Old 11 October 2019, 20:59   #1181
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
I checked more and it seems relative jumps have been replaced with absolute jumps. At least previously trampoline didn't need any extra options. Does it need one now?

New:

Code:
H0+$3E2 082B5DBA 4EB9 082B8868          jsr     $082B8868
H0+$3E8 082B5DC0 C6AB 09C8              and.l   $9C8(a3),d3
H0+$3EC 082B5DC4 6700 FF66              beq.w   $082B5D2C
H0+$3F0 082B5DC8 4AAB 0092              tst.l   $92(a3)
H0+$3F4 082B5DCC 6608                   bne.b   $082B5DD6
H0+$3F6 082B5DCE 204B                   movea.l a3,a0
H0+$3F8 082B5DD0 4EB9 082C17A0          jsr     $082C17A0
H0+$3FE 082B5DD6 204B                   movea.l a3,a0
H0+$400 082B5DD8 4EB9 082C176C          jsr     $082C176C
H0+$406 082B5DDE 204B                   movea.l a3,a0
H0+$408 082B5DE0 4EB9 082B6A0E          jsr     $082B6A0E
H0+$40E 082B5DE6 6000 FF44              bra.w   $082B5D2C
Old: (Offset difference because new value was added to structure)

Code:
H0+$3B4 08302D4C 4EBA 29B2              jsr     $08305700(pc)
H0+$3B8 08302D50 C6AB 09C6              and.l   $9C6(a3),d3
H0+$3BC 08302D54 678A                   beq.b   $08302CE0
H0+$3BE 08302D56 4AAB 0092              tst.l   $92(a3)
H0+$3C2 08302D5A 6606                   bne.b   $08302D62
H0+$3C4 08302D5C 204B                   movea.l a3,a0
H0+$3C6 08302D5E 4EBA 045A              jsr     $083031BA(pc)
H0+$3CA 08302D62 204B                   movea.l a3,a0
H0+$3CC 08302D64 4EBA 045A              jsr     $083031C0(pc)
H0+$3D0 08302D68 204B                   movea.l a3,a0
H0+$3D2 08302D6A 4EBA 0B78              jsr     $083038E4(pc)
H0+$3D6 08302D6E 6000 FF70              bra.w   $08302CE0
Options are still the same:

Code:
LIBS=-nostdlib -lamiga -lgcc -lnix13 -lnix -s

CFLAGS=-Os -fbbb=+ -m68000 -noixemul -fomit-frame-pointer -nostartfiles -mregparm=3 -msmall-code -s \
	-DMIN_LIB_VERSION=33 -DKSWRAPPER=1 \
	-DSCSIDIRECT=1 -DNSD=1 -DTD64=1 -DTRACKDISK=1 \
	-DLARGE_FILE_SIZE=0 -DEXTRAPACKETS=1 -DSIZEFIELD -DDELDIR=1 \
	-DMULTIUSER=0 -DPROTECTION=0 -DVERSION23=1 -DROLLOVER=1 \
	-DLIMIT_MAXTRANSFER=0x20000 -DUNSAFEQUIT=1 \
	-DREVDATE=$(NOWDATE) -DREVTIME=$(NOWTIME)
Toni Wilen is offline  
Old 11 October 2019, 23:22   #1182
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Toni Wilen View Post
I checked more and it seems relative jumps have been replaced with absolute jumps. At least previously trampoline didn't need any extra options. Does it need one now?

...

guess the last binutil merge discarded the jsr->bsr optimization, or was it a gcc merge?


nm, I'll fix it

EDITH: build is running - should be live in ~1 hour.

Last edited by bebbo; 12 October 2019 at 21:47.
bebbo is offline  
Old 12 October 2019, 22:52   #1183
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by bebbo View Post
guess the last binutil merge discarded the jsr->bsr optimization, or was it a gcc merge?


nm, I'll fix it

EDITH: build is running - should be live in ~1 hour.

please test
bebbo is offline  
Old 13 October 2019, 18:38   #1184
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
File size is back to ~59k (and "INFO: using long jump.." messages are also back). Thanks.
Toni Wilen is offline  
Old 19 October 2019, 09:51   #1185
ciVic
Registered User
 
Join Date: Oct 2013
Location: Germany
Posts: 39
I'm trying to use 6.5.0b to compile curl which now has a switch --with-amissl. However, the following simple source does not work so configure fails:

Code:
#include <proto/bsdsocket.h>
struct Library *SocketBase = NULL;
The output is:

Code:
/opt/amiga/m68k-amigaos/ndk-include/sys/socket.h:430:8: error: unknown type name 'ssize_t'
 extern ssize_t recv(int socket, void *buffer, size_t length, int flags);

[...]

In file included from /opt/amiga/m68k-amigaos/ndk-include/proto/bsdsocket.h:70:0,
                 from test.c:1:
/opt/amiga/m68k-amigaos/ndk-include/clib/bsdsocket_protos.h:103:16: error: conflicting types for 'recvmsg'
 __stdargs LONG recvmsg( LONG sock, struct msghdr *msg, LONG flags );
                ^~~~~~~
In file included from /opt/amiga/m68k-amigaos/ndk-include/netinet/in.h:57:0,
                 from /opt/amiga/m68k-amigaos/ndk-include/proto/bsdsocket.h:28,
                 from test.c:1:
/opt/amiga/m68k-amigaos/ndk-include/sys/socket.h:432:16: note: previous declaration of 'recvmsg' was here
 extern ssize_t recvmsg(int socket, struct msghdr *message, int flags);
There are a lot more errors like this.

I'm trying to compile it with:

Code:
m68k-amigaos-gcc test.c
ciVic is offline  
Old 21 October 2019, 17:44   #1186
ciVic
Registered User
 
Join Date: Oct 2013
Location: Germany
Posts: 39
Newest commit fixes this, thx!


But I have another question, probably not related to the toolchain. I'm trying to configure curl but the configure scripts always adds /opt/local/include:


Code:
  Host setup:       m68k-unknown-amigaos
  Install prefix:   /opt/m68k-amigaos
  Compiler:         m68k-amigaos-gcc
   CFLAGS:          -fomit-frame-pointer -m68020-60 -O2 -msoft-float -noixemul  -Werror-implicit-function-declaration -Wno-system-headers
   CPPFLAGS:        -I/opt/local/include
   LDFLAGS:         -L/opt/local/lib
   LIBS:            -lamisslauto -lz -lsocket

I don't know how to disable it. It can find some of the OpenSSL headers there and then compilation fails.
ciVic is offline  
Old 21 October 2019, 21:49   #1187
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by ciVic View Post
Newest commit fixes this, thx!


But I have another question, probably not related to the toolchain. I'm trying to configure curl but the configure scripts always adds /opt/local/include:


Code:
  Host setup:       m68k-unknown-amigaos
  Install prefix:   /opt/m68k-amigaos
  Compiler:         m68k-amigaos-gcc
   CFLAGS:          -fomit-frame-pointer -m68020-60 -O2 -msoft-float -noixemul  -Werror-implicit-function-declaration -Wno-system-headers
   CPPFLAGS:        -I/opt/local/include
   LDFLAGS:         -L/opt/local/lib
   LIBS:            -lamisslauto -lz -lsocket
I don't know how to disable it. It can find some of the OpenSSL headers there and then compilation fails.

maybe you can tell us a bit more - not only fragments...
bebbo is offline  
Old 23 October 2019, 12:22   #1188
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by ciVic View Post
Newest commit fixes this, thx!


But I have another question, probably not related to the toolchain. I'm trying to configure curl but the configure scripts always adds /opt/local/include:


Code:
  Host setup:       m68k-unknown-amigaos
  Install prefix:   /opt/m68k-amigaos
  Compiler:         m68k-amigaos-gcc
   CFLAGS:          -fomit-frame-pointer -m68020-60 -O2 -msoft-float -noixemul  -Werror-implicit-function-declaration -Wno-system-headers
   CPPFLAGS:        -I/opt/local/include
   LDFLAGS:         -L/opt/local/lib
   LIBS:            -lamisslauto -lz -lsocket

I don't know how to disable it. It can find some of the OpenSSL headers there and then compilation fails.
configure uses pkgconfig to look for libs/includes. You have to tell pkgconfig where to look, otherwise it will look in the system default directories, and if the libs are found it gets added to CFLAGS.

PKG_CONFIG_PATH=/opt/m68k-amigaos/lib/pkgconfig/:/opt/m68k-amigaos/share/pkgconfig/ ./configure <your-flags-here>

But since most libs for Amiga doesn't include pkgconfig .pc files, it will just fail at finding them (unless you make your own).

You can define path to ssl and disable stuff you don't need manually with configure instead to override this.

Another option is to override LDFLAGS and CPPFLAGS during "make"
Marlon_ is offline  
Old 24 October 2019, 09:46   #1189
ciVic
Registered User
 
Join Date: Oct 2013
Location: Germany
Posts: 39
Oh that's it, thx! configure tried to find an m68k-amigaos-pkg-config, found int /opt/local/bin a pkg-config that gave wrong paths. So, curl from git now compiles with 6.5.0b but crashes before main() is called. Chris Young said he was never able to compile it with something newer than gcc 3.3.3. So maybe I can find out what happens.
ciVic is offline  
Old 24 October 2019, 10:14   #1190
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by ciVic View Post
Oh that's it, thx! configure tried to find an m68k-amigaos-pkg-config, found int /opt/local/bin a pkg-config that gave wrong paths. So, curl from git now compiles with 6.5.0b but crashes before main() is called. Chris Young said he was never able to compile it with something newer than gcc 3.3.3. So maybe I can find out what happens.

if you'd share your recipe, I'd look into it too.
bebbo is offline  
Old 30 October 2019, 03:17   #1191
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by bebbo View Post
_mbstate_t was a pita (and maybe is) but for some time there were no more problems with it.


Please provide a proper example - mini source plus Makefile or provide at least your command line options.
This needs to be addressed as it doesn't work the same as on other toolchains.

If I use
Code:
#include <algorithm>
in my code, it should work on its own.

But with the m68k amiga gcc 6, you have to include cwchar before algorithm for it to work.

Do you need any more information?
Marlon_ is offline  
Old 30 October 2019, 10:55   #1192
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,289
It happens with a lot of C++ headers, e.g.
Code:
#include <random>
I worked it around by putting
Code:
#include <sys/_types.h>
before it, but it's not very pretty and requires many ifdefs where these headers are used.
BSzili is offline  
Old 02 December 2019, 19:09   #1193
ciVic
Registered User
 
Join Date: Oct 2013
Location: Germany
Posts: 39
Any news about curl? (Sent details via PM before)
ciVic is offline  
Old 18 December 2019, 22:16   #1194
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
I'm using gas (GNU Assembler) GNU assembler (GNU Binutils) 2.31.51.20181223-111052 with the tool chain 6.4.1b m68k-amigaos-gcc (GCC) 6.4.1b 20181227-113300.

GNU Assembler works fine and I was able to execute assembler programs on WinUAE, but when I make a mistake forgetting a symbol definition GNU assembler or ld treat the error like a warning. I would like the toolchain treat this kind of warnings like errors.

For instance, I define:
msg_length = msg_end - msgd /* error: msgd instead of msg */

GNUAssembler or linker output:
...
UNDEFINED SYMBOLS
msgd

...
BUILD SUCCESSFUL (total time ...)

The build is considered successful. I have tried to use --error-unresolved-symbols and -Wl,--error-unresolved-symbols, with no success. The option is not recognized.

Is there any solution for this? Is this solved/fixed in the next version of chaintool?
JuanLuis is offline  
Old 18 December 2019, 23:15   #1195
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
when the symbols is undefined there's no way around it. Maybe you're mixing with "duplicate symbols".

Use "objdump" on objects (the one defining it and the one using it) to see if msgd isn't listed as _msgd (with leading underscore) in one of them. Conventions between languages may vary.
jotd is offline  
Old 19 December 2019, 00:24   #1196
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
jotd, the problem is that the compiler returns successful build when there are undefined symbols. In this situation, I want an error instead of a warning.
JuanLuis is offline  
Old 20 December 2019, 22:02   #1197
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by JuanLuis View Post
I'm using gas (GNU Assembler) GNU assembler (GNU Binutils) 2.31.51.20181223-111052 with the tool chain 6.4.1b m68k-amigaos-gcc (GCC) 6.4.1b 20181227-113300.

GNU Assembler works fine and I was able to execute assembler programs on WinUAE, but when I make a mistake forgetting a symbol definition GNU assembler or ld treat the error like a warning. I would like the toolchain treat this kind of warnings like errors.

For instance, I define:
msg_length = msg_end - msgd /* error: msgd instead of msg */

GNUAssembler or linker output:
...
UNDEFINED SYMBOLS
msgd

...
BUILD SUCCESSFUL (total time ...)

The build is considered successful. I have tried to use --error-unresolved-symbols and -Wl,--error-unresolved-symbols, with no success. The option is not recognized.

Is there any solution for this? Is this solved/fixed in the next version of chaintool?

I'm not sure what the real error is. That's not enough information here.
bebbo is offline  
Old 21 December 2019, 11:26   #1198
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
JuanLuis then the problem is in your build script maybe?
jotd is offline  
Old 21 December 2019, 16:34   #1199
JuanLuis
Registered User
 
Join Date: Dec 2018
Location: Málaga
Posts: 61
Quote:
Originally Posted by bebbo View Post
I'm not sure what the real error is. That's not enough information here.
I attach a couple of files. main.s is the assembler program with an error.

--- main.s ---
...
msg:
.ascii "Calculando numeros primos, espere por favor..."
dc.b LF
msg_end: /* msg_end is defined here */

msg_length = msg_ed - msg /* There is a mistake. It should be msg_end instead of msg_ed */
...
--- end of main.s ---

--- build_msg.txt ---
...
main.s:52 .text:000000000000004c msg
*ABS*:0000000000000000
*ABS*:0000000000000000 msg_length <-- msg_length is zero
*ABS*:0000000000000000
main.s:41 .text:000000000000003e close_AmigaDOS
*ABS*:0000000000000000
*ABS*:0000000000000000
*ABS*:0000000000000000
main.s:47 .text:000000000000004a end
*ABS*:0000000000000000
*ABS*:0000000000000000
main.s:55 .text:000000000000007b msg_end
*ABS*:0000000000000000
*ABS*:0000000000000000
...
UNDEFINED SYMBOLS
msg_ed

mkdir -p dist/Debug/Amiga_Cygwin64_Bebbo-Windows
m68k-amigaos-gcc -o dist/Debug/Amiga_Cygwin64_Bebbo-Windows/primos build/Debug/Amiga_Cygwin64_Bebbo-Windows/main.o -Wl,--error-unresolved-symbols
make[2]: se sale del directorio '/cygdrive/c/Users/Juan Luis/Documents/NetBeansProjects/Primos'
make[1]: se sale del directorio '/cygdrive/c/Users/Juan Luis/Documents/NetBeansProjects/Primos'

BUILD SUCCESSFUL (total time: 1s)
--- end of build_msg.txt ---
Attached Files
File Type: s main.s (1.3 KB, 70 views)
File Type: txt build_msg.txt (7.5 KB, 88 views)
JuanLuis is offline  
Old 21 December 2019, 17:34   #1200
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
can you show your build script (makefile/shell file?)
jotd 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 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14: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 03:44.

Top

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