Re: [fpc-pascal] Cross-compilation to Linux from win32

2005-01-15 Thread Peter Vreman
> Hi,
>
> after quite some time I thought to give FPC another try to see if it's
> a suitable replacement for Kylix.
>
> My goal is to be able to cross-compile Linux elf targets from win32.
>
> So I downloaded and installed 1.9.6, and after that added the units
> packages for Linux.
>
> Run up FP, compiled hello world, worked. Switched the target in FP to
> linux, compiled again - and wow, it also worked. Using the verbose
> output I could even see it using the Linux units etc. All fine.
>
> Until I examined the generated executable "hello". It looks like it's
> a Linux binary packed into a PE file. Very weird. Doesn't run under
> Linux of course, and does nothing under Windows.
>
> Next attempt was to use fpc directly:
>
> C:\pp\demo\text>fpc -Aelf hello.pp
> Free Pascal Compiler version 1.9.6 [2004/12/31] for i386
> Copyright (c) 1993-2004 by Florian Klaempfl
> Target OS: Win32 for i386

The parameter -Tlinux is missing

> Compiling hello.pp
> Linking hello.exe
> 31 Lines compiled, 0.4 sec




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cross-compilation to Linux from win32

2005-01-15 Thread Michael . VanCanneyt


On Fri, 14 Jan 2005, Simon Kissel wrote:

> Hi,
> 
> after quite some time I thought to give FPC another try to see if it's
> a suitable replacement for Kylix.
> 
> My goal is to be able to cross-compile Linux elf targets from win32.
> 
> So I downloaded and installed 1.9.6, and after that added the units
> packages for Linux.
> 
> Run up FP, compiled hello world, worked. Switched the target in FP to
> linux, compiled again - and wow, it also worked. Using the verbose
> output I could even see it using the Linux units etc. All fine.
> 
> Until I examined the generated executable "hello". It looks like it's
> a Linux binary packed into a PE file. Very weird. Doesn't run under
> Linux of course, and does nothing under Windows.
> 
> Next attempt was to use fpc directly:
> 
> C:\pp\demo\text>fpc -Aelf hello.pp
> Free Pascal Compiler version 1.9.6 [2004/12/31] for i386
> Copyright (c) 1993-2004 by Florian Klaempfl
> Target OS: Win32 for i386
> Compiling hello.pp
> Linking hello.exe
> 31 Lines compiled, 0.4 sec
> 
> Well, no.
> 
> Some advise on what to do would be very welcome.

You can't do it using linux alone.

You must install cross-target binutils. Specifically: the linker must 
create a linux binary instead of a Windows binary.

Once you have those installed (there is a zip floating around somewhere)
you must point the compiler to them with the -FD parameter.

Michael.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Win32 DLL problem / VST audio plugin

2005-01-15 Thread chromdildo
Hi everybody,
I got a problem compiling a win32 DLLs with latest fpc/lazarus.
The DLL is a VST-Plugin, using the Delphi template from 
http://www.tobybear.de
exporting just one function "main", working perfectly under Delphi.

The only thing I found on the net was:
http://www.nl.freepascal.org/lists/fpc-pascal/2002-January/002663.html
Three years old. And doesnt work.
I checked (MS DLL dependency walker) the linked DLL (extremely big: 4,5 
MB compared to same compiled under Delphi: 400kB) with correctly 
exported function "main" (only if *NOT* smart linkable -CX) and noticed 
a wrong Link checksum (compared to real checksum)

No need to mention: the linked DLL doesnt work under any host...
I think this got something to do with the right compiler switches for 
static/dynamic librarys... But no way...

AND PLEASE: Dont tell me to use the original Delphi, I know there are 
free PE versions ... I finally want it to compile on a MAC, too!
Please, if you got any suggestions...

Thanks for your reply. And best regards.
./chrom
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Version 1.9.6[??] on the Mac.

2005-01-15 Thread Peter H.M. Brooks
Pedro Lopez-Cabanillas wrote:
You need to use FPC 1.9.4 or later; 1.9.6 should work, as Jonas pointed, 
because I'm using some features not available in older releases.

 

Here's a really curious thing!
I've been working to compile smf.pas. I've loaded fpc 1.9.6 on Windows 
XP and, indeed, it compiles perfectly - later I get errors finding Libc, 
but that's understandable as it isn't Unix, besides I really want it wo 
work on the Mac.

