English Amiga Board


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

 
 
Thread Tools
Old 08 March 2022, 18:31   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
Suggestion on Configuring VBCC to Avoid Assigns

Hi all!

I'd like your suggestion on running VBCC.

Currently, I have an assign VBCC: that points to its installation: Assign VBCC: "Utilitaires: Développement/Cubic IDE/ide/devkits/compilers/vbcc/0.9h".

I'd like to control the NDK, etc. used for the compilation using the makefile only, not the assigns vincludeos3: and vlibos3:, without modifying VBCC itself, in particular without modifying vc.config.

It's easy enough for vincludeos3:. I assign it to RAM: and I use the -I compiler option to include the desired NDK.

But I don't know how to do the same for vlibos3: because, in vc.config, this assign is used to find startup.o:

Code:
...
-ld=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel vlibos3:startup.o %s %s -Lvlibos3: -lvc -o %s
-l2=vlink -bamigahunk -x -Bstatic -Cvbcc -nostdlib -mrel %s %s -Lvlibos3: -o %s
-ldv=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -mrel vlibos3:startup.o %s %s -Lvlibos3: -lvc -o %s
-l2v=vlink -bamigahunk -t -x -Bstatic -Cvbcc -nostdlib -mrel %s %s -Lvlibos3: -o %s
...
How could I select/provide startup.o in the makefile without the assign?

Cheers!

Last edited by tygre; 08 March 2022 at 20:04.
tygre is offline  
Old 08 March 2022, 19:17   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,263
I don't know if it's the best way, but you could make one or more copies of vc.config in your source folder, modify them according to your needs and build using vc +$(desired-config). You could add the different include paths to the config files as well.
paraj is offline  
Old 08 March 2022, 20:07   #3
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
Hi Paraj!

That's a great idea
I'll try later today!

I wonder if there even could be a solution without having to duplicate vc.config?

Cheers!
tygre is offline  
Old 08 March 2022, 20:20   #4
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,263
You can call vbccm68k/vasm/vlink yourself in your makefile (i.e. do the work vc normally does). That's probably easier in your use case, but maybe phx has a better recommendation
paraj is offline  
Old 13 March 2022, 13:58   #5
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,555
I understand your goal is to be able to run vbcc with different NDKs?

One solution would be to remove the NDK-path from the vincludeos3: assign in your user-startup. But then you have to add a -I with the NDK-headers path in every project.

I would make another config file, as paraj already suggested. For example aos39. This would even give you the possibility to use the amiga.lib and inline headers from previous vbcc releases to remove all newer functions.
phx is offline  
Old 13 March 2022, 15:47   #6
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
Quote:
Originally Posted by phx View Post
I understand your goal is to be able to run vbcc with different NDKs?
Yes

Quote:
Originally Posted by phx View Post
One solution would be to remove the NDK-path from the vincludeos3: assign in your user-startup. But then you have to add a -I with the NDK-headers path in every project.

I would make another config file, as paraj already suggested. For example aos39. This would even give you the possibility to use the amiga.lib and inline headers from previous vbcc releases to remove all newer functions.
I will definitely try this!

I was "stuck" because of the use of vlibos3:startup.o in vc.config but with your and Paraj's suggestions, I'll create a new config file, in which I could point to different paths...

Thanks!
tygre is offline  
Old 24 April 2022, 01:00   #7
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
Hi all!

I'm trying to avoid vc and vbccprefs to learn in details how things work "under the hood" (and avoid assigns, too)

I wonder if there is an way to have not to call vasmm68k_mot? Is the option -noasm a good idea? (The manual says "only for testing"...)

Thanks!
tygre is offline  
Old 24 April 2022, 05:38   #8
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
In the meantime, I used vasmm68k_mot and reached the linking phase... which fails with this error:

