English Amiga Board


Go Back   English Amiga Board > News

 
 
Thread Tools
Old 03 November 2017, 23:18   #21
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,974
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  
AdSense AdSense  
Old 04 November 2017, 00:29   #22
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,019
-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, 09:52   #23
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,974
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 13:35.
jotd is offline  
Old 04 November 2017, 13:43   #24
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,019
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, 15:15   #25
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 1,974
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, 05:39   #26
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montrťal, QC, Canada
Posts: 528
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, 22:48   #27
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 1,576
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 offline  
Old 22 November 2017, 23:13   #28
alkis
Registered User

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

 
Join Date: Aug 2017
Location: Spain
Posts: 6
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, 10:05   #30
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 1,576
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 offline  
Old 23 November 2017, 10:42   #31
adolfo.pa
Registered User

 
Join Date: Aug 2017
Location: Spain
Posts: 6
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, 10:52   #32
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 1,576
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 offline  
Old 23 November 2017, 11:25   #33
adolfo.pa
Registered User

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

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

 
Join Date: Aug 2017
Location: Spain
Posts: 6
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, 19:20   #36
plasmab
Registered User

plasmab's Avatar
 
Join Date: Sep 2016
Location: Glasgow
Posts: 1,576
Aha.. i got it working.. no idea what was wrong but i'm away now. Thanks
plasmab is offline  
AdSense AdSense  
 


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++ 8 18 November 2016 06:44
vbcc V0.9e released phx News 17 31 October 2016 22:18
vbcc 0.9d phx News 43 13 July 2015 20:41
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 15:45
Compiler: vbcc 0.8g patch 2 released Paul News 0 29 November 2004 16: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 19:15.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.18646 seconds with 12 queries