English Amiga Board


Go Back   English Amiga Board > News

 
 
Thread Tools
Old 03 November 2017, 22:18   #21
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,546
Sorry about the stupid question, but I wasn't able to figure out the syntax to link using 1.3 compatible hunks.

vlink -o jst myobject.o myobject2.o

I've seen the -kick1hunks option but unable to use it. Is it even possible (phxass linker had the KICK1 switch)
jotd is offline  
Old 03 November 2017, 23:29   #22
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,188
-kick1hunks is a vasm option.

As long as you make sure that the compiler/assembler emits valid Kickstart 1.x hunks, then vlink will do no harm to them.

The only vlink-option you shouldn't forget, when linking 1.x executables, is the -Z option. It prevents vlink from stripping zero-bytes from the end of a hunk.
phx is offline  
Old 04 November 2017, 08:52   #23
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,546
thanks, I'll test that right away. Shouldn't be a "Support / VASM" entry in EAB? I feel I'm hijacking threads to get my answers.

yeah after upgrading to 1.8 that works. thanks

Last edited by jotd; 04 November 2017 at 12:35.
jotd is offline  
Old 04 November 2017, 12:43   #24
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,188
Quote:
Originally Posted by jotd View Post
thanks, I'll test that right away. Shouldn't be a "Support / VASM" entry in EAB?
There is the Coders forum. I would say vbcc-questions belong to Coders.C/C++ and vasm-questions perhaps to Coders.Asm/Hardware. Linker questions could be asked in Coders.General.

Or write me a mail. This is usually the fastest way, because I don't check EAB several times a day like my mail.

Quote:
EDIT: ooops I have 1.6 on Windows...
1.6 of what? vasm? Can be more than four years old.

Also your vlink-version seems old. -Z is supported since V0.15d. 0.15c and 0.15b have a problem, because -Z is missing. And older versions do not strip zero bytes at all.
phx is offline  
Old 04 November 2017, 14:15   #25
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,546
yeah, I found the excellent pre-built version of 1.8 by Leffman, which solved the issue. Thanks for your support. this allows me to resume development of my somehow bloated JST tool which made phxass crash sometimes (or generate wrong code). Plus it took a while to assemble.

Now I can build big blocks & use "modern" tools & windows (and I'll simplify my prog because it's "bloated"). Amiga gaming community says thanks.
jotd is offline  
Old 05 November 2017, 04:39   #26
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 546
Quote:
Originally Posted by phx View Post
Hightlights:
  • Possibility to create residentable (pure) executables.
  • More C99 support and more optimizes math functions (thanks Matt Hey).
  • New target for Kickstart 1.x programs, using the original Commodore 1.3 headers.
  • New target for Atari Jaguar consoles.
  • Many bug fixes and enhancements.

We are happy to announce that iComp GmbH (www.icomp.de) has decided to sponsor the 68k-AmigaOS version of vbcc. This does not only help us to continue supporting and improving this port but it also allows us to relax the terms of use for the Amiga-68k community. Everyone may now freely use vbcc to develop 68k-AmigaOS code for commercial as well as non-commercial usage (for details please refer to the license in the documentation).


We thank iComp GmbH for the confidence in vbcc and hope that this step will help in the creation of new software for the Amiga-68k.
Excellent news!

Cheers!
tygre is offline  
Old 22 November 2017, 21:48   #27
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
Ok i must be being stupid..

I have the following code in a standard main(int argc, char **argv) ...


Code:
  for (int i = 0; i < 100; i++)
    {

      printf("Tick: %i\n", i);
    }
i've included ...

Code:
#include <exec/types.h>
#include <exec/memory.h>

#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
#include <proto/expansion.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
and i have compiled with ...

vc -c99 +aos68k -I$NDK_INC -L$NDK_LIB -o test testzorroiii.c -lamiga


any printf() statements with formating in them get ignored. If i do


printf("moo\n");