So, I've loaded fpc 1.9.6 on my Mac (powerpc, Mac/OS 10.x.x - the 
latest). When I try to compile it, I get the same error about the byte 
array, using Xcode. So I tried it with a command line compile:

ppcppc -Sd smf.pas
I get the same problem! This was very peculiar, so I tried:
ppcppc -iV
1.9.6
So I haven't loaded the wrong compiler by mistake.
It looks very much as if the code for the 1.9.6 compiler on Windows/XP 
and Mac/OS is different - in fact it looks as if the Mac version is an 
earlier release.

How could this have happened? Should I download the compiler and compile 
it from scratch, or is it likely that somebody will fix the problem?

Could I have something else wrong?
Have you actually managed to compile this on a Macintosh running the 
Panther OS?

While on the subject, of compiling the compiler. I have a dual 64-bit 
CPU on my Mac. Would it be possible to compile the compiler to run in 
64bit mode and be multi-threaded - and produce code that is 64bit and 
multi-threaded? I know that Tiger will provide full 64bit operation (at 
least that is promised), but, in theory, the compiler should be able to 
produce 64bit code now. If not, how long before this will be possible? 
Is it difficult to do?



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Version 1.9.6[??] on the Mac.

2005-01-15 Thread Simon Kissel
[Sorry, didn't notice reply-to is set to sender and not the list here]

Skybuck,

thanks for the detailed guide. However, it was simpler than that...
with the help from the guys at #fpc, I got
ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/mingwcross.zip

Unzipped that to \cross, then got myself some linux libs
needed for the dynamic linker (libc.so.6 and friends) and finally
I'm able to cross-compile hello world
C:\pp\demo\text>fpc -Tlinux -FDc:\pp\cross\i686-linux -XPi686-linux-
 -Xd -Xc -Fl c:\crosskylix\lib hello.pp

This is with dynamic linking of libc as pthreads is going to be used.
The resulting binary is a valid dynamic ELF file:

[EMAIL PROTECTED] /home/scamp# ldd hello
libc.so.6 => /lib/libc.so.6 (0x2aade000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x5000)

So far so good. Sadly it segfaults:

[EMAIL PROTECTED] /home/scamp# strace ./hello
execve("./hello", ["./hello"], [/* 26 vars */]) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Static linked binarys work fine, though. Now I only have to find out
why everything dynamically linked crashes.

Simon


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Version 1.9.6[??] on the Mac.

2005-01-15 Thread Florian Klaempfl
Simon Kissel wrote:
[Sorry, didn't notice reply-to is set to sender and not the list here]
Skybuck,
thanks for the detailed guide. However, it was simpler than that...
with the help from the guys at #fpc, I got
ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/mingwcross.zip
Unzipped that to \cross, then got myself some linux libs
needed for the dynamic linker (libc.so.6 and friends) and finally
I'm able to cross-compile hello world
C:\pp\demo\text>fpc -Tlinux -FDc:\pp\cross\i686-linux -XPi686-linux-
 -Xd -Xc -Fl c:\crosskylix\lib hello.pp
This is with dynamic linking of libc as pthreads is going to be used.
The resulting binary is a valid dynamic ELF file:
[EMAIL PROTECTED] /home/scamp# ldd hello
libc.so.6 => /lib/libc.so.6 (0x2aade000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x5000)
So far so good. Sadly it segfaults:
[EMAIL PROTECTED] /home/scamp# strace ./hello
execve("./hello", ["./hello"], [/* 26 vars */]) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Static linked binarys work fine, though. Now I only have to find out
why everything dynamically linked crashes.
The addresses where the shared libs should be loaded, look very strange 
usually it's 0x4000+ ?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Version 1.9.6[??] on the Mac.

2005-01-15 Thread Marco van de Voort
> > 
> > Static linked binarys work fine, though. Now I only have to find out
> > why everything dynamically linked crashes.
> > 
> 
> The addresses where the shared libs should be loaded, look very strange 
> usually it's 0x4000+ ?

Yes, I've a feeling mingw crosstools ignore -dynamic-linker= 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Missing units documentation?

2005-01-15 Thread Anton Tichawa
Hello!
After downloading and unzipping doc-html.zip (11.4M), I found that 
units/units.html, referenced by fpctoc.html, is missing. Where can I 
find units documentation?

Thank you,
Anton.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal