FreeBASIC Online Documentation - Wiki

Forum for discussion about the documentation project.
fxm
Moderator
Posts: 12081
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC Online Documentation - Wiki

Post by fxm »

coderJeff wrote: May 30, 2022 23:47 .....
normal fbc:
- binary path = <prefix>/freebasic/<target->
- binary path = <prefix>/freebasic/<buildprefix>
.....
Double definition or else one or the other depending on ..... ?
coderJeff
Site Admin
Posts: 4313
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC Online Documentation - Wiki

Post by coderJeff »

Oops, I made some typos:

normal fbc:
- binary path = <prefix>/freebasic/<target->
- binary path = <prefix>/freebasic/<buildprefix>
- default binary path:
---- binary path = <prefix>/bin/<target->
- or if '-buildprefix' given
----- binary path = <prefix>/bin/<buildprefix>

The tool name prefix (stored in the binary path) is set by default with 'target' + '-'.
'-buildprefix <name>' overrides the tool name prefix.

When 'binary path' is set (internally in the fbc compiler), it includes the prefix of the tool name. That's probably confusing to explain the behaviour that way. (It's handled a little weird in fbc sources, and I am writing the rules from what is coded in fbc sources. It's probably not the clearest for a user - so will need to work on that).

Maybe there is another way to describe using this example to work from:
For example:
fbc -prefix /pppp/ -target tttt source.bas
gnu-AS invoked is: /pppp/bin/tttt-as

fbc -prefix /pppp/ -target tttt -buildprefix bbbbX source.bas
gnu-AS invoked is: /pppp/bin/bbbbXas

'-prefix' option controls top level path for fbc
'-target' controls code generation and many related options including the default tool name prefix
'-buildprefix' overrides the default tool name prefix
adeyblue
Posts: 299
Joined: Nov 07, 2019 20:08

Re: FreeBASIC Online Documentation - Wiki

Post by adeyblue »

On topic but off topic:
Are there any readily available Windows->Linux cross compilers? As in runs on Windows, outputs Linux ELFs
I mean a prebuilt download like WinLibs and not having to install cygwin and basically build it myself
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC Online Documentation - Wiki

Post by dodicat »

Have a look at
https://www.freebasic.net/wiki/CompilerOpttarget
You'll maybe get some ideas.
adeyblue
Posts: 299
Joined: Nov 07, 2019 20:08

Re: FreeBASIC Online Documentation - Wiki

Post by adeyblue »

I meant GCC/binutils. The bits you need to have so that those FB options work.
My 'exceptions' stuff now works fine on Windows and I've written Linux support for it but I don't particularly fancy setting everything up to build the FB compiler on Linux if there's a ready-made Linux targeting GCC I can plop into my Windows setup.
marcov
Posts: 3454
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: FreeBASIC Online Documentation - Wiki

Post by marcov »

adeyblue wrote: Jun 02, 2022 1:26 I meant GCC/binutils. The bits you need to have so that those FB options work.
My 'exceptions' stuff now works fine on Windows and I've written Linux support for it but I don't particularly fancy setting everything up to build the FB compiler on Linux if there's a ready-made Linux targeting GCC I can plop into my Windows setup.
Crosscompiling is rarely easier than actually setting up the target for the first compile since it is always way more complicated, quite often even if you are a pro. Only when you start to repeat that pays off.

Also keep in mind that crosscompiling often needs target libraries on host, so you might need a Linux distro anyway to siphon the required libraries off beyond the base crosscompile package.

In short, avoid the hill, first familiarize yourself with FB on Linux in a virtualbox or so.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC Online Documentation - Wiki

Post by dodicat »

Have you tried this built in (>=win 10 pro)
https://docs.microsoft.com/en-us/virtua ... le-hyper-v
Maybe easier than cygwin.
adeyblue
Posts: 299
Joined: Nov 07, 2019 20:08

Re: FreeBASIC Online Documentation - Wiki

Post by adeyblue »

I found a prebuilt clang one on the Unreal Engine site. But yeah, I just gave up looking for GCC and installed everything in ubuntu.
Now I'm having fun* in that libgcc_s unwinding and libunwind's unwinding is the same, but not because GCCs crashes when doing something really esoteric and obscure like asking 'what's the stack pointer of the frame?' On x64, where that's readily available.
Also they both number the registers differently, because why wouldn't you implement an existing interface and then change the parameter details?
Anyway, enough off topic

What is on topic:
Good work on the wiki searchability. First time I've searched for something and the FB wiki has been above the documentation help site on DuckDuckGo. Yay!
Post Reply