it prints moo... but if it do printf("moo: %i\n", 4); it just ignores that statement as if it were commented out.. driving me crazy.
plasmab is online now  
Old 22 November 2017, 22:13   #28
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 441
Try %d or even %ld (instead of %i)
alkis is offline  
Old 22 November 2017, 22:51   #29
adolfo.pa
Registered User

 
Join Date: Aug 2017
Location: Spain
Posts: 30
I don't know exactly what's going on there, but are you using NDK's 'amiga.lib' instead of VBCC's one for any particular reason? Quoting from the documentation (12.4.8):
To write programs accessing AmigaOS (rather than standard C functions only), a replacement for the original (copyrighted) amiga.lib is provided with vbcc. This replacement is adapted to vbcc, does not cause collisions with some functions (e.g. sprintf) provided by the original amiga.lib and is available in small data. It is recommended to always use this library rather than the original version.
Removing the -L flag so that it uses the default one makes everything work as expected.
adolfo.pa is offline  
Old 23 November 2017, 09:05   #30
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
vbcc 0.9f released

If I do that I get

Reference to undefined symbol _OpenLibrary ... so that’s why I added the -lamiga

Similarly removing just the -L has the same outcome.
plasmab is online now  
Old 23 November 2017, 09:42   #31
adolfo.pa
Registered User

 
Join Date: Aug 2017
Location: Spain
Posts: 30
That is weird. I can reproduce your problem consistently, and by removing the -L everything is fine again. This works for me:

vc -c99 +aos68k -I$NDK_INC -o foo foo.c -lamiga

Maybe there's something wrong with your vbcc installation? In the config/aos68k configuration file there should be something similar to this in a couple of places:

-L$VBCC/targets/m68k-amigaos/lib

Can you check if that path exists and if there is an amiga.lib file in there?
adolfo.pa is offline  
Old 23 November 2017, 09:52   #32
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
vbcc 0.9f released

Possible.. here is the code I’m trying to compile.

https://pastebin.com/z9Mvcp4J

It’s not the full version. But demos enough

EDIT: I have those files in that location and in the config as you describe.
plasmab is online now  
Old 23 November 2017, 10:25   #33
adolfo.pa
Registered User

 
Join Date: Aug 2017
Location: Spain
Posts: 30
Your code compiles and runs fine in my machine. Sorry @plasmab, I'm out of ideas :-(
adolfo.pa is offline  
Old 23 November 2017, 10:28   #34
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
I was afraid you’d say that. You cross compiling from Linux? And does it print the ticks?
plasmab is online now  
Old 23 November 2017, 14:54   #35
adolfo.pa
Registered User

 
Join Date: Aug 2017
Location: Spain
Posts: 30
I'm crosscompiling from OSX, and running it under fs-uae (the config. I'm using is roughly equivalent to an A500 + ACA500plus + KS/WB3.1).

As this looks like a linking problem, maybe executing the compile an linking steps independently may give us a clue. Generate the object file with:

vc -c99 +aos68k -I$NDK_INC -c -o foo.o foo.c

and then try to link the executable (this is roughly the same command you should have in the config file, in the -ld flag):

vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel $VBCC/targets/m68k-amigaos/lib/startup.o foo.o -L$VBCC/targets/m68k-amigaos/lib -lvc -lamiga -o foo

With this I get a valid executable which prints the ticks as expected.
adolfo.pa is offline  
Old 23 November 2017, 18:20   #36
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
Aha.. i got it working.. no idea what was wrong but i'm away now. Thanks
plasmab is online now  
Old 25 March 2018, 18:15   #37
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
Ok i have a weird issue.. Im sure its FAQ level stuff but here goes. I am trying to compile the example from

http://www.pjhutchison.org/tutorial/gadgets.html

using VBCC.

It compiles but wont link.

