freebasic.net Forum Index
FreeBASIC's Official Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in

FB/Win32/MSYS compilation docs fixed
Goto page 1, 2  Next
 
Post new topic   Reply to topic    freebasic.net Forum Index -> Documentation
View previous topic :: View next topic  
Author Message
jonathanbrickman0000

PostPosted: Apr 09, 2006 0:50    Post subject: FB/Win32/MSYS compilation docs fixed Reply with quote

They appear to be fixed. If anyone finds a problem, please post it here. Also, if anyone knows how to add /mingw/lib to the standard linker path, or could add it to the standard CVS, that would be very helpful!
 
Back to top
View user's profile Send e-mail Visit poster's website
Sisophon2001
Master
PostPosted: Apr 09, 2006 3:22    Post subject: Re: FB/Win32/MSYS compilation docs fixed Reply with quote

jonathanbrickman0000 wrote:
<snip> Also, if anyone knows how to add /mingw/lib to the standard linker path, or could add it to the standard CVS, that would be very helpful!


Why do you want to do this? If users have MinGW then it will be in different locations on different computers. Are you concerned with the ld that comes with FB or the ld that comes with MinGW?

If you need to link to extra libraries why not put them in the FB lib directory?

If you want to see the searched paths, run

ld --verbose

I read someplace that the default search paths for ld were set at compile time, but I also noted that we have a file called i386pe.x in our bin directory which being curious about what it was for, I opened, and saw that it appears to be setting a default search path for ld.

I just tried it now, and I can edit this file to add new search paths to the linker, by copying the syntax from ld –-verbose.

Garvan
 
Back to top
View user's profile Send e-mail Visit poster's website
jonathanbrickman0000

PostPosted: Apr 09, 2006 4:04    Post subject: Reply with quote

Actually, /lib/mingw will be /lib/mingw on any working MSYS installation; gcc/MSYS requires it, and MSYS sets up its own virtual paths (forward slashes only) in addition to Windows-standard. Ditto Cygwin, to an extent differently (no Windows-standard, somewhat different tree, but /lib and /lib/mingw are still there).

fbc is using its own supplied ld, which does not know about the standard MSYS or Cygwin paths.

I found the .x file you pointed out; I think that is the way. It is a standard ld linker script, and so I might be able to add a line to its end to add /lib/mingw (no drive letter, forward-slashes) to the standard Win32 FB ld search path. But I would appreciate it if someone experienced in FB ld scripts would do it and put it in CVS; I studied that script file, and it's a language all its own.
 
Back to top
View user's profile Send e-mail Visit poster's website
Sisophon2001
Master
PostPosted: Apr 09, 2006 5:18    Post subject: Reply with quote

Did you look at the paths ld searches using ld --verbose?

This is the default search path of the linker that comes with FreeBASIC.

SEARCH_DIR("/mingw/mingw32/lib"); SEARCH_DIR("/mingw/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");

The Script file adds one additional search path.

SEARCH_DIR("lib");

I don’t have any problem building the compiler with MSYS, so what problem are you seeing?

Did you copy libmingwex.a into your FB lib directory?

Garvan
 
Back to top
View user's profile Send e-mail Visit poster's website
jonathanbrickman0000

PostPosted: Apr 09, 2006 19:58    Post subject: Reply with quote

Garvan, that's it. Easy as pie, works great. I should have thought of that, simply because FBC comes with its own ld.exe. MSYS procedure adjusted; Cygwin shortly.
 
Back to top
View user's profile Send e-mail Visit poster's website
DrV
Site Admin
PostPosted: May 01, 2006 19:11    Post subject: Reply with quote

I just read the procedures now, and it appears that you are building the compiler before rtlib, which means that the new fbc will still be linked with the old rtlib. If you want to have the latest fbc linked with the latest rtlib, you should build the rtlib first, then the compiler. To be extra safe (in case some part of the rtlib <-> compiler interface changes drastically), you could rebuild the compiler first as is done now, then again after building the new rtlib.
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jonathanbrickman0000

PostPosted: May 02, 2006 10:57    Post subject: Reply with quote

So should it be something like:

Build rtlib, copy to ~FB/lib
Build rtlibx, copy to ~FB/lib
Build compiler, copy to ~FB/lib