Code:
VBCC:bin/vlink -bamigahunk -Cvbcc -mrel -nostdlib -x -lmieee -Bstatic -LVBCC:targets/m68k-amigaos/NDK_32/lib/ -lamiga
 -LVBCC:targets/posixlib/lib/            -lposix vlibos3:startup.o -Lvlibos3: -lvc o/vbcc-classic/debug/blacklists.o
 o/vbcc-classic/debug/controls.o o/vbcc-classic/debug/controls_cli.o o/vbcc-classic/debug/controls_mui.o
 o/vbcc-classic/debug/controls_rea.o o/vbcc-classic/debug/controls_workers.o o/vbcc-classic/debug/ftp.o
 o/vbcc-classic/debug/http.o o/vbcc-classic/debug/kvs.o o/vbcc-classic/debug/locale.o o/vbcc-classic/debug/log.o
 o/vbcc-classic/debug/main.o o/vbcc-classic/debug/mui.o o/vbcc-classic/debug/players.o o/vbcc-classic/debug/prefs.o
 o/vbcc-classic/debug/ratings.o o/vbcc-classic/debug/rea.o o/vbcc-classic/debug/ringhio.o
 o/vbcc-classic/debug/sources.o o/vbcc-classic/debug/utils.o o/vbcc-classic/debug/utils_tasks.o
 o/vbcc-classic/debug/version.o o/vbcc-classic/debug/xad.o o/vbcc-classic/debug/z_fortify.o
 o/vbcc-classic/debug/z_ftpparse.o  -o bin/vbcc-classic/debug/AmiModRadio
Error 19: o/vbcc-classic/debug/main.o: Global symbol ___stack from main.o is already defined in vc.lib(__stack.c).
make: *** [bin/vbcc-classic/debug/AmiModRadio] Error 20
Done.
This is actually normal , because I do (re)define the __stack as:

Code:
size_t __stack = 32768
What I can't understand is, why did this same code link when I was using vc and what should I do to make it link again while (re)defining __stack?

Thanks in advance!
tygre is offline  
Old 24 April 2022, 22:16   #9
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
I got everything to compile without using vc

What blocked me for a while was that I had to specify the object files and libraries in this order! Object files first then libraries (amiga, mieee, posix, and vc)... I wonder why that is?

Also, now, the linker is much more verbose but doesn't recognise the -quiet option (like the compiler and assembler do), what option could I use to make it less verbose (suppress "Loading files:", "Digesting symbols information:", etc.)? (I could redirect its output to NIL: but there must be a better way?)

Cheers!

Last edited by tygre; 24 April 2022 at 22:24.
tygre is offline  
Old 11 May 2022, 18:47   #10
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,555
Sorry, missed that.

Quote:
Originally Posted by tygre View Post
Code:
size_t __stack = 32768
What I can't understand is, why did this same code link when I was using vc and what should I do to make it link again while (re)defining __stack?
Before,
__stack
was defined in a library-object, which is only linked to the output file when it resolves any reference. As
__stack
was already resolved from an object file, it was then simply ignored.

You can put symbols into a linker library, to be able to overwrite their definition with an object file. Another possibility wold be "weak" symbols, but they don't exist in AmigaDOS hunk-format.

Quote:
Originally Posted by tygre View Post
What blocked me for a while was that I had to specify the object files and libraries in this order! Object files first then libraries (amiga, mieee, posix, and vc)... I wonder why that is?
It's always good practise to place libraries last on the line. As mentioned above, symbols from an object file may replace symbols from a linker library.

Quote:
Also, now, the linker is much more verbose but doesn't recognise the -quiet option (like the compiler and assembler do), what option could I use to make it less verbose (suppress "Loading files:", "Digesting symbols information:", etc.)?
The default behaviour of vlink is quiet. This sounds as if you have given the
-t
(trace) option.
phx is offline  
Old 07 June 2022, 17:39   #11
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,445
Hi phx and thank you for your explanations

Cheers!
tygre 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
Where do the assigns come from? alexscotti Amiga scene 5 09 December 2020 13:20
Help with assigns for these games Amigajay project.CD32 Conversion 30 07 May 2020 12:17
Help for Assigns? utri007 support.Apps 15 26 April 2019 09:40
Assigns Brick Nash support.WinUAE 8 23 March 2015 11:45
Assigns for Games rossb project.ClassicWB 0 06 May 2010 14:33

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

Top

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