English Amiga Board


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

 
 
Thread Tools
Old 11 October 2019, 21:59   #1181
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,352
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 12 October 2019, 00:22   #1182
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
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 22:47.
bebbo is offline  
Old 12 October 2019, 23:52   #1183
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
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, 19:38   #1184
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,352
File size is back to ~59k (and "INFO: using long jump.." messages are also back). Thanks.
Toni Wilen is offline  
Old 19 October 2019, 10:51   #1185
ciVic
Registered User

 
Join Date: Oct 2013
Location: Germany
Posts: 30
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, 18:44   #1186
ciVic
Registered User

 
Join Date: Oct 2013
Location: Germany
Posts: 30
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, 22:49   #1187
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
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, 13:22   #1188
Marlon_
AmigaDev.com

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 31
Posts: 600
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, 10:46   #1189
ciVic
Registered User

 
Join Date: Oct 2013
Location: Germany
Posts: 30
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, 11:14   #1190
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 429
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, 04:17   #1191
Marlon_
AmigaDev.com

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 31
Posts: 600
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, 11:55   #1192
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 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, 20:09   #1193
ciVic
Registered User

 
Join Date: Oct 2013
Location: Germany
Posts: 30
Any news about curl? (Sent details via PM before)
ciVic 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 07:36.


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