Or should it be...

Build rtlib
Build rtlibx
Build compiler
Copy all three to ~FB/lib

Or some other permutation?
 
Back to top
View user's profile Send e-mail Visit poster's website
Sisophon2001
Master
PostPosted: May 02, 2006 12:42    Post subject: Reply with quote

Always follow the first option, but be careful to have backups of the libraries. The old fbc may be incompatible with the new runtime library or it can fail to compile the new fbc, but this will not happen often.

If you follow the second option, the new compiler gets linked to the old library and you have a hybrid version that may be buggy.

The correct answer may depend on the modifications made since the last compiler update.

Several times I needed to modify the source code downloaded from SF so that I could build an intermediate version that I in then used to compile CVS version.

This game of following the latest build is not always a straight forward one, and it is often not worth the effort, unless you are interested in learning.

For general advice, it is sometimes recommended to build a self compiling compiler three times before use. This process should work out any obvious cyclic bugs, which appear in every second version of a compile.

Garvan

EDIT 2006-05-03:
Re-read my post, and decided it did not say exactly as I intended, so I updated it.
 
Back to top
View user's profile Send e-mail Visit poster's website
jonathanbrickman0000

PostPosted: May 10, 2006 14:33    Post subject: Reply with quote

Thanks, Siso. I referenced your post immediately above in a note at the end of each doc. I'll do better as soon as I am given time.
 
Back to top
View user's profile Send e-mail Visit poster's website
ici

PostPosted: Oct 11, 2006 17:05    Post subject: Reply with quote

Hi all, and especially DrV :)

Please change in CVS Tree, src/rtlib/win32/fb_win32.h, line 80:
Code:
#ifdef TARGET_CYGWIN
typedef _off64_t fb_off_t;
#else
typedef off64_t fb_off_t;
#endif
 
Back to top
View user's profile Visit poster's website
DrV
Site Admin
PostPosted: Oct 11, 2006 17:24    Post subject: Reply with quote

Thanks, updated in CVS.
 
Back to top
View user's profile Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
1000101
Hero
PostPosted: Oct 25, 2006 21:45    Post subject: Reply with quote

In the section titled "Updating the FreeBASIC software installed in MSYS" there is an error. The current line regarding the first of the copies of the newly compiled compiler reads as follows:
wiki wrote:
cp -fv ~/fbccvs/FreeBASIC/bin/win32/* /FBbin/win32/bin


It should actually read:
Quote:
cp -fv ~/fbccvs/FreeBASIC/bin/win32/* /FBbin/bin/win32
 
Back to top
View user's profile
ici

PostPosted: Oct 26, 2006 15:29    Post subject: Reply with quote

Linux build, required one step more for me on Suse 10.1, after first cvs update
Make rtlib above make install
Quote:
mkdir -p ../../../../lib/linux

All steps again also: http://www.freebasic.net/forum/viewtopic.php?p=51934#51934
--edit--
strip debug info from libraries!
--edit--
make clean before second build
 
Back to top
View user's profile Visit poster's website
wolfman775

PostPosted: May 17, 2009 9:24    Post subject: Reply with quote

I got to make rtlib and just copied and pasted the commands and when it got to autoreconf I got this error:

Quote:

Wolfman@FM-WIN7-LAPTOP ~/fbccvs
$ cd ~/fbccvs/FreeBASIC/src/rtlib

Wolfman@FM-WIN7-LAPTOP ~/fbccvs/FreeBASIC/src/rtlib
$ autoreconf
11 [main] perl 2292 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap C:\cygwin\lib\perl5\5.10\i686-cygwin\auto\File\Glob\Glob.dll to same address as parent(0xA00000) != 0xA90000
 
Back to top
View user's profile Send e-mail
counting_pine
Site Admin
PostPosted: May 18, 2009 10:20    Post subject: Reply with quote

If you're trying the MinGW build, then maybe having cygwin tools in your path is causing problems.

Also: if your instructions mention CVS, they're very out of date. FB has been using SVN for a while. Try the wiki:
http://www.freebasic.net/wiki/wikka.php?wakka=SVNCompile
 
Back to top
View user's profile Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    freebasic.net Forum Index -> Documentation All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



sf.net phatcode