Quote:
vc -c99 +aos68k -I$NDK_INC -c -o test.o test.c
stephen@developer:~/compileZone/fs-uae$ vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel $VBCC/targets/m68k-amigaos/lib/startup.o test.o -L$VBCC/targets/m68k-amigaos/lib -lvc -lamiga
amiga.lib(UnlockPubScreen.o): In "_UnlockPubScreen":
Error 21: amiga.lib(UnlockPubScreen.o) (CODE+0x4): Reference to undefined symbol _IntuitionBase.
amiga.lib(FreeVisualInfo.o): In "_FreeVisualInfo":
Error 21: amiga.lib(FreeVisualInfo.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(FreeGadgets.o): In "_FreeGadgets":
Error 21: amiga.lib(FreeGadgets.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(CloseWindow.o): In "_CloseWindow":
Error 21: amiga.lib(CloseWindow.o) (CODE+0x4): Reference to undefined symbol _IntuitionBase.
amiga.lib(GT_ReplyIMsg.o): In "_GT_ReplyIMsg":
Error 21: amiga.lib(GT_ReplyIMsg.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(GT_GetIMsg.o): In "_GT_GetIMsg":
Error 21: amiga.lib(GT_GetIMsg.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(GT_RefreshWindow.o): In "_GT_RefreshWindow":
Error 21: amiga.lib(GT_RefreshWindow.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(OpenWindowTags.o): In "_OpenWindowTags":
Error 21: amiga.lib(OpenWindowTags.o) (CODE+0x4): Reference to undefined symbol _IntuitionBase.
amiga.lib(CreateGadgetA.o): In "_CreateGadgetA":
Error 21: amiga.lib(CreateGadgetA.o) (CODE+0x6): Reference to undefined symbol _GadToolsBase.
amiga.lib(CreateContext.o): In "_CreateContext":
Error 21: amiga.lib(CreateContext.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(GetVisualInfo.o): In "_GetVisualInfo":
Error 21: amiga.lib(GetVisualInfo.o) (CODE+0x4): Reference to undefined symbol _GadToolsBase.
amiga.lib(LockPubScreen.o): In "_LockPubScreen":
Error 21: amiga.lib(LockPubScreen.o) (CODE+0x4): Reference to undefined symbol _IntuitionBase.
The code looks like it uses protos correctly and i have the protos installed. I get the same result if i use vbcc on the Amiga or cross'd with linux.

for quick reference source pastebin'd to https://pastebin.com/Ccn0wvH0
plasmab is online now  
Old 25 March 2018, 19:19   #38
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,176
Try linking with
-lauto
.
Leffmann is offline  
Old 25 March 2018, 19:26   #39
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 2,651
That changes the output..

Quote:
$ vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel $VBCC/targets/m68k-amigaos/lib/startup.o test.o -L$VBCC/targets/m68k-amigaos/lib -lvc -lauto
test.o: In "_main":
Error 21: test.o (CODE+0x12): Reference to undefined symbol _LockPubScreen.
Error 21: test.o (CODE+0x24): Reference to undefined symbol _GetVisualInfo.
test.o: In "l12":
Error 21: test.o (CODE+0x60): Reference to undefined symbol _CreateContext.
test.o: In "l17":
Error 21: test.o (CODE+0xec): Reference to undefined symbol _CreateGadgetA.
test.o: In "l19":
Error 21: test.o (CODE+0x18c): Reference to undefined symbol _OpenWindowTags.
Error 21: test.o (CODE+0x198): Reference to undefined symbol _GT_RefreshWindow.
test.o: In "l28":
Error 21: test.o (CODE+0x1b6): Reference to undefined symbol _Wait.
Error 21: test.o (CODE+0x1c0): Reference to undefined symbol _GT_GetIMsg.
Error 21: test.o (CODE+0x1ce): Reference to undefined symbol _GT_ReplyIMsg.
test.o: In "l30":
Error 21: test.o (CODE+0x1ec): Reference to undefined symbol _CloseWindow.
test.o: In "l34":
Error 21: test.o (CODE+0x1fe): Reference to undefined symbol _FreeGadgets.
test.o: In "l36":
Error 21: test.o (CODE+0x214): Reference to undefined symbol _FreeVisualInfo.
test.o: In "l38":
Error 21: test.o (CODE+0x224): Reference to undefined symbol _UnlockPubScreen.
Which feels like something needs tweaked to make it work..
plasmab is online now  
Old 25 March 2018, 19:44   #40
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,176
It looks like it's not finding everything it needs from amiga.lib, but I'm not sure. Try separating the M68K target and NDK headers and libraries, and let the M68K target directories have priority. That's how I've set mine up, and the program builds without errors here.
Leffmann 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
vbcc IDE iliak Coders. C/C++ 18 18 August 2018 09:59
vbcc V0.9e released phx News 17 31 October 2016 21:18
vbcc 0.9d phx News 43 13 July 2015 19:41
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45
Compiler: vbcc 0.8g patch 2 released Paul News 0 29 November 2004 15:41

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:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.10152 seconds with 15 queries